lantiq: fritz7320: enable USB power supply
authorMathias Kresin <dev@kresin.me>
Wed, 17 Feb 2021 22:37:54 +0000 (23:37 +0100)
committerMathias Kresin <dev@kresin.me>
Thu, 18 Feb 2021 07:43:08 +0000 (08:43 +0100)
The USB ports if a FRIZZ!Box 7320 do not supply power to connected
devices.

Add the GPIOs enabling USB power as regulator, to enable USB power
supply as soon as the USB driver is loaded.

Fixes FS#3624

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts

index 9fbac6fa1298aaae313a56eefb34c6b951b64468..5f38936577ef6ddf88f6a3be266c7efaec1e5b42 100644 (file)
                        gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
                };
        };
+
+       usb0_vbus: regulator-usb0-vbus {
+               compatible = "regulator-fixed";
+
+               regulator-name = "USB0_VBUS";
+
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               gpio = <&gpio 50 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       usb1_vbus: regulator-usb1-vbus {
+               compatible = "regulator-fixed";
+
+               regulator-name = "USB1_VBUS";
+
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               gpio = <&gpio 51 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
 };
 
 &gsw {
        mtd-mac-address-increment = <(-2)>;
 };
 
+&gpio {
+       pinctrl-names = "default";
+       pinctrl-0 = <&state_default>;
+
+       state_default: pinmux {
+               usb0_vbus {
+                       lantiq,pins = "io50";
+                       lantiq,pull = <0>;
+                       lantiq,open-drain = <0>;
+                       lantiq,output = <1>;
+               };
+               usb1_vbus {
+                       lantiq,pins = "io51";
+                       lantiq,pull = <0>;
+                       lantiq,open-drain = <0>;
+                       lantiq,output = <1>;
+               };
+       };
+};
+
 &localbus {
        flash@0 {
                compatible = "lantiq,nor";
 
 &usb0 {
        status = "okay";
+       vbus-supply = <&usb0_vbus>;
 };
 
 &usb1 {
        status = "okay";
+       vbus-supply = <&usb1_vbus>;
 };