OV13850 camera support

Hi,
I’m trying to understand OV13850 camera entry in the device tree. And I found two different entries in the device tree.
Is anyone can explain the difference between the two camera entries?

  1. from ./rk3399-firefly-linux.dts (or) ./rk3399-rock960-ab.dts
    camera0: ov13850@10 {
    status = “okay”;
    compatible = “omnivision,ov13850-v4l2-i2c-subdev”;
    reg = < 0x10 >;
    device_type = “v4l2-i2c-subdev”;

             clocks = <&cru SCLK_CIF_OUT>;
             clock-names = "clk_cif_out";
    
             pinctrl-names = "rockchip,camera_default", "rockchip,camera_sleep";
             pinctrl-0 = <&cam0_default_pins>;
             pinctrl-1 = <&cam0_sleep_pins>;
    
             rockchip,pd-gpio = <&gpio2 12 GPIO_ACTIVE_LOW>;
             rockchip,pwr-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
             rockchip,pwr-2nd-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
             rockchip,rst-gpio = <&gpio0 8 GPIO_ACTIVE_LOW>;
    
             rockchip,camera-module-mclk-name = "clk_cif_out";
             rockchip,camera-module-facing = "back";
             rockchip,camera-module-name = "cmk-cb0695-fv1";
             rockchip,camera-module-len-name = "lg9569a2";
             rockchip,camera-module-fov-h = "66.0";
             rockchip,camera-module-fov-v = "50.1";
             rockchip,camera-module-orientation = <0>;
             rockchip,camera-module-iq-flip = <0>;
             rockchip,camera-module-iq-mirror = <0>;
             rockchip,camera-module-flip = <1>;
             rockchip,camera-module-mirror = <0>;
    
             rockchip,camera-module-defrect0 = <2112 1568 0 0 2112 1568>;
             rockchip,camera-module-defrect1 = <4224 3136 0 0 4224 3136>;
             rockchip,camera-module-defrect3 = <3264 2448 0 0 3264 2448>;
             rockchip,camera-module-flash-support = <0>;
             rockchip,camera-module-mipi-dphy-index = <0>;
     };
    
  2. from ./rock960-model-ab-linux.dts
    camera0: camera-module@10 {
    compatible = “ovti,ov13850”;
    status = “disabled”;
    reg = <0x10>;
    clocks = <&cru SCLK_CIF_OUT>;
    clock-names = “xvclk”;

             reset-gpios = <&gpio3 29 GPIO_ACTIVE_HIGH>;
             pwdn-gpios = <&gpio3 28 GPIO_ACTIVE_HIGH>;
             pinctrl-names = "rockchip,camera_default";
             pinctrl-0 = <&cif_clkout>;
    
             port {
                     ucam_out0: endpoint {
                     remote-endpoint = <&mipi_in_ucam0>;
                     data-lanes = <1 2>;
                     };
             };
     };
    

And I found two camera drivers for OV13850
./drivers/media/i2c/soc_camera/rockchip/ov13850_v4l2-i2c-subdev.c
./drivers/media/i2c/ov13850.c

Basically, the first node is based on Rockchip’s own camera driver implementation (feature rich). The second node is based on the driver inspired from mainline camera sensor drivers. Both should work.

Thanks,
Mani

Thanks Mani,

Both OV13850 camera drivers are using Rockchip ISP, right?

Do we have any camera driver which is not using Rockchip ISP?

Yes

What do you mean? Camera sensor drivers are developed independent of the ISP.

Hi Mani,
I have some doubts when comparing both OV5645 and OV4690 sensor.
From mipi_dphy_rx0 entry I can find that the OV5645 sensor is mentioned in port0 and isp0 is mentioned in port1.
But where OV4690 sensor mentioned and where can I find which isp is used for OV4690 sensor?

OV5645 and OV4690 camera entry details from rock960-model-ab-linux.dts device tree:

&i2c2 {
camera2: camera-module@3C {
status = “okay”;
compatible = “ovti,ov5645”;
reg = <0x3c>;
clocks = <&cru SCLK_CIF_OUT>;
clock-names = “xvclk”;

	pinctrl-names = "rockchip,camera_default";
	pinctrl-0 = <&cif_clkout>;
	reset-gpios = <&gpio3 29 GPIO_ACTIVE_HIGH>;
	pwdn-gpios = <&gpio3 28 GPIO_ACTIVE_HIGH>;

	port {
		ucam_out2: endpoint {
			remote-endpoint = <&mipi_in_ucam0>;
			data-lanes = <1 2>;
		};
	};
};

camera1: camera-module@36 {
status = “disabled”;
compatible = “omnivision,ov4690-v4l2-i2c-subdev”;
reg = <0x36>;
device_type = “v4l2-i2c-subdev”;
clocks = <&cru SCLK_CIF_OUT>;
clock-names = “clk_cif_out”;
pinctrl-names = “rockchip,camera_default”,
“rockchip,camera_sleep”;
pinctrl-0 = <&cam0_default_pins>;
pinctrl-1 = <&cam0_sleep_pins>;
rockchip,pd-gpio = <&gpio3 4 GPIO_ACTIVE_LOW>;
//rockchip,pwr-gpio = <&gpio3 13 0>;
rockchip,rst-gpio = <&gpio2 10 GPIO_ACTIVE_LOW>;
rockchip,camera-module-mclk-name = “clk_cif_out”;
rockchip,camera-module-facing = “back”;
rockchip,camera-module-name = “LA6111PA”;
rockchip,camera-module-len-name = “YM6011P”;
rockchip,camera-module-fov-h = “116”;
rockchip,camera-module-fov-v = “61”;
rockchip,camera-module-orientation = <0>;
rockchip,camera-module-iq-flip = <0>;
rockchip,camera-module-iq-mirror = <0>;
rockchip,camera-module-flip = <0>;
rockchip,camera-module-mirror = <1>;

	rockchip,camera-module-defrect0 = <2688 1520 0 0 2688 1520>;
	rockchip,camera-module-flash-support = <0>;
	rockchip,camera-module-mipi-dphy-index = <0>;
};

}
&mipi_dphy_rx0 {
status = “okay”;

ports {
	#address-cells = <1>;
	#size-cells = <0>;

	port@0 {
		reg = <0>;
		#address-cells = <1>;
		#size-cells = <0>;

		mipi_in_ucam0: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&ucam_out2>;
			data-lanes = <1 2>;
		};
	};

	port@1 {
		reg = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		dphy_rx0_out: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&isp0_mipi_in>;
		};
	};
};

};

From the above device tree OV5645 camera, has an endpoint which is mentioned as ucam_out2 and it is called in mipi_dphy_rx0 port0 for sensor details and port1 is mentioned as ISP details

But the OV4690 camera endpoint variable is missing and then how it can be mention in mipi_dphy_rx0 port0 for sensor details or how to access RKISP0/RKISP1 for this sensor.

Hi @Bala

As I said, OV4690 driver is a Rockchip implementation and is not following the mainline v4l2 media device framework. So there is no endpoint node for that sensor but instead, Rockchip uses below setup to link ISP and Camera sensors:

&cif_isp0 {
	rockchip,camera-modules-attached = <&camera0>;
	status = "okay";
};

In the above ISP node, Camera sensor gets linked to ISP using rockchip,camera-modules-attached property.

Hope this helps!

Thanks,
Mani

Thanks @Mani,

This helps a lot.