SAI3 BCLK adjustment

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SAI3 BCLK adjustment

1,845 Views
tedwu
Contributor I

Hi,

I use the CPU of iMX7d on Linux 4.9.11 on Yocto platform. My device tree extracts as follows. The file name is imx7d-sdb.dts. The WCLK is 48KHz, it is correct. The BCLK is 1.536MHz, it is incorrect. I want to change BCLK to 3.072MHz. How to change it? Thank you very much.

simple-audio-card,dai-link@1 {
format = "i2s";
bitclock-master = <&dailink1_master>;
frame-master = <&dailink1_master>;
dailink1_master: cpu {
sound-dai = <&sai3>;
system-clock-direction = "out";
system-clock-frequency = <12288000>;
};
codec {
sound-dai = <&cx2092x>;
system-clock-direction = "in";
system-clock-frequency = <12288000>;
};
};

&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
<&clks IMX7D_SAI3_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <36864000>;
status = "okay";
};

Labels (1)
0 Kudos
3 Replies

1,412 Views
tedwu
Contributor I

Hi igor,

Thanks, but there is some error messages as follows if I change IMX7D_SAI3_ROOT_SRC to IMX7D_AUDIO_MCLK_ROOT_SRC.

I use the command is "arecord -f S16_LE -r 48000 test.wav".

Error message:

fsl-sai 308c0000.sai: failed to derive required Rx rate: 1536000
fsl-sai 308c0000.sai: ASoC: can't set 308c0000.sai hw params: -22

&sai3 {
        #sound-dai-cells = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
        assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
                          <&clks IMX7D_SAI3_ROOT_CLK>;
        assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
        assigned-clock-rates = <0>, <36864000>;
        status = "okay";
};

Best regards

Ted

0 Kudos

1,412 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos

1,412 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ted

one can try to add

assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,

as in linux/arch/arm/boot/dts/imx7d-sdb.dts example

linux-imx.git - i.MX Linux Kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos