[openwrt/openwrt] lantiq: fritz7320: enable USB power supply

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 18 02:43:28 EST 2021


mkresin pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ba07cc0cbb3d486366e4ae3b79e69f972d8c2c5d

commit ba07cc0cbb3d486366e4ae3b79e69f972d8c2c5d
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Feb 17 23:37:54 2021 +0100

    lantiq: fritz7320: enable USB power supply
    
    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 at kresin.me>
---
 .../mips/boot/dts/lantiq/ar9_avm_fritz7320.dts     | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts
index 9fbac6fa12..5f38936577 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts
@@ -69,6 +69,30 @@
 			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 {
@@ -77,6 +101,26 @@
 	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 at 0 {
 		compatible = "lantiq,nor";
@@ -142,8 +186,10 @@
 
 &usb0 {
 	status = "okay";
+	vbus-supply = <&usb0_vbus>;
 };
 
 &usb1 {
 	status = "okay";
+	vbus-supply = <&usb1_vbus>;
 };



More information about the lede-commits mailing list