aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2019-07-02 15:54:00 +0200
committerAlexander Couzens <lynxis@fe80.eu>2019-07-02 16:05:28 +0200
commitcc1147072d24eab3dfc802ceeb237fbeb584d946 (patch)
tree3ce559c5cd4834d8170e4b29b8fe4911345f9832 /target/linux
parent7a1b575ac4ede2778bb21cfafa7a1152d9d2555f (diff)
downloadupstream-cc1147072d24eab3dfc802ceeb237fbeb584d946.tar.gz
upstream-cc1147072d24eab3dfc802ceeb237fbeb584d946.tar.bz2
upstream-cc1147072d24eab3dfc802ceeb237fbeb584d946.zip
ramips/leds: use devicetree alias led_wlan
Similiar to the lantiq target use a dts alias to define the wlan led instead of static mapping in /etc/board.d/01_leds. Reduce code duplication. A device tree must define the alias "led-wlan" similiar to "led-boot". / { aliases { led-wlan = &led_wlan; }; [..] led_wlan: wlan { label = "tl-wr841n-v14:green:wlan"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; }; Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'target/linux')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/01_leds4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 043b814773..9cf6e30d39 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -1,5 +1,6 @@
#!/bin/sh
+. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh
set_wifi_led() {
@@ -12,6 +13,9 @@ boardname="${board##*,}"
board_config_update
+led_wlan="$(get_dt_led wlan)"
+[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt"
+
case $board in
3g-6200n|\
br-6475nd|\