summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-15 18:02:53 -0700
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-16 08:55:20 -0700
commitd7fdae7c6533b9a409158c736781cdd352b76793 (patch)
treef67cf0776675e6d13918f677acf4757954658e84 /sound/soc
parentfb5af53d421d80725172427e9076f6e889603df6 (diff)
downloadblackbird-op-linux-d7fdae7c6533b9a409158c736781cdd352b76793.tar.gz
blackbird-op-linux-d7fdae7c6533b9a409158c736781cdd352b76793.zip
ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms
If we're setting the currently applied value for one of the DSP algorithm configurations we can just skip all the handling as the control set is a noop. This ensures we do not disrupt a running DSP. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Cc: stable@kernel.org
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8958-dsp2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 5d4bc7a21df7..ca26779bb6b2 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -508,6 +508,9 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+ if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0])
+ return 0;
+
if (ucontrol->value.integer.value[0] > 1)
return -EINVAL;
@@ -628,6 +631,9 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+ if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0])
+ return 0;
+
if (ucontrol->value.integer.value[0] > 1)
return -EINVAL;
@@ -689,6 +695,16 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+ if (hpf < 3) {
+ if (wm8994->hpf1_ena[hpf % 3] ==
+ ucontrol->value.integer.value[0])
+ return 0;
+ } else {
+ if (wm8994->hpf2_ena[hpf % 3] ==
+ ucontrol->value.integer.value[0])
+ return 0;
+ }
+
if (ucontrol->value.integer.value[0] > 1)
return -EINVAL;
@@ -782,6 +798,9 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
+ if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0])
+ return 0;
+
if (ucontrol->value.integer.value[0] > 1)
return -EINVAL;
OpenPOWER on IntegriCloud