<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックIMX6UL L SAI MCLK Output on startup to initialize Codec / DAC / sound device correctly</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMX6UL-L-SAI-MCLK-Output-on-startup-to-initialize-Codec-DAC/m-p/1978968#M229972</link>
    <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We use an IMX6ULL board running yocto and are using it for audio application.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;As a second sound device we are using a PCM1681 DAC (reading some questions here the WM8960 behaves similarly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The device needs a running MCLK to be properly initialized which we couldn't get with the existing settings and properties.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Besides the&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fsl,sai-mclk-direction-output&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;property we introduced our own&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fsl,sai-mclk-force-output&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;property in the &lt;A href="https://www.kernel.org/doc/Documentation/devicetree/bindings/sound/fsl-sai.txt" target="_blank" rel="noopener"&gt;SAI device tree entry&lt;/A&gt; and added a patch to the&lt;/FONT&gt; sound/soc/fsl/fsl_sai.c &lt;FONT face="arial,helvetica,sans-serif"&gt;driver&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;When the argument is used, the MCLK of the corresponding SAI doesn't get stopped by the power management.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Here is our custom patch featuring debug messages as warnings. This could probably be cleaned up a bit.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Has anyone had a similar issue or solution? We hope this patch can be useful for others.&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Subject: [PATCH] SAI MCLK force output&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;sound/soc/fsl/fsl_sai.c | 9 +++++++++&lt;BR /&gt;1 file changed, 9 insertions(+)&lt;/P&gt;&lt;P&gt;diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;index 6a12cbd43084..87e3b12ed679 100644&lt;BR /&gt;--- a/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;+++ b/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;@@ -1173,6 +1173,15 @@ static int fsl_sai_probe(struct platform_device *pdev)&lt;BR /&gt;if (ret)&lt;BR /&gt;goto err_pm_get_sync;&lt;BR /&gt;&lt;BR /&gt;+ if (of_find_property(np, "fsl,sai-mclk-force-output", NULL)) {&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 1: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ sai-&amp;gt;mclk_streams |= BIT(SNDRV_PCM_STREAM_PLAYBACK);&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 2: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ fsl_sai_runtime_resume(dev);&lt;BR /&gt;+ sai-&amp;gt;mclk_streams &amp;amp;= ~BIT(SNDRV_PCM_STREAM_PLAYBACK);&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 3: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;return ret;&lt;BR /&gt;&lt;BR /&gt;err_pm_get_sync:&lt;BR /&gt;--&lt;BR /&gt;2.25.1&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 22 Oct 2024 08:08:39 GMT</pubDate>
    <dc:creator>IndustrialP_LB</dc:creator>
    <dc:date>2024-10-22T08:08:39Z</dc:date>
    <item>
      <title>IMX6UL L SAI MCLK Output on startup to initialize Codec / DAC / sound device correctly</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX6UL-L-SAI-MCLK-Output-on-startup-to-initialize-Codec-DAC/m-p/1978968#M229972</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We use an IMX6ULL board running yocto and are using it for audio application.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;As a second sound device we are using a PCM1681 DAC (reading some questions here the WM8960 behaves similarly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The device needs a running MCLK to be properly initialized which we couldn't get with the existing settings and properties.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Besides the&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fsl,sai-mclk-direction-output&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;property we introduced our own&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fsl,sai-mclk-force-output&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;property in the &lt;A href="https://www.kernel.org/doc/Documentation/devicetree/bindings/sound/fsl-sai.txt" target="_blank" rel="noopener"&gt;SAI device tree entry&lt;/A&gt; and added a patch to the&lt;/FONT&gt; sound/soc/fsl/fsl_sai.c &lt;FONT face="arial,helvetica,sans-serif"&gt;driver&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;When the argument is used, the MCLK of the corresponding SAI doesn't get stopped by the power management.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Here is our custom patch featuring debug messages as warnings. This could probably be cleaned up a bit.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Has anyone had a similar issue or solution? We hope this patch can be useful for others.&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Subject: [PATCH] SAI MCLK force output&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;sound/soc/fsl/fsl_sai.c | 9 +++++++++&lt;BR /&gt;1 file changed, 9 insertions(+)&lt;/P&gt;&lt;P&gt;diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;index 6a12cbd43084..87e3b12ed679 100644&lt;BR /&gt;--- a/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;+++ b/sound/soc/fsl/fsl_sai.c&lt;BR /&gt;@@ -1173,6 +1173,15 @@ static int fsl_sai_probe(struct platform_device *pdev)&lt;BR /&gt;if (ret)&lt;BR /&gt;goto err_pm_get_sync;&lt;BR /&gt;&lt;BR /&gt;+ if (of_find_property(np, "fsl,sai-mclk-force-output", NULL)) {&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 1: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ sai-&amp;gt;mclk_streams |= BIT(SNDRV_PCM_STREAM_PLAYBACK);&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 2: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ fsl_sai_runtime_resume(dev);&lt;BR /&gt;+ sai-&amp;gt;mclk_streams &amp;amp;= ~BIT(SNDRV_PCM_STREAM_PLAYBACK);&lt;BR /&gt;+ dev_warn(dev, "MCLK Output forced 3: %d\n", sai-&amp;gt;mclk_streams);&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;return ret;&lt;BR /&gt;&lt;BR /&gt;err_pm_get_sync:&lt;BR /&gt;--&lt;BR /&gt;2.25.1&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Oct 2024 08:08:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX6UL-L-SAI-MCLK-Output-on-startup-to-initialize-Codec-DAC/m-p/1978968#M229972</guid>
      <dc:creator>IndustrialP_LB</dc:creator>
      <dc:date>2024-10-22T08:08:39Z</dc:date>
    </item>
  </channel>
</rss>

