[LEDE-DEV] New device: Two USB ports, only one USB activity LED

Rafał Miłecki zajec5 at gmail.com
Tue Oct 4 03:51:40 PDT 2016


On 2 September 2016 at 13:42, J Mo <jmomo at jmomo.net> wrote:
> I have a new device I am working on and it has two USB ports but only one
> USB activity LED.
>
> Right now the LED works the way I like with one of the USB ports, but not
> the other port. I would like for the LED to go active and/or blink when
> there is activity from either port.
>
> Anyone know how to do this? Example devices? I think I'm just overlooking
> something.
>
>
>
> My DTS looks like this:
>
>         gpio-leds {
>                 compatible = "gpio-leds";
>
>                 usb {
>                         label = "tew827dru:blue:usb";
>                         gpios = <&qcom_pinmux 7 1>;
>                         default-state = "off";
>                 };
>
>
>
>
> And I have the following in my /etc/board.d/01_leds file:
>
> case "$board" in
> tew827dru)
>         ucidef_set_led_usbdev "usb2" "USB2" "tew827dru:blue:usb" "2-1"
>         ucidef_set_led_usbdev "usb4" "USB4" "tew827dru:blue:usb" "4-1"
>         ;;

It took me a while to get usbport trigged accepted upstream, but there
it is. Take a look at:

a69e19d18ac ("kernel: backport usbport LED trigger from 4.9") and two
pending patches:
https://patchwork.ozlabs.org/patch/678015/
https://patchwork.ozlabs.org/patch/678014/

I'm also going to work on DT support for usbport trigger, so you won't
need user space setup it with ucidef_set_led_usbdev or
ucidef_set_led_usbport.

-- 
Rafał



More information about the Lede-dev mailing list