change imx6ul mclk rate to 48Mhz

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

change imx6ul mclk rate to 48Mhz

Jump to solution
1,141 Views
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.

Labels (1)
0 Kudos
1 Solution
823 Views
ed_nash
Contributor III

I resolved it by reparenting.

View solution in original post

0 Kudos
3 Replies
824 Views
ed_nash
Contributor III

I resolved it by reparenting.

0 Kudos
823 Views
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 Kudos
823 Views
Carlos_Musich
NXP Employee
NXP Employee

Thank you for sharing your solution Ed.

Regards,

Carlos

0 Kudos