ramips: use regulator for USB
authorRosen Penev <rosenp@gmail.com>
Mon, 23 Dec 2024 22:20:29 +0000 (14:20 -0800)
committerRobert Marko <robimarko@gmail.com>
Mon, 10 Mar 2025 09:42:13 +0000 (10:42 +0100)
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@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17357
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ramips/dts/rt3052_accton_wr6202.dts

index 685f59617742692371e59084dbe5d931e512f6b7..b459894d0de268f4d9c70282812252feba53883e 100644 (file)
                };
        };
 
-       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>;
        };
 };
 
 
 &otg {
        status = "okay";
+
+       vbus-supply = <&reg_usb_power>;
 };