ASoC: fix deemphasis control in wm8904/55/60 codecs
Subsystems (3)
PATCH 1/1 ASoC: fix deemphasis control in wm8904/55/60 codecs
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 <[email protected]>
---
I discovered this while trying to adapt this deemphasis code to ak4641 codec.
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(-)
sound/soc/codecs/wm8904.c +2 -1
@@ -818,7 +818,8 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,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,
sound/soc/codecs/wm8955.c +2 -1
@@ -380,7 +380,8 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,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,
sound/soc/codecs/wm8960.c +2 -1
@@ -138,7 +138,8 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_kcontrol_chip (kcontrol);struct wm8960_priv *wm8960 =snd_soc_codec_get_drvdata (codec); -return wm8960->deemph; + ucontrol->value.enumerated.item[0 ] = wm8960->deemph; +return 0 ; } static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
Signature · 1 line
1.7.0.4
Quoted 6 lines · Dmitry Artamonow
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 <[email protected]>---
Acked-by Liam Girdwood <[email protected]>
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Mark Brown
AppliedQuoted 5 lines · Dmitry Artamonow
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 <[email protected]>
Applied, thanks.