change imx6ul mclk rate to 48Mhz

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

change imx6ul mclk rate to 48Mhz

跳至解决方案
1,489 次查看
ed_nash
Contributor III

I need to change the CSI mclk output to 48MHz (reference clock required by imager).

I have tried changing the device tree and driver code:

 mclk = <48000000>; mclk_source = <0>; // must be 0 for imx6ul

ret = of_property_read_u32(dev->of_node, "mclk", &xxx_data.mclk);

if (ret) {

   dev_err(dev, "mclk frequency is invalid\n");

   return ret;

}

ret = of_property_read_u32(dev->of_node, "mclk_source", (u32 *) &(xxx_data.mclk_source));

if (ret) {

   dev_err(dev, "mclk_source invalid\n");

   return ret;

}

ret = clk_set_rate(xxx_data.sensor_clk, xxx_data.mclk);

if (ret < 0) {

   dev_err(dev, "set rate failed, rate=%d\n", xxx_data.mclk);

   return ret;

}

dev_info(dev, "mclk: %lu\n", clk_get_rate(xxx.sensor_clk));  <<<<<<< always prints 24000000

I have tried changing this in clk-imx6ul.c

   clk_set_rate(clks[IMX6UL_CLK_CSI], 24000000); to  clk_set_rate(clks[IMX6UL_CLK_CSI], 48000000);

But I still get 24000000.

If I comment out the line above, I get 12000000.

How do I get an output of 48000000 on MX6UL_PAD_CSI_MCLK__CSI_MCLK ?

Thanks in advance.

标签 (1)
0 项奖励
回复
1 解答
1,171 次查看
ed_nash
Contributor III

I resolved it by reparenting.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,172 次查看
ed_nash
Contributor III

I resolved it by reparenting.

0 项奖励
回复
1,171 次查看
tomfang
Contributor III

Hi Ed and Carlos,

I have the same issue, can you tell me what your solution is? i don't understand the "reparenting".

0 项奖励
回复
1,171 次查看
Carlos_Musich
NXP Employee
NXP Employee

Thank you for sharing your solution Ed.

Regards,

Carlos

0 项奖励
回复