From 6aa58e6c5378dc20fce9fcc0ef68916ae3fa7b22 Mon Sep 17 00:00:00 2001
From: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Date: Mon, 29 Jun 2020 18:32:30 +0200
Subject: [PATCH] rk3399-rock-pi-4.dts: add ov5647 dt-binding

---
 .../boot/dts/rockchip/rk3399-rock-pi-4.dts    | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
index 3923ec01ef66f..9584d87ddb66f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
@@ -18,6 +18,12 @@
 		stdout-path = "serial2:1500000n8";
 	};
 
+	rpicamclk1: camera-clk-ov {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <25000000>;
+	};
+
 	clkin_gmac: external-gmac-clock {
 		compatible = "fixed-clock";
 		clock-frequency = <125000000>;
@@ -440,6 +446,30 @@
 	i2c-scl-rising-time-ns = <600>;
 	i2c-scl-falling-time-ns = <20>;
 	status = "okay";
+
+	rpicamv1: camera@36 {
+		compatible = "ovti,ov5647";
+		reg = <0x36>;
+		clocks = <&rpicamclk1>;
+		pinctrl-names = "default";
+		//status = "disabled";
+		status = "okay";
+
+		/* CAM_GPIO is an enable GPIO and
+		 * CAM_MCLK is actually controlling the red LED
+		 */
+		pinctrl-0 = <&enable>, <&camled>;
+		pwdn-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
+
+		port {
+			csi1_out_1: endpoint {
+				remote-endpoint = <&csi1_ep1>;
+//				clock-lanes = <0>;
+//				data-lanes = <1 2>;
+			};
+		};
+	};
+
 };
 
 &i2s0 {
@@ -562,6 +592,17 @@
 			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	cam_pins {
+		enable: enable-pins {
+			rockchip,pins =
+				<1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		camled: cam_led_pins {
+			rockchip,pins =
+				<2 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
 };
 
 &pwm2 {
@@ -733,3 +774,25 @@
 &vopl_mmu {
 	status = "okay";
 };
+
+&i2c6 {
+	status = "okay";
+};
+
+&mipi_dphy_rx0 {
+	status = "okay";
+};
+
+&isp0 {
+	status = "okay";
+
+	ports {
+		port@0 {
+			csi1_ep1: endpoint@1 {
+				reg = <1>;
+				remote-endpoint = <&csi1_out_1>;
+				data-lanes = <1 2>;
+			};
+		};
+	};
+};
-- 
GitLab