OV5640 Camera Interface


#1

Hello Everyone,

I am interfacing OV5640 camera module with mipi-csi1 and i2c3, can you please tell me what are the files i need to modify in the device tree.

Regards,
chethan kumar


#2

Hi @chethan,

I personally do not know the exact way but there are some people have tried on iMX6.
https://lwn.net/Articles/658779/
https://events.linuxfoundation.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf

Please let us know on the forum when it worked for you.


#3

If you are working on Android you should change the: apq8016-camera-sensor-sbc.dtsi
Take the existing ov5645 section on the mipi-csi2 and copy it to mipi-csi1.
The driver will be exactly same as ov5645 from the dts point of view.
Configure the power supplies and gpios.
I did not try to change the i2c bus, on linux i think it is possible.
After the change the driver should recognize the camera in kernel.
I think this is the correct section for standard I2C:

qcom,camera@78 {
	compatible = "ovti,ov5640";
	reg = <0x78 0x0>;
	qcom,slave-id = <0x78 0x300a 0x5640>;
	qcom,csiphy-sd-index = <0>;
	qcom,csid-sd-index = <0>;
	qcom,mount-angle = <0>;
	qcom,sensor-name = "ov5640";
	cam_vdig-supply = <&pm8916_l6>;
	cam_vana-supply = <&pm8916_l10>;
	cam_vio-supply = <&vph_pwr_vreg>;
	qcom,cam-vreg-name = "cam_vdig", "cam_vio", "cam_vana";
	qcom,cam-vreg-min-voltage = <1800000 0 2800000>;
	qcom,cam-vreg-max-voltage = <1800000 0 2800000>;
	qcom,cam-vreg-op-mode = <200000 0 80000>;
	pinctrl-names = "cam_default", "cam_suspend";
	pinctrl-0 = <&cam_sensor_mclk0_default &cam_sensor_front_default>;
	pinctrl-1 = <&cam_sensor_mclk0_sleep &cam_sensor_front_sleep>;
	gpios = <&msm_gpio 26 0>,
		<&msm_gpio 35 0>,
		<&msm_gpio 34 0>;
	qcom,gpio-reset = <1>;
	qcom,gpio-standby = <2>;
	qcom,gpio-req-tbl-num = <0 1 2>;
	qcom,gpio-req-tbl-flags = <1 0 0>;
	qcom,gpio-req-tbl-label = "CAMIF_MCLK",
				"CAM_RESET",
				"CAM_STANDBY";
	qcom,gpio-set-tbl-num = <1 1>;
	qcom,gpio-set-tbl-flags = <0 2>;
	qcom,gpio-set-tbl-delay = <1000 4000>;
	qcom,csi-lane-assign = <0x4320>;
	qcom,csi-lane-mask = <0x3>;
	qcom,sensor-position = <0>;
	qcom,sensor-mode = <0>;
	qcom,cci-master = <0>;
	qcom,mclk-23880000;
	clocks = <&clock_gcc clk_mclk0_clk_src>,
			<&clock_gcc clk_gcc_camss_mclk0_clk>;
	clock-names = "cam_src_clk", "cam_clk";
};