Hello,
I would like to set the SAI1_MCLK frequency on an i.MX7d. I have tried to set the frequency from within the device tree. But so far no luck.
Is it possible to set the mclk frequency from within the device tree, OR do I have to modify the clock driver file(clk-imx7d.c), for the desired rate? (if it is possible to do this in device tree, please indicate what should be added to the device tree file to accomplish this)
thanks
&sai1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>,
<&clks IMX7D_SAI1_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <24576000>;
fsl,sai-mclk-direction-output;
fsl,sai-synchronous-rx;
status = "okay";
};
# cat /sys/kernel/debug/clk/clk_summary | grep sai1:
clock enable_cnt prepare_cnt rate accuracy phase
sai1_src 0 0 162864000 0 0
sai1_cg 0 0 162864000 0 0
sai1_pre_div 0 0 23266286 0 0
sai1_post_div 0 0 23266286 0 0
sai1_root_clk 0 0 23266286 0 0
sai1_ipg_cllk 0 1 67500000 0 0
Hi Ed_McM,
I apologize for the late reply.
It is possible to modify the Clock Rate through the Device Tree, but given the response in clk_summary, the sai1_root_clk is the frequency closest to 24.576 Mhz given the value of the PRE_DIVIDER (7) and having that specified clock source.
You could try to change the value of clock source and check the following thread to guide you:
https://community.nxp.com/t5/i-MX-Processors/IMX7s-SAI-mclk-clock-source/m-p/717473
Regards,
Luis Pérez.
Hi Luis,
Thanks for the feedback. I will check that thread out.
Ed