aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-15 21:02:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-16 11:55:20 -0400
commitd7fdae7c6533b9a409158c736781cdd352b76793 (patch)
treef67cf0776675e6d13918f677acf4757954658e84
parentfb5af53d421d80725172427e9076f6e889603df6 (diff)
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
-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,
508 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 508 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
509 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 509 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
510 510
511 if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0])
512 return 0;
513
511 if (ucontrol->value.integer.value[0] > 1) 514 if (ucontrol->value.integer.value[0] > 1)
512 return -EINVAL; 515 return -EINVAL;
513 516
@@ -628,6 +631,9 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol,
628 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 631 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
629 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 632 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
630 633
634 if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0])
635 return 0;
636
631 if (ucontrol->value.integer.value[0] > 1) 637 if (ucontrol->value.integer.value[0] > 1)
632 return -EINVAL; 638 return -EINVAL;
633 639
@@ -689,6 +695,16 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
689 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 695 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
690 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 696 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
691 697
698 if (hpf < 3) {
699 if (wm8994->hpf1_ena[hpf % 3] ==
700 ucontrol->value.integer.value[0])
701 return 0;
702 } else {
703 if (wm8994->hpf2_ena[hpf % 3] ==
704 ucontrol->value.integer.value[0])
705 return 0;
706 }
707
692 if (ucontrol->value.integer.value[0] > 1) 708 if (ucontrol->value.integer.value[0] > 1)
693 return -EINVAL; 709 return -EINVAL;
694 710
@@ -782,6 +798,9 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol,
782 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 798 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
783 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 799 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
784 800
801 if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0])
802 return 0;
803
785 if (ucontrol->value.integer.value[0] > 1) 804 if (ucontrol->value.integer.value[0] > 1)
786 return -EINVAL; 805 return -EINVAL;
787 806