ath79: pineapple-nano: use regulator for USB GPIO
authorRosen Penev <rosenp@gmail.com>
Mon, 23 Dec 2024 21:28:25 +0000 (13:28 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 12 Jan 2025 17:01:35 +0000 (18:01 +0100)
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@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17356
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts

index a2b6edbd5e71c2f13b9791644bd1a03493e3a372..4a4f455acf008b18199f04570cedde529eb6d082 100644 (file)
                        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 {
                        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 {
 
 &usb {
        status = "okay";
+
+       vbus-supply = <&reg_power_usb>;
 };
 
 &usb_phy {