qualcommax: use PHY regulator for USB GPIO
authorRosen Penev <rosenp@gmail.com>
Tue, 3 Dec 2024 21:40:28 +0000 (13:40 -0800)
committerRobert Marko <robimarko@gmail.com>
Fri, 13 Dec 2024 20:04:53 +0000 (21:04 +0100)
The PHY can handle turning off the GPIOs when turning off all USB ports.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17192
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/config-6.6
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts

index 05e2f51bf20a6717ee3d7e0043a20cd3cab1148c..3519557bccbb6a7b6f443191e873a9e9a9a1bfed 100644 (file)
@@ -444,7 +444,6 @@ CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
 # CONFIG_REGULATOR_CPR3 is not set
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-CONFIG_REGULATOR_USERSPACE_CONSUMER=y
 # CONFIG_REGULATOR_VQMMC_IPQ4019 is not set
 CONFIG_RELOCATABLE=y
 CONFIG_REMOTEPROC=y
index 5761c3b582738f8cf571816e13796d72c353d658..8714b34499f9c3977821cdab387f9c6f98fcab5f 100644 (file)
                gpio = <&tlmm 61 GPIO_ACTIVE_LOW>;
                regulator-boot-on;
        };
-
-       output-usb0-power {
-               compatible = "regulator-output";
-               vout-supply = <&reg_usb_vbus>;
-       };
 };
 
 &tlmm {
 
 &qusb_phy_0 {
        status = "okay";
+
+       vdd-supply = <&reg_usb_vbus>;
 };
 
 &ssphy_0 {
index c85e9f1993aa330dd1cad42b2b2ab24a16b50d71..1b5f58e51b4cfa7c270a689b6cffc1c13ce729b8 100644 (file)
                        gpio-export,output = <1>;
                        gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>;
                };
-
-               usb-vbus {
-                       gpio-export,name = "usb_vbus";
-                       gpio-export,output = <0>;
-                       gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
-               };
        };
 
        keys {
                        gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       usb_vbus: regulator-usb-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb_vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&tlmm 9 GPIO_ACTIVE_LOW>;
+               regulator-boot-on;
+       };
 };
 
 &tlmm {
 
 &qusb_phy_1 {
        status = "okay";
+
+       vdd-supply = <&usb_vbus>;
 };
 
 &ssphy_0 {
index 4af942c2892877d842b1dc110107ab37d3ac1b6c..781b6478114f552089d6dd95a5e32e6810b9ddba 100644 (file)
                enable-active-high;
                regulator-boot-on;
        };
-
-       output-usb0-power {
-               compatible = "regulator-output";
-               vout-supply = <&usb0_vbus>;
-       };
-
-       output-usb1-power {
-               compatible = "regulator-output";
-               vout-supply = <&usb1_vbus>;
-       };
 };
 
 &cpu0_thermal {
 
 &qusb_phy_0 {
        status = "okay";
+
+       vdda-phy-supply = <&usb0_vbus>;
 };
 
 &ssphy_1 {
 
 &qusb_phy_1 {
        status = "okay";
+
+       vdda-phy-supply = <&usb1_vbus>;
 };
 
 &usb_0 {