lantiq: Add support for the BT Home Hub 5A
[openwrt/openwrt.git] / target / linux / lantiq / base-files / etc / uci-defaults / 01_leds
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 # based on ar71xx
5 #
6
7 . /lib/functions/uci-defaults.sh
8 . /lib/functions/lantiq.sh
9
10 [ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tpt"
11 [ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1"
12 [ -e "/sys/class/leds/usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "usb2" "2-1"
13 [ -e "/sys/class/leds/internet" ] && ucidef_set_led_netdev "internet" "internet" "internet" "pppoe-wan"
14
15 board=$(lantiq_board_name)
16
17 case "$board" in
18 VG3503J)
19 ucidef_set_led_netdev "vdsl" "vdsl" "bt:green:dsl" "ptm0"
20 ;;
21 BTHOMEHUBV2B)
22 ucidef_set_led_default "power" "power" "soc:blue:power" "1"
23 # ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0radio"
24 ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0tpt"
25 ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" "pppoa-wan"
26 ucidef_set_led_usbdev "usb" "usb" "soc:blue:phone" "1-1"
27 ;;
28 BTHOMEHUBV3A|BTHOMEHUBV5A)
29 ucidef_set_led_default "power" "power" "soc:blue:power" "1"
30 ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0tpt"
31 ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" "pppoa-wan"
32 ;;
33 VGV7510KW22)
34 ucidef_set_led_default "power" "power" "power" "1"
35 ucidef_set_led_default "power2" "power2" "power2" "0"
36 ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0radio"
37 ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
38 ucidef_set_led_netdev "internet_green" "internet_green" "internet_green" "pppoe-wan"
39 ;;
40 VGV7519)
41 ucidef_set_led_default "power" "power" "power" "0"
42 ucidef_set_led_default "power2" "power2" "power2" "1"
43 ucidef_set_led_wlan "wireless_yellow" "wireless_yellow" "wireless_yellow" "phy0radio"
44 ucidef_set_led_netdev "internet_yellow" "internet_yellow" "internet_yellow" "nas0"
45 ucidef_set_led_netdev "broadband_yellow" "broadband_yellow" "broadband_yellow" "pppoe-wan"
46 ;;
47 P2812HNUF*)
48 ucidef_set_led_default "power" "power" "power" "0"
49 ucidef_set_led_default "power2" "power2" "power2" "1"
50 ucidef_set_led_wlan "wireless_green" "wireless_green" "wireless_green" "phy0radio"
51 ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
52 ucidef_set_led_netdev "internet_green" "internet_green" "internet_green" "pppoe-wan"
53 ;;
54 *)
55 ;;
56 esac
57
58 for a in `ls /sys/class/leds/`; do
59 grep -q "\[none\]" /sys/class/leds/$a/trigger
60 [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness`
61 done
62
63 ucidef_commit_leds
64
65 exit 0