diff mbox series

[RFC,v6,05/13] arm64: dts: renesas: eagle: Provide MAX9286 GMSL deserialiser

Message ID 20191216102930.5867-6-kieran.bingham+renesas@ideasonboard.com (mailing list archive)
State Under Review
Delegated to: Kieran Bingham
Headers show
Series GMSL Renesas Platform Support | expand

Commit Message

Kieran Bingham Dec. 16, 2019, 10:29 a.m. UTC
From: Kieran Bingham <kieran.bingham@ideasonboard.com>

Provide the wiring for the MAX9286 populated on the Eagle-V3M board
which has 4 FAKRA connectors.

No cameras are connected, and the I2C muxes are disabled by default.

Connected cameras should be defined in a device-tree overlay or included
after these definitions.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
v2
 - Rebase to mainline, and fix DTB merge issues.

v3:
 - Fix up gmsl-serialiszer i2c bus unit address

v6:
 - Use new i2c-mux subnode

 - Make use of the GPIO controller exposed by the max9286 to expose a
   hog on the line we need to hold low for camera power.

   Produces this:

   gpiochip7 - 2 lines:
	line   0:   "GPIO0OUT" "CSI0_CAMVDD_EN" output active-high [used]
	line   1:   "GPIO1OUT"       unused  output  active-high

 - Remove the powerdown hog, and utilise an optional enable-gpio line
   instead.
---
 .../arm64/boot/dts/renesas/r8a77970-eagle.dts | 135 ++++++++++++++++++
 1 file changed, 135 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
index 2be89ed879a5..86caf98e9eb0 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
@@ -6,6 +6,8 @@ 
  * Copyright (C) 2017 Cogent Embedded, Inc.
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 /dts-v1/;
 #include "r8a77970.dtsi"
 
@@ -189,6 +191,11 @@ 
 		function = "i2c0";
 	};
 
+	i2c3_pins: i2c3 {
+		groups = "i2c3_a";
+		function = "i2c3";
+	};
+
 	scif0_pins: scif0 {
 		groups = "scif0_data";
 		function = "scif0";
@@ -200,6 +207,134 @@ 
 	status = "okay";
 };
 
+&csi40 {
+	status = "okay";
+
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			csi40_in: endpoint {
+				clock-lanes = <0>;
+				data-lanes = <1 2 3 4>;
+				remote-endpoint = <&max9286_out0>;
+			};
+		};
+	};
+};
+
+&i2c3 {
+	pinctrl-0 = <&i2c3_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	gmsl: gmsl-deserializer@48 {
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		compatible = "maxim,max9286";
+		reg = <0x48>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* eagle-pca9654-max9286-pwdn */
+		enable-gpios = <&io_expander 0 GPIO_ACTIVE_HIGH>;
+
+		/*
+		 * Workaround: Hog the CAMVDD line high as we can't establish a
+		 * regulator-fixed on the gpio_chip exposed by &gmsl due to
+		 * circular-dependency issues.
+		 */
+		camvdd_en {
+			gpio-hog;
+			gpios = <0 0>;
+			output-low;
+			line-name = "CSI0_CAMVDD_EN";
+		};
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				max9286_in0: endpoint {
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				max9286_in1: endpoint {
+				};
+			};
+
+			port@2 {
+				reg = <2>;
+				max9286_in2: endpoint {
+				};
+			};
+
+			port@3 {
+				reg = <3>;
+				max9286_in3: endpoint {
+				};
+			};
+
+			port@4 {
+				reg = <4>;
+				max9286_out0: endpoint {
+					clock-lanes = <0>;
+					data-lanes = <1 2 3 4>;
+					remote-endpoint = <&csi40_in>;
+				};
+			};
+		};
+
+		i2c-mux {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			i2c@0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0>;
+
+				status = "disabled";
+			};
+
+			i2c@1 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <1>;
+
+				status = "disabled";
+			};
+
+			i2c@2 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <2>;
+
+				status = "disabled";
+			};
+
+			i2c@3 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <3>;
+
+				status = "disabled";
+			};
+		};
+	};
+};
+
 &scif0 {
 	pinctrl-0 = <&scif0_pins>;
 	pinctrl-names = "default";