diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-01-28 07:36:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-01-28 09:35:20 -0500 |
commit | e03a8d2cf663429e2480a8db78b132ee300f79af (patch) | |
tree | 618d48c2fed3079b5065f13ea8a3a00f5864b9cc | |
parent | fb58a2ff300cb3fd6077484ca7d8c6e6f13a0350 (diff) |
ASoC: Add TLV information and additional volumes to WM9713
Also renames a few things to make volumes and switches match up in
alsamixer.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | sound/soc/codecs/wm9713.c | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 96e46d9a0171..ceb86b4ddb25 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <sound/ac97_codec.h> | 23 | #include <sound/ac97_codec.h> |
24 | #include <sound/initval.h> | 24 | #include <sound/initval.h> |
25 | #include <sound/pcm_params.h> | 25 | #include <sound/pcm_params.h> |
26 | #include <sound/tlv.h> | ||
26 | #include <sound/soc.h> | 27 | #include <sound/soc.h> |
27 | #include <sound/soc-dapm.h> | 28 | #include <sound/soc-dapm.h> |
28 | 29 | ||
@@ -113,15 +114,27 @@ SOC_ENUM_SINGLE(AC97_3D_CONTROL, 12, 3, wm9713_mic_select), /* mic selection 18 | |||
113 | SOC_ENUM_SINGLE(MICB_MUX, 0, 2, wm9713_micb_select), /* mic selection 19 */ | 114 | SOC_ENUM_SINGLE(MICB_MUX, 0, 2, wm9713_micb_select), /* mic selection 19 */ |
114 | }; | 115 | }; |
115 | 116 | ||
117 | static const DECLARE_TLV_DB_SCALE(out_tlv, -4650, 150, 0); | ||
118 | static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0); | ||
119 | static const DECLARE_TLV_DB_SCALE(misc_tlv, -1500, 300, 0); | ||
120 | static unsigned int mic_tlv[] = { | ||
121 | TLV_DB_RANGE_HEAD(2), | ||
122 | 0, 2, TLV_DB_SCALE_ITEM(1200, 600, 0), | ||
123 | 3, 3, TLV_DB_SCALE_ITEM(3000, 0, 0), | ||
124 | }; | ||
125 | |||
116 | static const struct snd_kcontrol_new wm9713_snd_ac97_controls[] = { | 126 | static const struct snd_kcontrol_new wm9713_snd_ac97_controls[] = { |
117 | SOC_DOUBLE("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1), | 127 | SOC_DOUBLE_TLV("Speaker Playback Volume", AC97_MASTER, 8, 0, 31, 1, out_tlv), |
118 | SOC_DOUBLE("Speaker Playback Switch", AC97_MASTER, 15, 7, 1, 1), | 128 | SOC_DOUBLE("Speaker Playback Switch", AC97_MASTER, 15, 7, 1, 1), |
119 | SOC_DOUBLE("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1), | 129 | SOC_DOUBLE_TLV("Headphone Playback Volume", AC97_HEADPHONE, 8, 0, 31, 1, |
130 | out_tlv), | ||
120 | SOC_DOUBLE("Headphone Playback Switch", AC97_HEADPHONE, 15, 7, 1, 1), | 131 | SOC_DOUBLE("Headphone Playback Switch", AC97_HEADPHONE, 15, 7, 1, 1), |
121 | SOC_DOUBLE("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1), | 132 | SOC_DOUBLE_TLV("Line In Volume", AC97_PC_BEEP, 8, 0, 31, 1, main_tlv), |
122 | SOC_DOUBLE("PCM Playback Volume", AC97_PHONE, 8, 0, 31, 1), | 133 | SOC_DOUBLE_TLV("PCM Playback Volume", AC97_PHONE, 8, 0, 31, 1, main_tlv), |
123 | SOC_SINGLE("Mic 1 Volume", AC97_MIC, 8, 31, 1), | 134 | SOC_SINGLE_TLV("Mic 1 Volume", AC97_MIC, 8, 31, 1, main_tlv), |
124 | SOC_SINGLE("Mic 2 Volume", AC97_MIC, 0, 31, 1), | 135 | SOC_SINGLE_TLV("Mic 2 Volume", AC97_MIC, 0, 31, 1, main_tlv), |
136 | SOC_SINGLE_TLV("Mic 1 Preamp Volume", AC97_3D_CONTROL, 10, 3, 0, mic_tlv), | ||
137 | SOC_SINGLE_TLV("Mic 2 Preamp Volume", AC97_3D_CONTROL, 12, 3, 0, mic_tlv), | ||
125 | 138 | ||
126 | SOC_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0), | 139 | SOC_SINGLE("Mic Boost (+20dB) Switch", AC97_LINE, 5, 1, 0), |
127 | SOC_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1), | 140 | SOC_SINGLE("Mic Headphone Mixer Volume", AC97_LINE, 0, 7, 1), |
@@ -131,7 +144,7 @@ SOC_ENUM("Capture Volume Steps", wm9713_enum[5]), | |||
131 | SOC_DOUBLE("Capture Volume", AC97_CD, 8, 0, 31, 0), | 144 | SOC_DOUBLE("Capture Volume", AC97_CD, 8, 0, 31, 0), |
132 | SOC_SINGLE("Capture ZC Switch", AC97_CD, 7, 1, 0), | 145 | SOC_SINGLE("Capture ZC Switch", AC97_CD, 7, 1, 0), |
133 | 146 | ||
134 | SOC_SINGLE("Capture to Headphone Volume", AC97_VIDEO, 11, 7, 1), | 147 | SOC_SINGLE_TLV("Capture to Headphone Volume", AC97_VIDEO, 11, 7, 1, misc_tlv), |
135 | SOC_SINGLE("Capture to Mono Boost (+20dB) Switch", AC97_VIDEO, 8, 1, 0), | 148 | SOC_SINGLE("Capture to Mono Boost (+20dB) Switch", AC97_VIDEO, 8, 1, 0), |
136 | SOC_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0), | 149 | SOC_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0), |
137 | 150 | ||
@@ -152,28 +165,43 @@ SOC_DOUBLE("Headphone Playback ZC Switch", AC97_HEADPHONE, 14, 6, 1, 0), | |||
152 | 165 | ||
153 | SOC_SINGLE("Out4 Playback Switch", AC97_MASTER_MONO, 15, 1, 1), | 166 | SOC_SINGLE("Out4 Playback Switch", AC97_MASTER_MONO, 15, 1, 1), |
154 | SOC_SINGLE("Out4 Playback ZC Switch", AC97_MASTER_MONO, 14, 1, 0), | 167 | SOC_SINGLE("Out4 Playback ZC Switch", AC97_MASTER_MONO, 14, 1, 0), |
155 | SOC_SINGLE("Out4 Playback Volume", AC97_MASTER_MONO, 8, 63, 1), | 168 | SOC_SINGLE_TLV("Out4 Playback Volume", AC97_MASTER_MONO, 8, 31, 1, out_tlv), |
156 | 169 | ||
157 | SOC_SINGLE("Out3 Playback Switch", AC97_MASTER_MONO, 7, 1, 1), | 170 | SOC_SINGLE("Out3 Playback Switch", AC97_MASTER_MONO, 7, 1, 1), |
158 | SOC_SINGLE("Out3 Playback ZC Switch", AC97_MASTER_MONO, 6, 1, 0), | 171 | SOC_SINGLE("Out3 Playback ZC Switch", AC97_MASTER_MONO, 6, 1, 0), |
159 | SOC_SINGLE("Out3 Playback Volume", AC97_MASTER_MONO, 0, 63, 1), | 172 | SOC_SINGLE_TLV("Out3 Playback Volume", AC97_MASTER_MONO, 0, 31, 1, out_tlv), |
160 | 173 | ||
161 | SOC_SINGLE("Mono Capture Volume", AC97_MASTER_TONE, 8, 31, 1), | 174 | SOC_SINGLE_TLV("Mono Capture Volume", AC97_MASTER_TONE, 8, 31, 1, main_tlv), |
162 | SOC_SINGLE("Mono Playback Switch", AC97_MASTER_TONE, 7, 1, 1), | 175 | SOC_SINGLE("Mono Playback Switch", AC97_MASTER_TONE, 7, 1, 1), |
163 | SOC_SINGLE("Mono Playback ZC Switch", AC97_MASTER_TONE, 6, 1, 0), | 176 | SOC_SINGLE("Mono Playback ZC Switch", AC97_MASTER_TONE, 6, 1, 0), |
164 | SOC_SINGLE("Mono Playback Volume", AC97_MASTER_TONE, 0, 31, 1), | 177 | SOC_SINGLE_TLV("Mono Playback Volume", AC97_MASTER_TONE, 0, 31, 1, out_tlv), |
165 | 178 | ||
166 | SOC_SINGLE("Beep Playback Headphone Volume", AC97_AUX, 12, 7, 1), | 179 | SOC_SINGLE_TLV("Headphone Mixer Beep Playback Volume", AC97_AUX, 12, 7, 1, |
167 | SOC_SINGLE("Beep Playback Speaker Volume", AC97_AUX, 8, 7, 1), | 180 | misc_tlv), |
168 | SOC_SINGLE("Beep Playback Mono Volume", AC97_AUX, 4, 7, 1), | 181 | SOC_SINGLE_TLV("Speaker Mixer Beep Playback Volume", AC97_AUX, 8, 7, 1, |
182 | misc_tlv), | ||
183 | SOC_SINGLE_TLV("Mono Mixer Beep Playback Volume", AC97_AUX, 4, 7, 1, misc_tlv), | ||
169 | 184 | ||
170 | SOC_SINGLE("Voice Playback Headphone Volume", AC97_PCM, 12, 7, 1), | 185 | SOC_SINGLE_TLV("Voice Playback Headphone Volume", AC97_PCM, 12, 7, 1, |
186 | misc_tlv), | ||
171 | SOC_SINGLE("Voice Playback Master Volume", AC97_PCM, 8, 7, 1), | 187 | SOC_SINGLE("Voice Playback Master Volume", AC97_PCM, 8, 7, 1), |
172 | SOC_SINGLE("Voice Playback Mono Volume", AC97_PCM, 4, 7, 1), | 188 | SOC_SINGLE("Voice Playback Mono Volume", AC97_PCM, 4, 7, 1), |
173 | 189 | ||
190 | SOC_SINGLE_TLV("Headphone Mixer Aux Playback Volume", AC97_REC_SEL, 12, 7, 1, | ||
191 | misc_tlv), | ||
192 | |||
193 | SOC_SINGLE_TLV("Speaker Mixer Voice Playback Volume", AC97_PCM, 8, 7, 1, | ||
194 | misc_tlv), | ||
195 | SOC_SINGLE_TLV("Speaker Mixer Aux Playback Volume", AC97_REC_SEL, 8, 7, 1, | ||
196 | misc_tlv), | ||
197 | |||
198 | SOC_SINGLE_TLV("Mono Mixer Voice Playback Volume", AC97_PCM, 4, 7, 1, | ||
199 | misc_tlv), | ||
200 | SOC_SINGLE_TLV("Mono Mixer Aux Playback Volume", AC97_REC_SEL, 4, 7, 1, | ||
201 | misc_tlv), | ||
202 | |||
174 | SOC_SINGLE("Aux Playback Headphone Volume", AC97_REC_SEL, 12, 7, 1), | 203 | SOC_SINGLE("Aux Playback Headphone Volume", AC97_REC_SEL, 12, 7, 1), |
175 | SOC_SINGLE("Aux Playback Master Volume", AC97_REC_SEL, 8, 7, 1), | 204 | SOC_SINGLE("Aux Playback Master Volume", AC97_REC_SEL, 8, 7, 1), |
176 | SOC_SINGLE("Aux Playback Mono Volume", AC97_REC_SEL, 4, 7, 1), | ||
177 | 205 | ||
178 | SOC_ENUM("Bass Control", wm9713_enum[16]), | 206 | SOC_ENUM("Bass Control", wm9713_enum[16]), |
179 | SOC_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1), | 207 | SOC_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1), |