How to disable MCLK ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to disable MCLK ?

1,569件の閲覧回数
khang_letruong
Senior Contributor III

Dear Community,

To rule out the impact of MCLK frequency to other high speed interfaces on our custom PCB based on iMX8MP, we have a need to enable/disable the MIPI-CSI2 camera driver in order to enable /disable the MCLK clock:

I re-built the ov5640_mipi_v2.c as loadable kernel module :

diff --git a/arch/arm64/configs/imx_v8_defconfig b/arch/arm64/configs/imx_v8_defconfig
index a8a46508482d..a096230294d3 100644
--- a/arch/arm64/configs/imx_v8_defconfig
+++ b/arch/arm64/configs/imx_v8_defconfig
@@ -528,7 +528,7 @@ CONFIG_VIDEO_MXC_CAPTURE=y
 CONFIG_VIDEO_MX8_CAPTURE=y
 CONFIG_VIDEO_MXC_CSI_CAMERA=y
 CONFIG_MXC_MIPI_CSI=y
-CONFIG_MXC_CAMERA_OV5640_MIPI_V2=y
+CONFIG_MXC_CAMERA_OV5640_MIPI_V2=m
 CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_SDR_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_IMX219=m

 

I saw the in remove() function, clk_disable_unprepare(sensor->sensor_clk) is called. But the 24-MHz MCLK  still persists after rmmod.

static int ov5640_remove(struct i2c_client *client)
{
        struct v4l2_subdev *sd = i2c_get_clientdata(client);
        struct ov5640 *sensor = to_ov5640(client);

        v4l2_async_unregister_subdev(sd);

        clk_disable_unprepare(sensor->sensor_clk);

        ov5640_power_down(sensor, 1);

        ov5640_regualtor_disable();

        return 0;
}

 

I would like to know how to disable it completely during the removing of the module, please?

Thanks in advance and best regards,
Khang

0 件の賞賛
返信
4 返答(返信)

1,527件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

refer to the schematic

joanxie_0-1687146571020.png

the dts file set this already,

pinctrl_csi_mclk: csi_mclk_grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO15__CCM_CLKO2 0x50
>;
};

0 件の賞賛
返信

1,507件の閲覧回数
khang_letruong
Senior Contributor III

Hi @joanxie ,

Sorry that I did not catch what you meant.Did you mean that MCLK was enabled permanently by the relevant lines in dts file ?

I would like to know if there's any way to disable the MCLK  in runtime, please ?

Best Regards,

Khang

 

0 件の賞賛
返信

1,488件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

the HW and dts I shared with you, just reminder you checking if you disable it correctly, how did you disable this

0 件の賞賛
返信

1,489件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

how did you set in the dts file? did you disable this camera in the dts? if yes, did you still measure the mclk 24M from this pin?

0 件の賞賛
返信