]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support
authorAhmad Fatoum <a.fatoum@pengutronix.de>
Tue, 5 Apr 2022 15:57:31 +0000 (17:57 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 6 Apr 2022 14:50:05 +0000 (15:50 +0100)
commitb2198256d6a394b65ca8e38771f0b8b2dad23064
tree0c365911e5e0c743ed819a336123c1f2c619840c
parentceb7a868c153996dbb8303a3f68eece025d466a6
ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support

Refactoring in commit 16f3d76f9b6f ("ASoC: fsl_sai: implement 1:1
bclk:mclk ratio support") led to the bypass never happening
as (ratio = 1) was caught in the existing if (ratio & 1) continue;
check. The correct check sequence instead is:

 - skip all ratios lower than one and higher than 512
 - skip all odd ratios except for 1:1
 - skip 1:1 ratio if and only if !support_1_1_ratio

And for all others, calculate the appropriate divider. Adjust the
code to facilitate this.

Fixes: 16f3d76f9b6f ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220405155731.745413-1-a.fatoum@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_sai.c