linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting
@ 2019-10-16 12:42 Eugeniu Rosca
  2019-10-16 23:50 ` Kuninori Morimoto
  2019-10-18 18:07 ` Applied "ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Eugeniu Rosca @ 2019-10-16 12:42 UTC (permalink / raw)
  To: Linux-Renesas, Kuninori Morimoto, Takashi Iwai, Jaroslav Kysela,
	Mark Brown, Liam Girdwood, linux-kernel, alsa-devel
  Cc: Eugeniu Rosca, Eugeniu Rosca, Junya Monden, Andrew Gabbasov,
	Jiada Wang, Timo Wischer, stable

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(+)

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;
-- 
2.23.0


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

* Re: [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting
  2019-10-16 12:42 [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting Eugeniu Rosca
@ 2019-10-16 23:50 ` Kuninori Morimoto
  2019-10-18 18:07 ` Applied "ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2019-10-16 23:50 UTC (permalink / raw)
  To: Eugeniu Rosca
  Cc: Linux-Renesas, Takashi Iwai, Jaroslav Kysela, Mark Brown,
	Liam Girdwood, linux-kernel, alsa-devel, Eugeniu Rosca,
	Junya Monden, Andrew Gabbasov, Jiada Wang, Timo Wischer, stable


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>


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

* Applied "ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting" to the asoc tree
  2019-10-16 12:42 [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting Eugeniu Rosca
  2019-10-16 23:50 ` Kuninori Morimoto
@ 2019-10-18 18:07 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-10-18 18:07 UTC (permalink / raw)
  To: Junya Monden
  Cc: alsa-devel, Andrew Gabbasov, Eugeniu Rosca, Eugeniu Rosca,
	Jaroslav Kysela, Jiada Wang, Kuninori Morimoto, Liam Girdwood,
	linux-kernel, Linux-Renesas, Mark Brown, stable, stable,
	Takashi Iwai, Timo Wischer

The patch

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

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 22e58665a01006d05f0239621f7d41cacca96cc4 Mon Sep 17 00:00:00 2001
From: Junya Monden <jmonden@jp.adit-jv.com>
Date: Wed, 16 Oct 2019 14:42:55 +0200
Subject: [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every
 format setting

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>
Link: https://lore.kernel.org/r/20191016124255.7442-1-erosca@de.adit-jv.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/core.c | 1 +
 1 file changed, 1 insertion(+)

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;
-- 
2.20.1


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

end of thread, other threads:[~2019-10-18 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 12:42 [PATCH] ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting Eugeniu Rosca
2019-10-16 23:50 ` Kuninori Morimoto
2019-10-18 18:07 ` Applied "ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).