Ath79 DTS: Right Place for GPIO-Controlled USB Power?

In working on DTS files for some GL.iNet devices, I came across a couple "puzzlements" around the AR300M DTS.;a=blob_plain;f=target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi;hb=HEAD

The first is easy, the LED color -- are all LEDs, OpenWrt-wide, now "green", or should the red one be identified as "red" before this hits releases?

The second is a little more puzzling. The AR300M uses GPIO 2 to switch the power to the USB port, as confirmed by GL.iNet staff. However, it is identified to the system as an LED. This doesn't make a lot of sense to me, as the typical triggers aren't applicable, and you likely don't want to be PWM-ing the USB supply!

Is there an established place for GPIO-controlled functions like this already?

Did you find a right place for this? I also have one on Airtight C-75 board and not sure where to place it...

gpio-hog or fixed regulator, though they both seem to have the drawback of not being switchable from user-space during runtime, at least that I’ve found.

I thought declaring it as LED, name it USB Port Power and set to default "on" so that it will be available in LuCI but hoped there is a better option...

Any new findings ? I have wdr3600 which had possibility to control USB power like:

    # echo 0 > /sys/class/gpio/gpio21/value    
    # echo 0 > /sys/class/gpio/gpio22/value

Is it still possible when use "gpio-hog " ?

1 Like