diff mbox

[LEDE-DEV,V2] apm821xx: fix USB LED trigger for WNDR4700

Message ID 20161028104001.9000-1-zajec5@gmail.com
State Accepted
Headers show

Commit Message

Rafał Miłecki Oct. 28, 2016, 10:40 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

The old usbdev trigger never supported assigning more than 1 USB port.
This code we got was never working as expected and it was missing 2 more
ports. Switch to usbport to have LED working with all ports.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
V2: Add 2 extra ports that were missing
---
 target/linux/apm821xx/base-files/etc/board.d/01_leds | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Christian Lamparter Oct. 28, 2016, 10:46 a.m. UTC | #1
On Friday, October 28, 2016 12:40:01 PM CEST Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> The old usbdev trigger never supported assigning more than 1 USB port.
> This code we got was never working as expected and it was missing 2 more
> ports. Switch to usbport to have LED working with all ports.
> 
Tested-by: Christian Lamparter <chunkeey@gmail.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Thanks!

here's a explanation what's going on with the multiple port and usb definitions:

The WNDR4700 has two different USB solutions. A DesignWare DWC2 IP-Core
in the APM82181-SoC ("usb1") which is wired to the SD-Card reader and needs
to be ignored (as it's always connected). And a dedicated Renesas uPD720202
usb 3.0 chip which powers both physical USB 3.0 ports (port1 and port2).
The uPD720202 has two root hubs. In case of the WNDR4700 these are enumerated
as "usb2" (for USB 1.x/2.0 devices) and "usb3" (soley for USB 3.0+ devices).
Hence in order to fully detect any usb 1.x/2.0 or usb 3.0 device being
plugged in to any of the two ports, the usbport trigger needs to check both
ports on the "usb2" and "usb3" root hubs.

> V2: Add 2 extra ports that were missing
> ---
>  target/linux/apm821xx/base-files/etc/board.d/01_leds | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds
> index a1eeb8f..80a22b8 100755
> --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds
> +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
> @@ -23,8 +23,7 @@ mbl)
>  wndr4700)
>  	ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd"
>  	ucidef_set_led_netdev "wan" "WAN (green)" "wndr4700:green:wan" "eth0.2"
> -	ucidef_set_led_usbdev "usb3-1" "USB3-1" "wndr4700:blue:usb" "2-1"
> -	ucidef_set_led_usbdev "usb3-2" "USB3-2" "wndr4700:blue:usb" "3-1"
> +	ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2"
>  	ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndr4700:blue:wlan" "phy0tpt"
>  	ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndr4700:blue:wlan" "phy1tpt"
>  	;;
>
Rafał Miłecki Oct. 28, 2016, 11:28 a.m. UTC | #2
On 28 October 2016 at 12:46, Christian Lamparter
<chunkeey@googlemail.com> wrote:
> On Friday, October 28, 2016 12:40:01 PM CEST Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> The old usbdev trigger never supported assigning more than 1 USB port.
>> This code we got was never working as expected and it was missing 2 more
>> ports. Switch to usbport to have LED working with all ports.
>>
> Tested-by: Christian Lamparter <chunkeey@gmail.com>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>
> Thanks!
>
> here's a explanation what's going on with the multiple port and usb definitions:
>
> The WNDR4700 has two different USB solutions. A DesignWare DWC2 IP-Core
> in the APM82181-SoC ("usb1") which is wired to the SD-Card reader and needs
> to be ignored (as it's always connected). And a dedicated Renesas uPD720202
> usb 3.0 chip which powers both physical USB 3.0 ports (port1 and port2).
> The uPD720202 has two root hubs. In case of the WNDR4700 these are enumerated
> as "usb2" (for USB 1.x/2.0 devices) and "usb3" (soley for USB 3.0+ devices).
> Hence in order to fully detect any usb 1.x/2.0 or usb 3.0 device being
> plugged in to any of the two ports, the usbport trigger needs to check both
> ports on the "usb2" and "usb3" root hubs.

Thank you! Pushed.
diff mbox

Patch

diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds
index a1eeb8f..80a22b8 100755
--- a/target/linux/apm821xx/base-files/etc/board.d/01_leds
+++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
@@ -23,8 +23,7 @@  mbl)
 wndr4700)
 	ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd"
 	ucidef_set_led_netdev "wan" "WAN (green)" "wndr4700:green:wan" "eth0.2"
-	ucidef_set_led_usbdev "usb3-1" "USB3-1" "wndr4700:blue:usb" "2-1"
-	ucidef_set_led_usbdev "usb3-2" "USB3-2" "wndr4700:blue:usb" "3-1"
+	ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2"
 	ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndr4700:blue:wlan" "phy0tpt"
 	ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndr4700:blue:wlan" "phy1tpt"
 	;;