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>
This commit is contained in:
Luo Chongjun 2022-12-15 17:25:15 +08:00 committed by Hauke Mehrtens
parent c13263ca07
commit b352124cd2
2 changed files with 7 additions and 12 deletions

View File

@ -7,7 +7,6 @@
model = "GL.iNet GL-AR300M-Lite"; model = "GL.iNet GL-AR300M-Lite";
}; };
/delete-node/ &reg_usb_vbus;
/delete-node/ &nand_flash; /delete-node/ &nand_flash;
@ -30,6 +29,3 @@
label = "green:wlan"; label = "green:wlan";
}; };
&usb0 {
/delete-property/ vbus-supply;
};

View File

@ -37,14 +37,14 @@
}; };
}; };
reg_usb_vbus: reg_usb_vbus { gpio-export {
compatible = "regulator-fixed"; compatible = "gpio-export";
regulator-name = "usb_vbus"; gpio_usb_power {
regulator-min-microvolt = <5000000>; gpio-export,name = "usb_power";
regulator-max-microvolt = <5000000>; gpio-export,output = <1>;
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>; gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
enable-active-high; };
}; };
leds { leds {
@ -142,7 +142,6 @@
}; };
&usb0 { &usb0 {
vbus-supply = <&reg_usb_vbus>;
status = "okay"; status = "okay";
}; };