Skip to content

Commit d00887c

Browse files
a3fbroonie
authored andcommitted
ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support
Refactoring in commit a50b792 ("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: a50b792 ("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>
1 parent 51a630a commit d00887c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/fsl/fsl_sai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
372372
continue;
373373
if (ratio == 1 && !support_1_1_ratio)
374374
continue;
375-
else if (ratio & 1)
375+
if ((ratio & 1) && ratio > 1)
376376
continue;
377377

378378
diff = abs((long)clk_rate - ratio * freq);

0 commit comments

Comments
 (0)