linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: stm32: i2s: fix 32 bits channel length without mclk
@ 2021-11-17 10:44 Olivier Moysan
  2021-11-17 22:31 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Moysan @ 2021-11-17 10:44 UTC (permalink / raw)
  To: Alexandre Torgue, Arnaud Pouliquen, Jaroslav Kysela,
	Liam Girdwood, Mark Brown, Maxime Coquelin, Olivier Moysan,
	Takashi Iwai
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, linux-stm32

Fix divider calculation in the case of 32 bits channel
configuration, when no master clock is used.

Fixes: e4e6ec7b127c ("ASoC: stm32: Add I2S driver")

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 sound/soc/stm/stm32_i2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c
index 6254bacad6eb..717f45a83445 100644
--- a/sound/soc/stm/stm32_i2s.c
+++ b/sound/soc/stm/stm32_i2s.c
@@ -700,7 +700,7 @@ static int stm32_i2s_configure_clock(struct snd_soc_dai *cpu_dai,
 		if (ret < 0)
 			return ret;
 
-		nb_bits = frame_len * ((cgfr & I2S_CGFR_CHLEN) + 1);
+		nb_bits = frame_len * (FIELD_GET(I2S_CGFR_CHLEN, cgfr) + 1);
 		ret = stm32_i2s_calc_clk_div(i2s, i2s_clock_rate,
 					     (nb_bits * rate));
 		if (ret)
-- 
2.17.1


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

* Re: [PATCH] ASoC: stm32: i2s: fix 32 bits channel length without mclk
  2021-11-17 10:44 [PATCH] ASoC: stm32: i2s: fix 32 bits channel length without mclk Olivier Moysan
@ 2021-11-17 22:31 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-11-17 22:31 UTC (permalink / raw)
  To: Maxime Coquelin, Liam Girdwood, Olivier Moysan, Jaroslav Kysela,
	Takashi Iwai, Arnaud Pouliquen, Alexandre Torgue
  Cc: linux-kernel, linux-stm32, alsa-devel, linux-arm-kernel

On Wed, 17 Nov 2021 11:44:04 +0100, Olivier Moysan wrote:
> Fix divider calculation in the case of 32 bits channel
> configuration, when no master clock is used.
> 
> Fixes: e4e6ec7b127c ("ASoC: stm32: Add I2S driver")
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: stm32: i2s: fix 32 bits channel length without mclk
      commit: 424fe7edbed18d47f7b97f7e1322a6f8969b77ae

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

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

end of thread, other threads:[~2021-11-17 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 10:44 [PATCH] ASoC: stm32: i2s: fix 32 bits channel length without mclk Olivier Moysan
2021-11-17 22:31 ` 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).