[openwrt/openwrt] ath79: pineapple-nano: use regulator for USB GPIO

LEDE Commits lede-commits at lists.infradead.org
Sun Jan 12 09:02:20 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5aa996b06d77d7c0935071de6f2217f13be3f253

commit 5aa996b06d77d7c0935071de6f2217f13be3f253
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Dec 23 13:28:25 2024 -0800

    ath79: pineapple-nano: use regulator for USB GPIO
    
    The chipidea USB2 driver used on this platform supports controlling GPIO
    through regulators. This is the upstream friendly solution.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/17356
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts  | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts
index a2b6edbd5e..4a4f455acf 100644
--- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts
+++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts
@@ -29,12 +29,6 @@
 			gpio-export,name = "usb-alarm";
 			gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
 		};
-
-		usb-power {
-			gpio-export,name = "usb-power";
-			gpio-export,output = <0>;
-			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
-		};
 	};
 
 	keys {
@@ -57,6 +51,14 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
+
+	reg_power_usb: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "power_usb";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+	};
 };
 
 &eth0 {
@@ -123,6 +125,8 @@
 
 &usb {
 	status = "okay";
+
+	vbus-supply = <&reg_power_usb>;
 };
 
 &usb_phy {




More information about the lede-commits mailing list