ソースを参照

ramips: mt7621: convert usb power to regulators

These things are regulators. Should silence dmesg messages about using
dummy regulators.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16804
Signed-off-by: Robert Marko <[email protected]>
(cherry picked from commit e612900ae0fd6c4624fa661e004536216409107f)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <[email protected]>
Rosen Penev 1 年間 前
コミット
0cf557876a

+ 11 - 9
target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts

@@ -80,15 +80,13 @@
 		};
 		};
 	};
 	};
 
 
-	gpio_export {
-		compatible = "gpio-export";
-		#size-cells = <0>;
-
-		power_usb3 {
-			gpio-export,name = "power_usb3";
-			gpio-export,output = <1>;
-			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
-		};
+	reg_power_usb3: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb3";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
 	};
 	};
 };
 };
 
 
@@ -155,6 +153,10 @@
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_power_usb3>;
+};
+
 &pcie {
 &pcie {
 	status = "okay";
 	status = "okay";
 };
 };

+ 13 - 10
target/linux/ramips/dts/mt7621_humax_e10.dts

@@ -19,16 +19,6 @@
 		label-mac-device = &gmac1;
 		label-mac-device = &gmac1;
 	};
 	};
 
 
-	gpio-export {
-		compatible = "gpio-export";
-
-		gpio-usb-power {
-			gpio-export,name = "power:usb";
-			gpio-export,output = <1>;
-			gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
 	leds {
 	leds {
 		compatible = "gpio-leds";
 		compatible = "gpio-leds";
 
 
@@ -65,6 +55,15 @@
 			linux,code = <KEY_RESTART>;
 			linux,code = <KEY_RESTART>;
 		};
 		};
 	};
 	};
+
+	reg_power_usb: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power:usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
 };
 };
 
 
 &spi0 {
 &spi0 {
@@ -131,6 +130,10 @@
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_power_usb>;
+};
+
 &pcie {
 &pcie {
 	status = "okay";
 	status = "okay";
 };
 };

+ 12 - 5
target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi

@@ -13,15 +13,22 @@
 			gpio-export,output = <0>;
 			gpio-export,output = <0>;
 			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
 			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
 		};
 		};
+	};
 
 
-		usb_power {
-			gpio-export,name = "usb_power";
-			gpio-export,output = <1>;
-			gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
-		};
+	reg_usb_power: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_usb_power>;
+};
+
 &keys {
 &keys {
 	mode {
 	mode {
 		label = "mode";
 		label = "mode";

+ 13 - 6
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi

@@ -48,6 +48,15 @@
 		};
 		};
 	};
 	};
 
 
+	reg_power_usb: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	watchdog {
 	watchdog {
 		compatible = "linux,wdt-gpio";
 		compatible = "linux,wdt-gpio";
 		gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
 		gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
@@ -72,15 +81,13 @@
 			gpio-export,output = <1>;
 			gpio-export,output = <1>;
 			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 		};
 		};
-
-		ext-usb {
-			gpio-export,name = "ext-usb";
-			gpio-export,output = <1>;
-			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
-		};
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_power_usb>;
+};
+
 &sdhci {
 &sdhci {
 	status = "okay";
 	status = "okay";
 };
 };

+ 13 - 6
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi

@@ -47,6 +47,15 @@
 		};
 		};
 	};
 	};
 
 
+	reg_power_usb: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	watchdog {
 	watchdog {
 		compatible = "linux,wdt-gpio";
 		compatible = "linux,wdt-gpio";
 		gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
 		gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
@@ -71,15 +80,13 @@
 			gpio-export,output = <1>;
 			gpio-export,output = <1>;
 			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
 		};
 		};
-
-		ext-usb {
-			gpio-export,name = "ext-usb";
-			gpio-export,output = <1>;
-			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
-		};
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_power_usb>;
+};
+
 &sdhci {
 &sdhci {
 	status = "okay";
 	status = "okay";
 };
 };

+ 10 - 9
target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts

@@ -96,17 +96,18 @@
 
 
 	};
 	};
 
 
+	reg_power_usb: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
 };
 };
 
 
-&gpio {
-	status = "okay";
-
-	enable_usb_power {
-		gpio-hog;
-		line-name = "enable USB power";
-		gpios = <7 GPIO_ACTIVE_HIGH>;
-		output-high;
-	};
+&xhci {
+	vbus-supply = <&reg_power_usb>;
 };
 };
 
 
 &nand {
 &nand {

+ 12 - 5
target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts

@@ -92,15 +92,22 @@
 			gpio-export,output = <0>;
 			gpio-export,output = <0>;
 			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
 			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
 		};
 		};
+	};
 
 
-		usb_power {
-			gpio-export,name = "usb_power";
-			gpio-export,output = <1>;
-			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
-		};
+	reg_usb_power: regulator {
+		compatible = "regulator-fixed";
+		reglator-name = "usb_power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
 	};
 	};
 };
 };
 
 
+&xhci {
+	vbus-supply = <&reg_usb_power>;
+};
+
 &nand {
 &nand {
 	status = "okay";
 	status = "okay";