Change freqency of mclk for ov5640_mipi with imx6dl

cancel
Showing results for 
Search instead for 
Did you mean: 

Change freqency of mclk for ov5640_mipi with imx6dl

1,417 Views
dongpv
Contributor III

Hi,

Currently, We're doing EMC testing for our product that using imx6dl and camera ov5640.

Now, we want to change frequency of mclk for ov5640_mipi. It's default value is 24Mhz.

I tried change mclk with many difference value from device tree but it still got measuring result from Oscilloscope is 24Mhz.

    ov564x_mipi: ov564x_mipi@3c { /* i2c2 driver */
        compatible = "ovti,ov564x_mipi";
        reg = <0x3c>;
        clocks = <&clks 201>;
        clock-names = "csi_mclk";
        DOVDD-supply = <&vgen4_reg>; /* 1.8v */
        AVDD-supply = <&vgen3_reg>;  /* 2.8v, rev C board is VGEN3
                        rev B board is VGEN5 */
        DVDD-supply = <&vgen2_reg>;  /* 1.5v*/
        pwn-gpios = <&gpio1 19 1>;   /* active low: SD1_CLK */
        rst-gpios = <&gpio1 20 0>;   /* active high: SD1_DAT2 */
        csi_id = <1>;
        mclk = <12000000>;  /* default is 24000000 */
        mclk_source = <0>;
    };

My question is if above solutions is not correct . So, is there any way to change this frequency of mclk?

Kernel version we 're using is Linux 4.1.15.

Thanks & Best Regards,

Dong

Labels (1)
3 Replies

642 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Dong

clocks = <&clks 201>;  is defined in
linux/include/dt-bindings/clock/imx6qdl-clock.h

also one can add cko2_podf, (it is defined in imx6qdl-clock.h as #define IMX6QDL_CLK_CKO2_PODF            199 )

and described in sect.18.6.21 CCM Clock Output Source Register (CCM_CCOSR) i.MX6Q RM

please check linux/arch/arm/mach-imx/clk-imx6q.c
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/clk-imx6q.c?h=imx...
    imx_clk_set_parent(clk[IMX6QDL_CLK_CKO2_SEL], clk[IMX6QDL_CLK_OSC]);
    imx_clk_set_parent(clk[IMX6QDL_CLK_CKO], clk[IMX6QDL_CLK_CKO2]);

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

642 Views
dongpv
Contributor III

Hi igor,

Sorry , I not really clearly how to change that speed on ov5640_mipi? could you please explain more about that solution, where  I should change the value of speed so that it can reduce frequency of mipi_ov5640. :smileyhappy: Thanks very much for your respond !

Best regards,

Dong

0 Kudos

642 Views
dongpv
Contributor III

Hi Igor,

I tried to change clock from 201 to 199 like that clocks = <&clks 199> from device tree but camera can't work, there are no output for mclk also.

I don't know it's correct with your suggestion or not?

Thanks

Dong

0 Kudos