From 7c9f5b85c28a42d046aa3898d1ddfb04d5b46d85 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 9 Dec 2008 12:35:46 +0200 Subject: [PATCH] --- yaml --- r: 120285 b: refs/heads/master c: e8ff9c417ad6e8f7ef253e36f9d6e22dc2aa2512 h: refs/heads/master i: 120283: cc10bbf889e5f0e09f62feef18201103ab969962 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/twl4030.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 894dd76315e5..e90064ff63dc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44c5587035fbbdd368a3d5d8d11997d43758078a +refs/heads/master: e8ff9c417ad6e8f7ef253e36f9d6e22dc2aa2512 diff --git a/trunk/sound/soc/codecs/twl4030.c b/trunk/sound/soc/codecs/twl4030.c index 4293ec7b5021..9d1078325c3d 100644 --- a/trunk/sound/soc/codecs/twl4030.c +++ b/trunk/sound/soc/codecs/twl4030.c @@ -190,6 +190,30 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) } +static int outmixer_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; + int ret = 0; + int val; + + switch (e->reg) { + case TWL4030_REG_PREDL_CTL: + case TWL4030_REG_PREDR_CTL: + case TWL4030_REG_EAR_CTL: + val = w->value >> e->shift_l; + if (val == 3) { + printk(KERN_WARNING + "Invalid MUX setting for register 0x%02x (%d)\n", + e->reg, val); + ret = -1; + } + break; + } + + return ret; +} + /* * Some of the gain controls in TWL (mostly those which are associated with * the outputs) are implemented in an interesting way: