OV13850 4 lane MIPI CSI2 camera support on imx8m

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

OV13850 4 lane MIPI CSI2 camera support on imx8m

1,278 Views
antonyabeepraka
Contributor II

Hi,

We are adding support for 4 lane MIPI CSI2 camera (OV13850) in our custom imx8m target board. We are using 4.14.78 kernel.

We have integrated our camera sensor driver ov13850.c in drivers/media/platform/mxc/capture directory. We have added respective devicetree entries for the same. Configured the reset and power gpio pins in devicetree for camera sensor.

But we are facing issues in reading the chip ID of camera sensor and so the probe fails. Below is our error logs.

[    1.436226] OV13850: ov13850_probe called
[    1.459832] OV13850, register 0x300A: 0
[    1.463683] Unexpected sensor id(000000), ret(-5)
[    1.468467] ov13850_mipi_raw 2-0010: ov13850 mipi not found

Initially we thought i2c communication to the camera sensor is not happening. But the output of i2cdetect shows the slave address of camera's auto focus sensor IC (0x0c). This shows i2c communication is there with camera sensor.

Due to probe failure the camera sensor slave address 0x10 is not showing in i2cdetect output.

Below is our devicetree entries:

        ov13850_mipi2: ov13850_mipi2@10 {
                compatible = "ov13850";
                reg = <0x10>;
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_csi2>;
                clocks = <&clk IMX8MQ_CLK_CLKO2>;
                clock-names = "csi_mclk";
                assigned-clocks = <&clk IMX8MQ_CLK_CLKO2>;
                assigned-clock-parents = <&clk IMX8MQ_SYS2_PLL_200M>;
                assigned-clock-rates = <20000000>;
                csi_id = <1>;
                pwn-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
                rst-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
                mclk = <24000000>;
                mclk_source = <0>;
                port {
                        ov13850_mipi2_ep: endpoint {
                                remote-endpoint = <&mipi2_sensor_ep>;
                        };
                };
        };

&csi2_bridge {
        fsl,mipi-mode;
        fsl,two-8bit-sensor-mode;
        status = "okay";

        port {
                csi2_ep: endpoint {
                        remote-endpoint = <&csi2_mipi_ep>;
                };
        };
};

&mipi_csi_2 {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";
        port {
                mipi2_sensor_ep: endpoint1 {
                        remote-endpoint = <&ov13850_mipi2_ep>;
                        data-lanes = <1 2 3 4>;
                };

                csi2_mipi_ep: endpoint2 {
                        remote-endpoint = <&csi2_ep>;
                };
        };
};

We have disabled mipi_csi1 and other 2 lane camera(ov5640) under another i2c and enabling only 4 lane camera(0v13850) and mipi_csi2 nodes. This we did in a separate dtb file by calling these nodes.  We are using this dtb file while booting.

Attached our camera sensor driver (ov13850.c) for your reference.

Questions:

  1. Is our devicetree entries are correct ?
  2. Are we doing the integration in the correct path ?
  3. What might be the cause for the this issue ?

Please provide your inputs. It will be helpful for us.

Thanks & Regards,

Antony

Labels (1)
0 Kudos
1 Reply

1,116 Views
li_hong
Contributor III

Hello,Antony Abee Prakash:

      Have you solved the problem? I have the same problem as you:)

0 Kudos