ramips: mt7621: convert usb power to regulators
authorRosen Penev <rosenp@gmail.com>
Thu, 24 Oct 2024 21:51:29 +0000 (14:51 -0700)
committerRobert Marko <robimarko@gmail.com>
Sun, 3 Nov 2024 19:08:17 +0000 (20:08 +0100)
These things are regulators. Should silence dmesg messages about using
dummy regulators.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16804
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts
target/linux/ramips/dts/mt7621_humax_e10.dts
target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi
target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts
target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts

index 9d426fb17df10670301fb5804e068cec840fe775..00ff80e3ca9fd078dc3bf166bef4bb6cb2c3b83a 100644 (file)
                };
        };
 
-       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;
        };
 };
 
        };
 };
 
+&xhci {
+       vbus-supply = <&reg_power_usb3>;
+};
+
 &pcie {
        status = "okay";
 };
index 39eac32d538f4ef0009d10b632fd28dce2f175fc..7ba772d5e50ad2be2d1fb55659933f7ce77e49b1 100644 (file)
                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 {
                compatible = "gpio-leds";
 
                        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 {
        };
 };
 
+&xhci {
+       vbus-supply = <&reg_power_usb>;
+};
+
 &pcie {
        status = "okay";
 };
index cdca47f8b8c77aba6c94126f51385aadf0e0bb92..4a3de8cfba7b883fde6504aaf84b9ae78cde174a 100644 (file)
                        gpio-export,output = <0>;
                        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 {
        mode {
                label = "mode";
index c3712fea7b910f077f40b392cabfcf5174ce6892..c70b3330e9c79d1562d05974bc8ab94ec6e7c5e3 100644 (file)
                };
        };
 
+       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 {
                compatible = "linux,wdt-gpio";
                gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
                        gpio-export,output = <1>;
                        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 {
        status = "okay";
 };
index dcad7b26d23b385daad07d04d66c21911236780d..3e2a593ae710da3c57f4403a018f21bac371f625 100644 (file)
                };
        };
 
+       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 {
                compatible = "linux,wdt-gpio";
                gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
                        gpio-export,output = <1>;
                        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 {
        status = "okay";
 };
index 9eed123157ebfaf2f7d4e4bb5062cb8b4a4365c8..88894325b5ca6219489cec0918504666477861b6 100644 (file)
 
        };
 
+       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 {
index e121077b0ac908199910501db61e4b5d0739a41e..e6ff5ecf6aed5368b16ccd0d9669b81a0931d058 100644 (file)
                        gpio-export,output = <0>;
                        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 {
        status = "okay";