diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2008-12-09 05:35:46 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-12-09 05:49:21 -0500 |
commit | e8ff9c417ad6e8f7ef253e36f9d6e22dc2aa2512 (patch) | |
tree | a0525ec25eb3f50cf2ed9af4cfd3eb0dfa838ef4 /sound/soc/codecs/twl4030.c | |
parent | 44c5587035fbbdd368a3d5d8d11997d43758078a (diff) |
ASoC: TWL4030: Add DAPM event handler for output MUX selection
DAPM event handler is set to filter out invalid MUX settings
for certain outputs.
Earpiece:
- 0 = Off
- 1 = DACL1
- 2 = DACL2
- 3 = *** Invalid ***
- 4 = DACR1
PreDriveL/R:
- 0 = Off/Off
- 1 = DACL1/DACR1
- 2 = DACL2/DACR2
- 3 = *** Invalid/Invalid ***
- 4 = DACR2/DACL2
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r-- | sound/soc/codecs/twl4030.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 4293ec7b5021..9d1078325c3d 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -190,6 +190,30 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) | |||
190 | 190 | ||
191 | } | 191 | } |
192 | 192 | ||
193 | static int outmixer_event(struct snd_soc_dapm_widget *w, | ||
194 | struct snd_kcontrol *kcontrol, int event) | ||
195 | { | ||
196 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; | ||
197 | int ret = 0; | ||
198 | int val; | ||
199 | |||
200 | switch (e->reg) { | ||
201 | case TWL4030_REG_PREDL_CTL: | ||
202 | case TWL4030_REG_PREDR_CTL: | ||
203 | case TWL4030_REG_EAR_CTL: | ||
204 | val = w->value >> e->shift_l; | ||
205 | if (val == 3) { | ||
206 | printk(KERN_WARNING | ||
207 | "Invalid MUX setting for register 0x%02x (%d)\n", | ||
208 | e->reg, val); | ||
209 | ret = -1; | ||
210 | } | ||
211 | break; | ||
212 | } | ||
213 | |||
214 | return ret; | ||
215 | } | ||
216 | |||
193 | /* | 217 | /* |
194 | * Some of the gain controls in TWL (mostly those which are associated with | 218 | * Some of the gain controls in TWL (mostly those which are associated with |
195 | * the outputs) are implemented in an interesting way: | 219 | * the outputs) are implemented in an interesting way: |