Просмотр исходного кода

realtek: Simple conversions to RTL8231 MFD driver

Change devices with RTL8231 GPIO expander definition that can easily be
translated to the new RTL8231 binding and carry over any gpio-hogs. This
will let them use the new RTL8231 MFD driver, without any functional
changes.

Signed-off-by: Sander Vanheule <[email protected]>
(cherry picked from commit b7af54d5c18cf74b9b598b506a335443a0bbed87)
Sander Vanheule 11 месяцев назад
Родитель
Сommit
e76aae2253

+ 34 - 23
target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts

@@ -38,29 +38,6 @@
 		};
 	};
 
-	gpio1: rtl8231-gpio {
-		compatible = "realtek,rtl8231-gpio";
-		#gpio-cells = <2>;
-		gpio-controller;
-		indirect-access-bus-id = <0>;
-
-		poe_enable {
-			gpio-hog;
-			gpios = <1 GPIO_ACTIVE_HIGH>;
-			output-high;
-			line-name = "poe-enable";
-		};
-
-		sff_p9_gpios {
-			gpio-hog;
-			gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
-				< 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
-				< 12 GPIO_ACTIVE_LOW>;   /* mod-def0-gpio */
-			input;
-			line-name = "sff-p9-gpios";
-		};
-	};
-
 	gpio-export {
 		compatible = "gpio-export";
 
@@ -119,6 +96,40 @@
 	};
 };
 
+&mdio_aux {
+	status = "okay";
+
+	gpio1: expander@0 {
+		compatible = "realtek,rtl8231";
+		reg = <0>;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-ranges = <&gpio1 0 0 37>;
+
+		poe_enable {
+			gpio-hog;
+			gpios = <1 GPIO_ACTIVE_HIGH>;
+			output-high;
+			line-name = "poe-enable";
+		};
+
+		sff_p9_gpios {
+			gpio-hog;
+			gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
+				< 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
+				< 12 GPIO_ACTIVE_LOW>;   /* mod-def0-gpio */
+			input;
+			line-name = "sff-p9-gpios";
+		};
+
+		led-controller {
+			compatible = "realtek,rtl8231-leds";
+			status = "disabled";
+		};
+	};
+};
+
 &spi0 {
 	status = "okay";
 

+ 15 - 4
target/linux/realtek/dts/rtl8380_linksys_lgs310c.dts

@@ -92,12 +92,23 @@
 			linux,code = <KEY_RESTART>;
 		};
 	};
+};
+
+&mdio_aux {
+	status = "okay";
+
+	gpio1: expander@0 {
+		compatible = "realtek,rtl8231";
+		reg = <0>;
 
-	gpio1: rtl8231-gpio {
-		compatible = "realtek,rtl8231-gpio";
-		#gpio-cells = <2>;
 		gpio-controller;
-		indirect-access-bus-id = <0>;
+		#gpio-cells = <2>;
+		gpio-ranges = <&gpio1 0 0 37>;
+
+		led-controller {
+			compatible = "realtek,rtl8231-leds";
+			status = "disabled";
+		};
 	};
 };
 

+ 15 - 4
target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi

@@ -31,12 +31,23 @@
 		gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
 		open-source;
 	};
+};
+
+&mdio_aux {
+	status = "okay";
+
+	gpio1: expander@31 {
+		compatible = "realtek,rtl8231";
+		reg = <31>;
 
-	gpio1: rtl8231-gpio {
-		compatible = "realtek,rtl8231-gpio";
-		#gpio-cells = <2>;
 		gpio-controller;
-		indirect-access-bus-id = <31>;
+		#gpio-cells = <2>;
+		gpio-ranges = <&gpio1 0 0 37>;
+
+		led-controller {
+			compatible = "realtek,rtl8231-leds";
+			status = "disabled";
+		};
 	};
 };
 

+ 15 - 4
target/linux/realtek/dts/rtl8382_iodata_bsh-g24mb.dts

@@ -43,12 +43,23 @@
 			linux,code = <KEY_RESTART>;
 		};
 	};
+};
+
+&mdio_aux {
+	status = "okay";
+
+	gpio1: expander@0 {
+		compatible = "realtek,rtl8231";
+		reg = <0>;
 
-	gpio1: rtl8231-gpio {
-		compatible = "realtek,rtl8231-gpio";
-		#gpio-cells = <2>;
 		gpio-controller;
-		indirect-access-bus-id = <0>;
+		#gpio-cells = <2>;
+		gpio-ranges = <&gpio1 0 0 37>;
+
+		led-controller {
+			compatible = "realtek,rtl8231-leds";
+			status = "disabled";
+		};
 	};
 };