[PATCH] [23/139] ASoC: fix deemphasis control in wm8904/55/60 codecs

From: Andi Kleen
Date: Tue Feb 01 2011 - 19:43:44 EST


2.6.35-longterm review patch. If anyone has any objections, please let me know.

------------------
From: Dmitry Artamonow <mad_soft@xxxxxxxx>

commit 3f343f8512c7882a3637d9aea4ec6b3801cbcdc5 upstream.

Deemphasis control's .get callback should update control's value instead
of returning it - return value of callback function is used for indicating
error or success of operation.

Signed-off-by: Dmitry Artamonow <mad_soft@xxxxxxxx>
Acked-by: Liam Girdwood <lrg@xxxxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

---
sound/soc/codecs/wm8904.c | 3 ++-
sound/soc/codecs/wm8955.c | 3 ++-
sound/soc/codecs/wm8960.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.35.y/sound/soc/codecs/wm8904.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm8904.c
+++ linux-2.6.35.y/sound/soc/codecs/wm8904.c
@@ -820,7 +820,8 @@ static int wm8904_get_deemph(struct snd_
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);

- return wm8904->deemph;
+ ucontrol->value.enumerated.item[0] = wm8904->deemph;
+ return 0;
}

static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
Index: linux-2.6.35.y/sound/soc/codecs/wm8955.c
===================================================================
--- linux-2.6.35.y.orig/sound/soc/codecs/wm8955.c
+++ linux-2.6.35.y/sound/soc/codecs/wm8955.c
@@ -384,7 +384,8 @@ static int wm8955_get_deemph(struct snd_
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);

- return wm8955->deemph;
+ ucontrol->value.enumerated.item[0] = wm8955->deemph;
+ return 0;
}

static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/