<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 5, 2022 at 11:58 PM Ahmad Fatoum <<a href="mailto:a.fatoum@pengutronix.de">a.fatoum@pengutronix.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Refactoring in commit a50b7926d015 ("ASoC: fsl_sai: implement 1:1<br>
bclk:mclk ratio support") led to the bypass never happening<br>
as (ratio = 1) was caught in the existing if (ratio & 1) continue;<br>
check. The correct check sequence instead is:<br>
<br>
 - skip all ratios lower than one and higher than 512<br>
 - skip all odd ratios except for 1:1<br>
 - skip 1:1 ratio if and only if !support_1_1_ratio<br>
<br>
And for all others, calculate the appropriate divider. Adjust the<br>
code to facilitate this.<br>
<br>
Fixes: a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support")<br>
Signed-off-by: Ahmad Fatoum <<a href="mailto:a.fatoum@pengutronix.de" target="_blank">a.fatoum@pengutronix.de</a>><br></blockquote><div><br></div><div>Acked-by: Shengjiu Wang <<a href="mailto:shengjiu.wang@gmail.com">shengjiu.wang@gmail.com</a>></div><div><br></div><div>Best regards</div><div>Wang shengjiu</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 sound/soc/fsl/fsl_sai.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c<br>
index a992d51568cc..50c377f16097 100644<br>
--- a/sound/soc/fsl/fsl_sai.c<br>
+++ b/sound/soc/fsl/fsl_sai.c<br>
@@ -372,7 +372,7 @@ static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)<br>
                        continue;<br>
                if (ratio == 1 && !support_1_1_ratio)<br>
                        continue;<br>
-               else if (ratio & 1)<br>
+               if ((ratio & 1) && ratio > 1)<br>
                        continue;<br>
<br>
                diff = abs((long)clk_rate - ratio * freq);<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div>