[openwrt/openwrt] ramips: use regulator for USB

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 10 02:42:17 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0cdcba238fe61793e14dd0792e16445f0fa07f05

commit 0cdcba238fe61793e14dd0792e16445f0fa07f05
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Dec 23 14:20:29 2024 -0800

    ramips: use regulator for USB
    
    The DWC2 driver used here supports a vbus-supply property to control
    the GPIO. Use it instead of the local gpio,exports solution.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/17357
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ramips/dts/rt3052_accton_wr6202.dts | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/target/linux/ramips/dts/rt3052_accton_wr6202.dts b/target/linux/ramips/dts/rt3052_accton_wr6202.dts
index 685f596177..b459894d0d 100644
--- a/target/linux/ramips/dts/rt3052_accton_wr6202.dts
+++ b/target/linux/ramips/dts/rt3052_accton_wr6202.dts
@@ -94,15 +94,12 @@
 		};
 	};
 
-	gpio_export {
-		compatible = "gpio-export";
-		#size-cells = <0>;
-
-		usb {
-			gpio-export,name = "usb";
-			gpio-export,output = <0>;
-			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
-		};
+	reg_usb_power: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
 	};
 };
 
@@ -129,4 +126,6 @@
 
 &otg {
 	status = "okay";
+
+	vbus-supply = <&reg_usb_power>;
 };




More information about the lede-commits mailing list