2 * linux/include/linux/l3/uda1341.h
4 * Philips UDA1341 mixer device driver for ALSA
6 * Copyright (c) 2002 Tomas Kasparek <tomas.kasparek@seznam.cz>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License.
13 * 2002-03-13 Tomas Kasparek Initial release - based on uda1341.h from OSS
14 * 2002-03-30 Tomas Kasparek Proc filesystem support, complete mixer and DSP
18 /* $Id: uda1341.h,v 1.6 2004/05/03 17:36:50 tiwai Exp $ */
20 #define UDA1341_ALSA_NAME "snd-uda1341"
23 * Default rate set after inicialization
25 #define AUDIO_RATE_DEFAULT 44100
28 * UDA1341 L3 address and command types
30 #define UDA1341_L3ADDR 5
31 #define UDA1341_DATA0 (UDA1341_L3ADDR << 2 | 0)
32 #define UDA1341_DATA1 (UDA1341_L3ADDR << 2 | 1)
33 #define UDA1341_STATUS (UDA1341_L3ADDR << 2 | 2)
40 const char *onoff_names[] = {
56 const char *format_names[] = {
62 "in LSB 16bits/out MSB",
63 "in LSB 18bits/out MSB",
64 "in LSB 20bits/out MSB",
74 const char *fs_names[] = {
78 "Unused - bad value!",
86 const char *peak_names[] = {
98 const char *filter_names[] = {
105 const char*bass_values[][16] = {
106 {"0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB",
107 "0 dB", "0 dB", "0 dB", "0 dB", "undefined", }, //flat
108 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "18 dB",
109 "18 dB", "18 dB", "18 dB", "18 dB", "undefined",}, // min
110 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "18 dB",
111 "18 dB", "18 dB", "18 dB", "18 dB", "undefined",}, // min
112 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "20 dB",
113 "22 dB", "24 dB", "24 dB", "24 dB", "undefined",}, // max
123 const char *mixer_names[] = {
124 "double differential",
125 "input channel 1 (line in)",
126 "input channel 2 (microphone)",
137 const char *deemp_names[] = {
144 const char *mic_sens_value[] = {
145 "-3 dB", "0 dB", "3 dB", "9 dB", "15 dB", "21 dB", "27 dB", "not used",
148 const unsigned short AGC_atime[] = {
149 11, 16, 11, 16, 21, 11, 16, 21,
152 const unsigned short AGC_dtime[] = {
153 100, 100, 200, 200, 200, 400, 400, 400,
156 const char *AGC_level[] = {
157 "-9.0", "-11.5", "-15.0", "-17.5",
160 const char *ig_small_value[] = {
161 "-3.0", "-2.5", "-2.0", "-1.5", "-1.0", "-0.5",
165 * this was computed as peak_value[i] = pow((63-i)*1.42,1.013)
167 * UDA1341 datasheet on page 21: Peak value (dB) = (Peak level - 63.5)*5*log2
168 * There is an table with these values [level]=value: [3]=-90.31, [7]=-84.29
169 * [61]=-2.78, [62] = -1.48, [63] = 0.0
170 * I tried to compute it, but using but even using logarithm with base either 10 or 2
171 * i was'n able to get values in the table from the formula. So I constructed another
172 * formula (see above) to interpolate the values as good as possible. If there is some
173 * mistake, please contact me on tomas.kasparek@seznam.cz. Thanks.
174 * UDA1341TS datasheet is available at:
175 * http://www-us9.semiconductors.com/acrobat/datasheets/UDA1341TS_3.pdf
177 const char *peak_value[] = {
178 "-INF dB", "N.A.", "N.A", "90.31 dB", "N.A.", "N.A.", "N.A.", "-84.29 dB",
179 "-82.65 dB", "-81.13 dB", "-79.61 dB", "-78.09 dB", "-76.57 dB", "-75.05 dB", "-73.53 dB",
180 "-72.01 dB", "-70.49 dB", "-68.97 dB", "-67.45 dB", "-65.93 dB", "-64.41 dB", "-62.90 dB",
181 "-61.38 dB", "-59.86 dB", "-58.35 dB", "-56.83 dB", "-55.32 dB", "-53.80 dB", "-52.29 dB",
182 "-50.78 dB", "-49.26 dB", "-47.75 dB", "-46.24 dB", "-44.73 dB", "-43.22 dB", "-41.71 dB",
183 "-40.20 dB", "-38.69 dB", "-37.19 dB", "-35.68 dB", "-34.17 dB", "-32.67 dB", "-31.17 dB",
184 "-29.66 dB", "-28.16 dB", "-26.66 dB", "-25.16 dB", "-23.66 dB", "-22.16 dB", "-20.67 dB",
185 "-19.17 dB", "-17.68 dB", "-16.19 dB", "-14.70 dB", "-13.21 dB", "-11.72 dB", "-10.24 dB",
186 "-8.76 dB", "-7.28 dB", "-5.81 dB", "-4.34 dB", "-2.88 dB", "-1.43 dB", "0.00 dB",
189 enum uda1341_config {
221 //used in update_bits (write_cfg) to avoid l3_write - just update local copy of regs.
223 //update local regs and write value to uda1341 - do l3_write
227 int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt);
231 * indent-tabs-mode: t