Skip to content

Commit bca5801

Browse files
committed
mediatek: filogic: Cudy TR3000 USB power gpio switch
I've checked this for 128mb router version and with these changes you could cut off USB power via ```bash echo 0 > /sys/class/gpio/modem_power/value ``` and get the power back by ```bash echo 1 > /sys/class/gpio/modem_power/value ``` This could be very useful for those who need to reboot USB modems. Can we add this too? Signed-off by: Fil Dunsky <[email protected]>
1 parent 0da0a6c commit bca5801

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dtsi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
stdout-path = "serial0:115200n8";
1919
};
2020

21+
gpio-export {
22+
compatible = "gpio-export";
23+
24+
usb-power {
25+
gpio-export,name = "usb_power";
26+
gpio-export,output = <1>;
27+
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
28+
};
29+
};
30+
2131
gpio-keys {
2232
compatible = "gpio-keys";
2333

@@ -51,15 +61,6 @@
5161
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
5262
};
5363
};
54-
55-
usb_vbus: regulator-usb {
56-
compatible = "regulator-fixed";
57-
regulator-name = "usb-vbus";
58-
regulator-min-microvolt = <5000000>;
59-
regulator-max-microvolt = <5000000>;
60-
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
61-
regulator-boot-on;
62-
};
6364
};
6465

6566
&uart0 {
@@ -202,7 +203,6 @@
202203

203204
&xhci {
204205
status = "okay";
205-
vbus-supply = <&usb_vbus>;
206206
};
207207

208208
&wifi {

target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ board_config_update
55
board=$(board_name)
66

77
case "$board" in
8+
cudy,tr3000-256mb-v1|\
9+
cudy,tr3000-v1|\
10+
cudy,tr3000-v1-ubootmod)
11+
ucidef_add_gpio_switch "usb_power" "USB power" "usb_power" "1"
12+
;;
813
huasifei,wh3000-pro)
914
ucidef_add_gpio_switch "modem_power" "Modem power" "modem_power" "0"
1015
;;

0 commit comments

Comments
 (0)