<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 6, 2023 at 7:08 PM Fabio Estevam <<a href="mailto:festevam@gmail.com">festevam@gmail.com</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">Hi Andreas,<br>
<br>
On Thu, Jul 6, 2023 at 5:47 AM Andreas Henriksson <<a href="mailto:andreas@fatal.se" target="_blank">andreas@fatal.se</a>> wrote:<br>
<br>
> We've been working on an i.MX8MP where MCLK needs to be input and found<br>
> that this enables the MCLK as output despite not having set the<br>
> `fsl,sai-mclk-direction-output;` devicetree property in our DT.<br>
> Reverting the patch fixes the issues for us.<br>
><br>
> I have to say that the code comment made me a bit confused, but once<br>
> I found the commit message I understood why this code existed.<br>
> If this is really i.MX8MM specific maybe mention that in the code<br>
> comment and please make the code actually only trigger on i.MX8MM.<br>
> It seems to me like these all fulfill the current criteria:<br>
> imx7ulp, imx8mq, imx8mm, imx8mp, imx8ulp, imx93<br>
><br>
> Should I report this in <a href="http://bugzilla.kernel.org" rel="noreferrer" target="_blank">bugzilla.kernel.org</a> ?<br>
<br>
Should we do a fix like this?<br>
<br>
--- a/sound/soc/fsl/fsl_sai.c<br>
+++ b/sound/soc/fsl/fsl_sai.c<br>
@@ -1453,7 +1453,7 @@ static int fsl_sai_probe(struct platform_device *pdev)<br>
<br>
        /* Select MCLK direction */<br>
        if (sai->mclk_direction_output &&<br>
-           sai->soc_data->max_register >= FSL_SAI_MCTL) {<br>
+           sai->soc_data->max_register >= FSL_SAI_MCTL &&<br>
sai->mclk_direction_output) {<br>
                regmap_update_bits(sai->regmap, FSL_SAI_MCTL,<br>
                                   FSL_SAI_MCTL_MCLK_EN, FSL_SAI_MCTL_MCLK_EN);<br>
        }<br></blockquote><div><br></div><div>No, this is the code in probe().</div><div>The code with the issue is in <span style="color:rgb(80,0,80)">fsl_sai_set_bclk().</span><br></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">The clean way for fixing is to remove the code in </span><span style="color:rgb(80,0,80)">fsl_sai_set_bclk()</span></div><div><span style="color:rgb(80,0,80)">and add "</span>fsl,sai-mclk-direction-output;" property in dts for some</div><div>node.</div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">best regards</span></div><div><span style="color:rgb(80,0,80)">wang shengjiu</span></div><div><span style="color:rgb(80,0,80)"><br></span></div></div></div>