diff options
author | Ashish Chavan <ashish.chavan@kpitcummins.com> | 2011-10-15 05:17:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-17 17:43:32 -0400 |
commit | 0ee6e9e721fc85e093e20e7a9ca848cfa71f80a9 (patch) | |
tree | eaa652ad2f7001a2d645497d2d8855e1de9a6a77 /sound | |
parent | 01840bbe5f4406bf1d24590b96b0e3df43aaa81a (diff) |
ASoC: da7210: Add support for ADC & DAC equalizers
This patch adds support for ADC and DAC five band equalizers
available on DA7210 codec.
Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/da7210.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 902fa5861901..7dc1259010be 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c | |||
@@ -34,10 +34,16 @@ | |||
34 | #define DA7210_INMIX_R 0x0E | 34 | #define DA7210_INMIX_R 0x0E |
35 | #define DA7210_ADC_HPF 0x0F | 35 | #define DA7210_ADC_HPF 0x0F |
36 | #define DA7210_ADC 0x10 | 36 | #define DA7210_ADC 0x10 |
37 | #define DA7210_ADC_EQ1_2 0X11 | ||
38 | #define DA7210_ADC_EQ3_4 0x12 | ||
39 | #define DA7210_ADC_EQ5 0x13 | ||
37 | #define DA7210_DAC_HPF 0x14 | 40 | #define DA7210_DAC_HPF 0x14 |
38 | #define DA7210_DAC_L 0x15 | 41 | #define DA7210_DAC_L 0x15 |
39 | #define DA7210_DAC_R 0x16 | 42 | #define DA7210_DAC_R 0x16 |
40 | #define DA7210_DAC_SEL 0x17 | 43 | #define DA7210_DAC_SEL 0x17 |
44 | #define DA7210_DAC_EQ1_2 0x19 | ||
45 | #define DA7210_DAC_EQ3_4 0x1A | ||
46 | #define DA7210_DAC_EQ5 0x1B | ||
41 | #define DA7210_OUTMIX_L 0x1C | 47 | #define DA7210_OUTMIX_L 0x1C |
42 | #define DA7210_OUTMIX_R 0x1D | 48 | #define DA7210_OUTMIX_R 0x1D |
43 | #define DA7210_HP_L_VOL 0x21 | 49 | #define DA7210_HP_L_VOL 0x21 |
@@ -158,11 +164,42 @@ static const unsigned int hp_out_tlv[] = { | |||
158 | 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0), | 164 | 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0), |
159 | }; | 165 | }; |
160 | 166 | ||
167 | static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0); | ||
168 | static const DECLARE_TLV_DB_SCALE(adc_eq_master_gain_tlv, -1800, 600, 1); | ||
169 | |||
161 | static const struct snd_kcontrol_new da7210_snd_controls[] = { | 170 | static const struct snd_kcontrol_new da7210_snd_controls[] = { |
162 | 171 | ||
163 | SOC_DOUBLE_R_TLV("HeadPhone Playback Volume", | 172 | SOC_DOUBLE_R_TLV("HeadPhone Playback Volume", |
164 | DA7210_HP_L_VOL, DA7210_HP_R_VOL, | 173 | DA7210_HP_L_VOL, DA7210_HP_R_VOL, |
165 | 0, 0x3F, 0, hp_out_tlv), | 174 | 0, 0x3F, 0, hp_out_tlv), |
175 | |||
176 | /* DAC Equalizer controls */ | ||
177 | SOC_SINGLE("DAC EQ Switch", DA7210_DAC_EQ5, 7, 1, 0), | ||
178 | SOC_SINGLE_TLV("DAC EQ1 Volume", DA7210_DAC_EQ1_2, 0, 0xf, 1, | ||
179 | eq_gain_tlv), | ||
180 | SOC_SINGLE_TLV("DAC EQ2 Volume", DA7210_DAC_EQ1_2, 4, 0xf, 1, | ||
181 | eq_gain_tlv), | ||
182 | SOC_SINGLE_TLV("DAC EQ3 Volume", DA7210_DAC_EQ3_4, 0, 0xf, 1, | ||
183 | eq_gain_tlv), | ||
184 | SOC_SINGLE_TLV("DAC EQ4 Volume", DA7210_DAC_EQ3_4, 4, 0xf, 1, | ||
185 | eq_gain_tlv), | ||
186 | SOC_SINGLE_TLV("DAC EQ5 Volume", DA7210_DAC_EQ5, 0, 0xf, 1, | ||
187 | eq_gain_tlv), | ||
188 | |||
189 | /* ADC Equalizer controls */ | ||
190 | SOC_SINGLE("ADC EQ Switch", DA7210_ADC_EQ5, 7, 1, 0), | ||
191 | SOC_SINGLE_TLV("ADC EQ Master Volume", DA7210_ADC_EQ5, 4, 0x3, | ||
192 | 1, adc_eq_master_gain_tlv), | ||
193 | SOC_SINGLE_TLV("ADC EQ1 Volume", DA7210_ADC_EQ1_2, 0, 0xf, 1, | ||
194 | eq_gain_tlv), | ||
195 | SOC_SINGLE_TLV("ADC EQ2 Volume", DA7210_ADC_EQ1_2, 4, 0xf, 1, | ||
196 | eq_gain_tlv), | ||
197 | SOC_SINGLE_TLV("ADC EQ3 Volume", DA7210_ADC_EQ3_4, 0, 0xf, 1, | ||
198 | eq_gain_tlv), | ||
199 | SOC_SINGLE_TLV("ADC EQ4 Volume", DA7210_ADC_EQ3_4, 4, 0xf, 1, | ||
200 | eq_gain_tlv), | ||
201 | SOC_SINGLE_TLV("ADC EQ5 Volume", DA7210_ADC_EQ5, 0, 0xf, 1, | ||
202 | eq_gain_tlv), | ||
166 | }; | 203 | }; |
167 | 204 | ||
168 | /* Codec private data */ | 205 | /* Codec private data */ |