All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms
@ 2011-05-16  4:18 Mark Brown
  2011-05-16  4:18 ` [PATCH 2/2] ASoC: Don't restart an already running WM8958 DSP2 Mark Brown
  2011-05-16 13:00 ` [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2011-05-16  4:18 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown

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>
---
 sound/soc/codecs/wm8958-dsp2.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 5d4bc7a..ca26779 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;
 
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: Don't restart an already running WM8958 DSP2
  2011-05-16  4:18 [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Mark Brown
@ 2011-05-16  4:18 ` Mark Brown
  2011-05-16 13:00 ` [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-05-16  4:18 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown

Don't want to upset the DSP.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8958-dsp2.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index ca26779..0293763 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -362,6 +362,10 @@ static void wm8958_dsp_apply(struct snd_soc_codec *codec, int path, int start)
 		path, wm8994->dsp_active, start, pwr_reg, reg);
 
 	if (start && ena) {
+		/* If the DSP is already running then noop */
+		if (reg & WM8958_DSP2_ENA)
+			return;
+
 		/* If either AIFnCLK is not yet enabled postpone */
 		if (!(snd_soc_read(codec, WM8994_AIF1_CLOCKING_1)
 		      & WM8994_AIF1CLK_ENA_MASK) &&
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms
  2011-05-16  4:18 [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Mark Brown
  2011-05-16  4:18 ` [PATCH 2/2] ASoC: Don't restart an already running WM8958 DSP2 Mark Brown
@ 2011-05-16 13:00 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-05-16 13:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com

On 16/05/11 05:18, Mark Brown wrote:
> 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>
> ---

Both

Acked-by: Liam Girdwood <lrg@ti.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-16 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16  4:18 [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Mark Brown
2011-05-16  4:18 ` [PATCH 2/2] ASoC: Don't restart an already running WM8958 DSP2 Mark Brown
2011-05-16 13:00 ` [PATCH 1/2] ASoC: Skip noop reconfiguration of WM8958 DSP2 algorithms Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.