aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuo Chongjun <luochongjun@gl-inet.com>2022-12-15 17:25:15 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2023-04-02 22:07:28 +0200
commit70d2e8b4db0c5c9f1a2d40827928bef8083b19d6 (patch)
tree0373d33e3682a12c5a0ec7cb8ba641ef3a17c4f2
parent9aaeaa8d2a9d619169ffddaa23d820523d0fcdfa (diff)
downloadupstream-70d2e8b4db0c5c9f1a2d40827928bef8083b19d6.tar.gz
upstream-70d2e8b4db0c5c9f1a2d40827928bef8083b19d6.tar.bz2
upstream-70d2e8b4db0c5c9f1a2d40827928bef8083b19d6.zip
ath79: Fix glinet ar300m usb not working
glinet forum users reported the problem at https://forum.gl-inet.com/t/gl-ar300m16-openwrt-22-03-0-rc5-usb-port-power-off-by-default/23199 The current code uses the regulator framework to control the USB power supply. Although usb0 described in DTS refers to the regulator by vbus-supply, but there is no code related to regulator implemented in the USB driver of QCA953X, so the USB of the device cannot work. Under the regulator framework, adding the regulator-always-on attribute fixes this problem, but it means that USB power will not be able to be turned off. Since we need to control the USB power supply in user space, I didn't find any other better way under the regulator framework of Linux, so I directly export gpio. Signed-off-by: Luo Chongjun <luochongjun@gl-inet.com> (cherry picked from commit b352124cd2115fec648a00956a848660df9477d3)
-rw-r--r--target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts4
-rw-r--r--target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi17
2 files changed, 8 insertions, 13 deletions
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
index a34abb1dd2..c712236114 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
@@ -7,7 +7,6 @@
model = "GL.iNet GL-AR300M-Lite";
};
-/delete-node/ &reg_usb_vbus;
/delete-node/ &nand_flash;
@@ -30,6 +29,3 @@
label = "green:wlan";
};
-&usb0 {
- /delete-property/ vbus-supply;
-};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index d64ffa7115..b6ea1080a4 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -37,14 +37,14 @@
};
};
- reg_usb_vbus: reg_usb_vbus {
- compatible = "regulator-fixed";
-
- regulator-name = "usb_vbus";
- regulator-min-microvolt = <5000000>;
- regulator-max-microvolt = <5000000>;
- gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
- enable-active-high;
+ gpio-export {
+ compatible = "gpio-export";
+
+ gpio_usb_power {
+ gpio-export,name = "usb_power";
+ gpio-export,output = <1>;
+ gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+ };
};
leds {
@@ -144,7 +144,6 @@
&usb0 {
#address-cells = <1>;
#size-cells = <0>;
- vbus-supply = <&reg_usb_vbus>;
status = "okay";
};