From 5436d28adbf6268496e20b4c43c43a59f597c340 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 10 Oct 2017 05:26:49 +0200
Subject: [PATCH 34/82] ARM: dts: sun8i-a83t-tbs-a711: Add rear camera sensor
 (HM5065)

Sensor is connected via parallel bus to CSI0 and via I2C bus to
PE14/PE15 pins. Enable CSI0 module and add the node for HM5065
camera sensor.

Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 43 +++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 8a0a8d39eb21..9a87ce651224 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -149,6 +149,23 @@
 	cpu-supply = <&reg_dcdc3>;
 };
 
+&csi0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&csi0_pins>;
+
+	port {
+		csi0_hm5065_ep: endpoint {
+			remote-endpoint = <&hm5065_ep>;
+			bus-width = <8>;
+			data-active = <1>;
+			pclk-sample = <1>;
+			hsync-active = <1>;
+			vsync-active = <0>;
+		};
+	};
+};
+
 &de {
 	status = "okay";
 };
@@ -185,6 +202,32 @@
 	};
 };
 
+&i2c_gpio {
+	hm5065: camera@1f {
+		compatible = "himax,hm5065";
+		reg = <0x1f>;
+		clocks = <&ccu CLK_CSI_MCLK>;
+		clock-names = "xclk";
+		IOVDD-supply = <&reg_dldo3>;
+		AVDD-supply = <&reg_dldo4>;
+		DVDD-supply = <&reg_eldo3>;
+		AFVDD-supply = <&reg_dldo3>;
+		reset-gpios = <&pio 4 18 GPIO_ACTIVE_LOW>; /* PE18 */
+		chipenable-gpios = <&pio 4 19 GPIO_ACTIVE_HIGH>; /* PE19 */
+
+		port {
+			hm5065_ep: endpoint {
+				remote-endpoint = <&csi0_hm5065_ep>;
+				bus-width = <8>;
+				data-active = <1>;
+				pclk-sample = <1>;
+				hsync-active = <1>;
+				vsync-active = <0>;
+			};
+		};
+	};
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_dcdc1>;
 	pinctrl-names = "default";
-- 
2.20.1

