diff mbox series

ASoC: wm8524: remove constraint for FE-BE

Message ID 20220422132125.1595729-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series ASoC: wm8524: remove constraint for FE-BE | expand

Commit Message

Fabio Estevam April 22, 2022, 1:21 p.m. UTC
From: Shengjiu Wang <shengjiu.wang@nxp.com>

The constraint is not needed for back end bistream since
the sample rate is fixed by dts and the constraint
is propagated to front end bistream as they share the same
snd_soc_pcm_runtime.

Fixes: 007b6a54c305 ("ASoC: codecs: add wm8524 codec driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Tested-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 sound/soc/codecs/wm8524.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'sound/soc/codecs/wm8524.c')

Comments

Charles Keepax April 22, 2022, 3:43 p.m. UTC | #1
On Fri, Apr 22, 2022 at 10:21:25AM -0300, Fabio Estevam wrote:
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> The constraint is not needed for back end bistream since
> the sample rate is fixed by dts and the constraint
> is propagated to front end bistream as they share the same
> snd_soc_pcm_runtime.
> 
> Fixes: 007b6a54c305 ("ASoC: codecs: add wm8524 codec driver")
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
> Tested-by: Fabio Estevam <festevam@denx.de>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---

There was some previous discussion of this patch here:

https://patchwork.kernel.org/project/alsa-devel/patch/1649754826-2651-1-git-send-email-shengjiu.wang@nxp.com/

Thanks,
Charles
Fabio Estevam April 22, 2022, 3:46 p.m. UTC | #2
Hi Charles,

On Fri, Apr 22, 2022 at 12:43 PM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:

> There was some previous discussion of this patch here:
>
> https://patchwork.kernel.org/project/alsa-devel/patch/1649754826-2651-1-git-send-email-shengjiu.wang@nxp.com/

Thanks for pointing this out. I was not aware of it.
diff mbox series

Patch

diff --git a/sound/soc/codecs/wm8524.c b/sound/soc/codecs/wm8524.c
index 81f858f..442a598 100644
--- a/sound/soc/codecs/wm8524.c
+++ b/sound/soc/codecs/wm8524.c
@@ -61,6 +61,7 @@  static int wm8524_startup(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_component *component = dai->component;
 	struct wm8524_priv *wm8524 = snd_soc_component_get_drvdata(component);
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 
 	/* The set of sample rates that can be supported depends on the
 	 * MCLK supplied to the CODEC - enforce this.
@@ -71,9 +72,10 @@  static int wm8524_startup(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	snd_pcm_hw_constraint_list(substream->runtime, 0,
-				   SNDRV_PCM_HW_PARAM_RATE,
-				   &wm8524->rate_constraint);
+	if (!rtd->dai_link->be_hw_params_fixup)
+		snd_pcm_hw_constraint_list(substream->runtime, 0,
+					   SNDRV_PCM_HW_PARAM_RATE,
+					   &wm8524->rate_constraint);
 
 	gpiod_set_value_cansleep(wm8524->mute, 1);