diff mbox series

ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting

Message ID 20191016124255.7442-1-erosca@de.adit-jv.com (mailing list archive)
State Mainlined
Commit 22e58665a01006d05f0239621f7d41cacca96cc4
Delegated to: Kieran Bingham
Headers show
Series ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting | expand

Commit Message

Eugeniu Rosca Oct. 16, 2019, 12:42 p.m. UTC
From: Junya Monden <jmonden@jp.adit-jv.com>

Unlike other format-related DAI parameters, rdai->bit_clk_inv flag
is not properly re-initialized when setting format for new stream
processing. The inversion, if requested, is then applied not to default,
but to a previous value, which leads to SCKP bit in SSICR register being
set incorrectly.
Fix this by re-setting the flag to its initial value, determined by format.

Fixes: 1a7889ca8aba3 ("ASoC: rsnd: fixup SND_SOC_DAIFMT_xB_xF behavior")
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: Jiada Wang <jiada_wang@mentor.com>
Cc: Timo Wischer <twischer@de.adit-jv.com>
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: Junya Monden <jmonden@jp.adit-jv.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---
 sound/soc/sh/rcar/core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kuninori Morimoto Oct. 16, 2019, 11:50 p.m. UTC | #1
Hi

> Unlike other format-related DAI parameters, rdai->bit_clk_inv flag
> is not properly re-initialized when setting format for new stream
> processing. The inversion, if requested, is then applied not to default,
> but to a previous value, which leads to SCKP bit in SSICR register being
> set incorrectly.
> Fix this by re-setting the flag to its initial value, determined by format.
> 
> Fixes: 1a7889ca8aba3 ("ASoC: rsnd: fixup SND_SOC_DAIFMT_xB_xF behavior")
> Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> Cc: Jiada Wang <jiada_wang@mentor.com>
> Cc: Timo Wischer <twischer@de.adit-jv.com>
> Cc: stable@vger.kernel.org # v3.17+
> Signed-off-by: Junya Monden <jmonden@jp.adit-jv.com>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
diff mbox series

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index bda5b958d0dc..e9596c2096cd 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -761,6 +761,7 @@  static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	}
 
 	/* set format */
+	rdai->bit_clk_inv = 0;
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		rdai->sys_delay = 0;