diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-30 14:30:33 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-30 14:34:32 -0400 |
commit | a5f8d2f1b83d47b09ff7b587b9402c449e1e18d5 (patch) | |
tree | e9630f542ce32b48059dd60356e87a2c956e91ca /sound/soc/codecs/wm8974.c | |
parent | 91d0c3ecbaf6616c0723d7aad9b6dadad2dea43f (diff) |
ASoC: Add WM8974 TLV information
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8974.c')
-rw-r--r-- | sound/soc/codecs/wm8974.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index d07bd0ddd439..cb2c41201606 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <sound/soc.h> | 25 | #include <sound/soc.h> |
26 | #include <sound/soc-dapm.h> | 26 | #include <sound/soc-dapm.h> |
27 | #include <sound/initval.h> | 27 | #include <sound/initval.h> |
28 | #include <sound/tlv.h> | ||
28 | 29 | ||
29 | #include "wm8974.h" | 30 | #include "wm8974.h" |
30 | 31 | ||
@@ -137,6 +138,11 @@ static const struct soc_enum wm8974_enum[] = { | |||
137 | SOC_ENUM_SINGLE(WM8974_ALC3, 8, 2, wm8974_alc), | 138 | SOC_ENUM_SINGLE(WM8974_ALC3, 8, 2, wm8974_alc), |
138 | }; | 139 | }; |
139 | 140 | ||
141 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1); | ||
142 | static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); | ||
143 | static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1200, 75, 0); | ||
144 | static const DECLARE_TLV_DB_SCALE(spk_tlv, -5700, 100, 0); | ||
145 | |||
140 | static const struct snd_kcontrol_new wm8974_snd_controls[] = { | 146 | static const struct snd_kcontrol_new wm8974_snd_controls[] = { |
141 | 147 | ||
142 | SOC_SINGLE("Digital Loopback Switch", WM8974_COMP, 0, 1, 0), | 148 | SOC_SINGLE("Digital Loopback Switch", WM8974_COMP, 0, 1, 0), |
@@ -147,33 +153,33 @@ SOC_ENUM("ADC Companding", wm8974_enum[0]), | |||
147 | SOC_ENUM("Playback De-emphasis", wm8974_enum[2]), | 153 | SOC_ENUM("Playback De-emphasis", wm8974_enum[2]), |
148 | SOC_SINGLE("DAC Inversion Switch", WM8974_DAC, 0, 1, 0), | 154 | SOC_SINGLE("DAC Inversion Switch", WM8974_DAC, 0, 1, 0), |
149 | 155 | ||
150 | SOC_SINGLE("PCM Volume", WM8974_DACVOL, 0, 127, 0), | 156 | SOC_SINGLE_TLV("PCM Volume", WM8974_DACVOL, 0, 255, 0, digital_tlv), |
151 | 157 | ||
152 | SOC_SINGLE("High Pass Filter Switch", WM8974_ADC, 8, 1, 0), | 158 | SOC_SINGLE("High Pass Filter Switch", WM8974_ADC, 8, 1, 0), |
153 | SOC_SINGLE("High Pass Cut Off", WM8974_ADC, 4, 7, 0), | 159 | SOC_SINGLE("High Pass Cut Off", WM8974_ADC, 4, 7, 0), |
154 | SOC_SINGLE("ADC Inversion Switch", WM8974_COMP, 0, 1, 0), | 160 | SOC_SINGLE("ADC Inversion Switch", WM8974_COMP, 0, 1, 0), |
155 | 161 | ||
156 | SOC_SINGLE("Capture Volume", WM8974_ADCVOL, 0, 127, 0), | 162 | SOC_SINGLE_TLV("Capture Volume", WM8974_ADCVOL, 0, 255, 0, digital_tlv), |
157 | 163 | ||
158 | SOC_ENUM("Equaliser Function", wm8974_enum[3]), | 164 | SOC_ENUM("Equaliser Function", wm8974_enum[3]), |
159 | SOC_ENUM("EQ1 Cut Off", wm8974_enum[4]), | 165 | SOC_ENUM("EQ1 Cut Off", wm8974_enum[4]), |
160 | SOC_SINGLE("EQ1 Volume", WM8974_EQ1, 0, 31, 1), | 166 | SOC_SINGLE_TLV("EQ1 Volume", WM8974_EQ1, 0, 24, 1, eq_tlv), |
161 | 167 | ||
162 | SOC_ENUM("Equaliser EQ2 Bandwith", wm8974_enum[5]), | 168 | SOC_ENUM("Equaliser EQ2 Bandwith", wm8974_enum[5]), |
163 | SOC_ENUM("EQ2 Cut Off", wm8974_enum[6]), | 169 | SOC_ENUM("EQ2 Cut Off", wm8974_enum[6]), |
164 | SOC_SINGLE("EQ2 Volume", WM8974_EQ2, 0, 31, 1), | 170 | SOC_SINGLE_TLV("EQ2 Volume", WM8974_EQ2, 0, 24, 1, eq_tlv), |
165 | 171 | ||
166 | SOC_ENUM("Equaliser EQ3 Bandwith", wm8974_enum[7]), | 172 | SOC_ENUM("Equaliser EQ3 Bandwith", wm8974_enum[7]), |
167 | SOC_ENUM("EQ3 Cut Off", wm8974_enum[8]), | 173 | SOC_ENUM("EQ3 Cut Off", wm8974_enum[8]), |
168 | SOC_SINGLE("EQ3 Volume", WM8974_EQ3, 0, 31, 1), | 174 | SOC_SINGLE_TLV("EQ3 Volume", WM8974_EQ3, 0, 24, 1, eq_tlv), |
169 | 175 | ||
170 | SOC_ENUM("Equaliser EQ4 Bandwith", wm8974_enum[9]), | 176 | SOC_ENUM("Equaliser EQ4 Bandwith", wm8974_enum[9]), |
171 | SOC_ENUM("EQ4 Cut Off", wm8974_enum[10]), | 177 | SOC_ENUM("EQ4 Cut Off", wm8974_enum[10]), |
172 | SOC_SINGLE("EQ4 Volume", WM8974_EQ4, 0, 31, 1), | 178 | SOC_SINGLE_TLV("EQ4 Volume", WM8974_EQ4, 0, 24, 1, eq_tlv), |
173 | 179 | ||
174 | SOC_ENUM("Equaliser EQ5 Bandwith", wm8974_enum[11]), | 180 | SOC_ENUM("Equaliser EQ5 Bandwith", wm8974_enum[11]), |
175 | SOC_ENUM("EQ5 Cut Off", wm8974_enum[12]), | 181 | SOC_ENUM("EQ5 Cut Off", wm8974_enum[12]), |
176 | SOC_SINGLE("EQ5 Volume", WM8974_EQ5, 0, 31, 1), | 182 | SOC_SINGLE_TLV("EQ5 Volume", WM8974_EQ5, 0, 24, 1, eq_tlv), |
177 | 183 | ||
178 | SOC_SINGLE("DAC Playback Limiter Switch", WM8974_DACLIM1, 8, 1, 0), | 184 | SOC_SINGLE("DAC Playback Limiter Switch", WM8974_DACLIM1, 8, 1, 0), |
179 | SOC_SINGLE("DAC Playback Limiter Decay", WM8974_DACLIM1, 4, 15, 0), | 185 | SOC_SINGLE("DAC Playback Limiter Decay", WM8974_DACLIM1, 4, 15, 0), |
@@ -198,11 +204,11 @@ SOC_SINGLE("ALC Capture Noise Gate Switch", WM8974_NGATE, 3, 1, 0), | |||
198 | SOC_SINGLE("ALC Capture Noise Gate Threshold", WM8974_NGATE, 0, 7, 0), | 204 | SOC_SINGLE("ALC Capture Noise Gate Threshold", WM8974_NGATE, 0, 7, 0), |
199 | 205 | ||
200 | SOC_SINGLE("Capture PGA ZC Switch", WM8974_INPPGA, 7, 1, 0), | 206 | SOC_SINGLE("Capture PGA ZC Switch", WM8974_INPPGA, 7, 1, 0), |
201 | SOC_SINGLE("Capture PGA Volume", WM8974_INPPGA, 0, 63, 0), | 207 | SOC_SINGLE_TLV("Capture PGA Volume", WM8974_INPPGA, 0, 63, 0, inpga_tlv), |
202 | 208 | ||
203 | SOC_SINGLE("Speaker Playback ZC Switch", WM8974_SPKVOL, 7, 1, 0), | 209 | SOC_SINGLE("Speaker Playback ZC Switch", WM8974_SPKVOL, 7, 1, 0), |
204 | SOC_SINGLE("Speaker Playback Switch", WM8974_SPKVOL, 6, 1, 1), | 210 | SOC_SINGLE("Speaker Playback Switch", WM8974_SPKVOL, 6, 1, 1), |
205 | SOC_SINGLE("Speaker Playback Volume", WM8974_SPKVOL, 0, 63, 0), | 211 | SOC_SINGLE_TLV("Speaker Playback Volume", WM8974_SPKVOL, 0, 63, 1, spk_tlv), |
206 | 212 | ||
207 | SOC_SINGLE("Capture Boost(+20dB)", WM8974_ADCBOOST, 8, 1, 0), | 213 | SOC_SINGLE("Capture Boost(+20dB)", WM8974_ADCBOOST, 8, 1, 0), |
208 | SOC_SINGLE("Mono Playback Switch", WM8974_MONOMIX, 6, 1, 0), | 214 | SOC_SINGLE("Mono Playback Switch", WM8974_MONOMIX, 6, 1, 0), |