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
refer to the schematic
the dts file set this already,
pinctrl_csi_mclk: csi_mclk_grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO15__CCM_CLKO2 0x50
>;
};
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
the HW and dts I shared with you, just reminder you checking if you disable it correctly, how did you disable this
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?