apm821xx: redo WAN green and yellow LEDs
authorChristian Lamparter <chunkeey@googlemail.com>
Mon, 7 Nov 2016 17:10:09 +0000 (18:10 +0100)
committerJohn Crispin <john@phrozen.org>
Tue, 8 Nov 2016 10:17:10 +0000 (11:17 +0100)
Because the WAN port is handled by the internal AR8327N switch, the
device should use swconfig_leds trigger to handle the link activity
of the WAN LED. This has the added bonus that the WAN LED will now
go dark if there's no ethernet cable connected to the WAN port.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/apm821xx/base-files/etc/board.d/01_leds
target/linux/apm821xx/nand/config-default

index 80a22b8fd692f6120375d3e951e290489bceb9f3..38cfbdcd7ab71d77181b72deb5d8a1c0bbe68cff 100755 (executable)
@@ -22,7 +22,8 @@ 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_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20"
+       ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx"
        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"
index 5d5d2a4bf47e6fb52fde3e5b1c198df65defa73e..d6bdbd74e2b98f74ea8269979ae8d7b9dceeeb6a 100644 (file)
@@ -38,4 +38,6 @@ CONFIG_UBIFS_FS=y
 # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
 CONFIG_SENSORS_LM90=y
 CONFIG_SENSORS_TC654=y
+CONFIG_SWCONFIG=y
+CONFIG_SWCONFIG_LEDS=y
 CONFIG_WNDR4700=y