diff mbox series

[RFC,13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera

Message ID 20220522162802.208275-14-luca@z3ntu.xyz
State New
Headers show
Series CAMSS support for MSM8974 | expand

Commit Message

Luca Weiss May 22, 2022, 4:28 p.m. UTC
Configure the rear camera found in the 8MP camera module for
Fairphone 2. There's also a AD5823 autofocus coil and an EEPROM present
on the module but currently not included.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../dts/qcom-msm8974pro-fairphone-fp2.dts     | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
index 0fad82fc9e03..9a2c3a9177de 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
@@ -77,6 +77,60 @@  &blsp1_uart2 {
 	status = "okay";
 };
 
+&camss {
+	status = "okay";
+
+	vdda-supply = <&pm8941_l12>;
+
+	ports {
+		port@0 {
+			reg = <0>;
+			csiphy0_ep: endpoint {
+				clock-lanes = <1>;
+				data-lanes = <0 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&ov8865_ep>;
+			};
+		};
+	};
+};
+
+&cci {
+	status = "okay";
+};
+
+&cci_i2c0 {
+	ov8865: camera-sensor@10 {
+		compatible = "ovti,ov8865";
+		reg = <0x10>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&mclk0_pin_a>;
+
+		clocks = <&mmcc CAMSS_MCLK0_CLK>;
+
+		avdd-supply = <&pm8941_l17>;
+		dovdd-supply = <&pm8941_lvs3>;
+		dvdd-supply = <&pm8941_l3>;
+
+		powerdown-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
+		reset-gpios = <&tlmm 90 GPIO_ACTIVE_LOW>;
+
+		/* Rear camera */
+		orientation = <1>;
+		rotation = <90>;
+
+		port {
+			ov8865_ep: endpoint {
+				clock-lanes = <1>;
+				data-lanes = <0 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&csiphy0_ep>;
+			};
+		};
+	};
+};
+
 &dsi0 {
 	status = "okay";
 
@@ -413,6 +467,15 @@  pm8941_l24: l24 {
 			regulator-max-microvolt = <3075000>;
 			regulator-boot-on;
 		};
+
+		pm8941_lvs3: lvs3 {
+			/*
+			 * TODO: Used as CCI0 and CCI1 pull-up.
+			 * Replace with vbus-supply or similar once this lands
+			 * upstream!
+			 */
+			regulator-always-on;
+		};
 	};
 };
 
@@ -449,6 +512,13 @@  &smbb {
 };
 
 &tlmm {
+	mclk0_pin_a: mclk0-pin-active {
+		pins = "gpio15";
+		function = "cam_mclk0";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	panel_pin: panel {
 		te {
 			pins = "gpio12";