Problem statement : In V4L2 Sub device Driver (OV5647) couldn’t link with the MIPI-CSI dev node (/dev/video2)
Setup Details:
1. Base Board: Ixora v1.1
2. Module: Apalis iMX6D 1 GB IT
3. Kernel: Building Kernel image separately. (BSP 5.0: Branch - toradex_5.4-2.3.x-imx)
(git clone -b toradex_5.4-2.3.x-imx git://git.toradex.com/linux-toradex.git)
4. V4L2 Sub-device: OV5647 (drivers/media/platform/mxc/capture/ov5647_mipi.c)
After configuring toolchain, Kernel configuration done as below :
a) make apalis_imx6_defconfig
b) make menuconfig
MXC_CAMERA_OV5647_MIPI [=y]
-> Device Driver
-> Multi-media Support (MEDIA_SUPPORT [=y])
-> V4L Platform Devices (V4L_PLATFORM_DRIVERS [=y])
-> mxc mipi csi driver[=y]
-> MXC Camera/V4L2 PRP Features Support
-> Omnivision ov5647 camera support using mipi[=y]
-> Select Overlay Routing (Queue ipu device for overlay library)[=y]
-> Pre-Processor Encoder Library [=y]
-> IPU CSI Encoder Library [=y]
Depends on : MEDIA_SUPPORT [=y] && V4L_PLATFORM_DRIVERS [=y] && VIDEO_MXC_CAPTURE [=y] && MXC_MIPI_CSI [=y] && I2C [=y]
Below entries added in imx6q-apalis-eval.dts
ov5647_csi_cam: camera@36 {
compatible = "ov5647_mipi";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_cam_mclk>;
reg = <0x36>;
/*
* By default use the internal on-cam clock source
* (Compatible with Toradex OV5640 v1.1b and later)
*/
clocks = <&clk_ov5647_osc>;
clock-names = "csi_mclk";
DOVDD-supply = <®_ov5640_1v8_d_o_vdd>;
AVDD-supply = <®_ov5640_2v8_a_vdd>;
DVDD-supply = <®_ov5640_1v8_d_o_vdd>;
pwn-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
rst-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
ipu_id = <0>;
csi_id = <1>;
mipi_camera = <1>;
mclk = <24000000>;
mclk_source = <0>;
status = "okay";
};
Below are details from imx6qdl-apalis.dtsi
v4l2_cap_0 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <0>;
csi_id = <0>;
mclk_source = <0>;
status = "okay";
};
v4l2_cap_1 { // second parallel camera
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <1>;
csi_id = <1>;
mclk_source = <0>;
status = "okay";
};
v4l2_cap_2 { // mipi-csi2 camera
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <0>;
csi_id = <1>;
mclk_source = <0>;
status = "okay";
};
After building zImage with above updated configuration when we load the kernel below are the observations.
1. ov5647_probe(): Successful.
This Functions is calling below subdevice registration functions.
- v4l2_i2c_subdev_init()
- v4l2_async_register_subdev()
2. Linking the camera sensor with video device failing
3. After running "v4l2-clt -d /dev/video2 -l" showing below error
[339.290200]
[339.290200] In MVC: mxc_v4l_open
[339.294967] device name is Mxc Camera
[339.298897] ERROR: v4l2 capture: slave not found! V4L2_CID_HUE
Failed to open /dev/video2: Resource temporarily unavailable
4. dmesg | grep ov5647 (Below is output)
[4.303504] camera ov5647_mipi is found
[4.311833] ***** Inside ov5647_probe@1704 : Camera OV5647_mipi is found.*****
5. Also we tried to build all as Kernel modules and loaded the same in below sequence.
- modprobe ov5647_camera_mipi.ko
- modprobe mxc_v4l2_capture.ko
But observed the same behaviour as in case of static/in-built.
Can you please review our above configuration? Request to share if anything missing.