ath79: clean up led config script files for all devices
1. Move all status led definitions out of diag.sh into device dt as we use here a generic script hook. 2. Encode "phy0ptp" led trigger in dt of device for all ath79 devices. Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
This commit is contained in:
parent
25ea21d765
commit
14cb05909a
7 changed files with 17 additions and 34 deletions
|
@ -10,7 +10,6 @@ boardname="${board##*,}"
|
||||||
case "$board" in
|
case "$board" in
|
||||||
"avm,fritz300e")
|
"avm,fritz300e")
|
||||||
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
|
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
|
||||||
ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
|
|
||||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
|
ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
|
||||||
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
|
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
|
||||||
|
@ -20,13 +19,9 @@ case "$board" in
|
||||||
;;
|
;;
|
||||||
"etactica,eg200")
|
"etactica,eg200")
|
||||||
ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
|
ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
|
||||||
ucidef_set_led_wlan "wlan" "WLAN" "$boardname:red:wlan" "phy0tpt"
|
|
||||||
ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
|
ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
|
||||||
ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
|
ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
|
||||||
;;
|
;;
|
||||||
"glinet,ar150")
|
|
||||||
ucidef_set_led_wlan "wlan" "WLAN" "gl-ar150:orange:wlan" "phy0tpt"
|
|
||||||
;;
|
|
||||||
"tplink,tl-mr3020-v1")
|
"tplink,tl-mr3020-v1")
|
||||||
ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x02"
|
ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x02"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -4,32 +4,7 @@
|
||||||
|
|
||||||
status_led="$(get_dt_led status)"
|
status_led="$(get_dt_led status)"
|
||||||
|
|
||||||
get_status_led() {
|
|
||||||
local board=$(board_name)
|
|
||||||
local boardname="${board##*,}"
|
|
||||||
|
|
||||||
case $board in
|
|
||||||
"avm,fritz300e")
|
|
||||||
status_led="${boardname}:green:power"
|
|
||||||
;;
|
|
||||||
"embeddedwireless,dorin")
|
|
||||||
status_led="dorin:green:status"
|
|
||||||
;;
|
|
||||||
"glinet,ar150")
|
|
||||||
status_led="gl-ar150:orange:wlan"
|
|
||||||
;;
|
|
||||||
"tplink,tl-wr1043nd-v1")
|
|
||||||
status_led="tp-link:green:system"
|
|
||||||
;;
|
|
||||||
"ubnt,unifi")
|
|
||||||
status_led="ubnt:green:dome"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
set_state() {
|
set_state() {
|
||||||
[ -z "$status_led" ] && get_status_led
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
preinit)
|
preinit)
|
||||||
status_led_blink_preinit
|
status_led_blink_preinit
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
compatible = "ubnt,unifi", "qca,ar7241";
|
compatible = "ubnt,unifi", "qca,ar7241";
|
||||||
model = "Ubiquiti UniFi AP";
|
model = "Ubiquiti UniFi AP";
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
led-status = &dome_green;
|
||||||
|
};
|
||||||
|
|
||||||
memory@0 {
|
memory@0 {
|
||||||
device_type = "memory";
|
device_type = "memory";
|
||||||
reg = <0x0 0x4000000>;
|
reg = <0x0 0x4000000>;
|
||||||
|
@ -36,7 +40,7 @@
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
dome-green {
|
dome_green: dome-green {
|
||||||
label = "ubnt:green:dome";
|
label = "ubnt:green:dome";
|
||||||
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
|
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
compatible = "avm,fritz300e", "qca,ar7242";
|
compatible = "avm,fritz300e", "qca,ar7242";
|
||||||
model = "AVM FRITZ!WLAN Repeater 300E";
|
model = "AVM FRITZ!WLAN Repeater 300E";
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
led-status = &power;
|
||||||
|
};
|
||||||
|
|
||||||
memory@0 {
|
memory@0 {
|
||||||
device_type = "memory";
|
device_type = "memory";
|
||||||
reg = <0x0 0x4000000>;
|
reg = <0x0 0x4000000>;
|
||||||
|
@ -32,7 +36,7 @@
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
power {
|
power: power {
|
||||||
label = "fritz300e:green:power";
|
label = "fritz300e:green:power";
|
||||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||||
default-state = "on";
|
default-state = "on";
|
||||||
|
@ -46,6 +50,7 @@
|
||||||
wlan {
|
wlan {
|
||||||
label = "fritz300e:green:wlan";
|
label = "fritz300e:green:wlan";
|
||||||
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
||||||
|
linux,default-trigger = "phy0tpt";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
aliases {
|
aliases {
|
||||||
serial0 = &uart;
|
serial0 = &uart;
|
||||||
|
led-status = &wlan;
|
||||||
};
|
};
|
||||||
|
|
||||||
memory@0 {
|
memory@0 {
|
||||||
|
@ -22,10 +23,11 @@
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
wlan {
|
wlan: wlan {
|
||||||
label = "gl-ar150:orange:wlan";
|
label = "gl-ar150:orange:wlan";
|
||||||
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
|
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
|
||||||
default-state = "off";
|
default-state = "off";
|
||||||
|
linux,default-trigger = "phy0tpt";
|
||||||
};
|
};
|
||||||
|
|
||||||
lan {
|
lan {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
compatible = "embeddedwireless,dorin", "qca,ar9331";
|
compatible = "embeddedwireless,dorin", "qca,ar9331";
|
||||||
|
|
||||||
aliases {
|
aliases {
|
||||||
|
led-status = &status;
|
||||||
serial0 = &uart;
|
serial0 = &uart;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@
|
||||||
leds {
|
leds {
|
||||||
compatible = "gpio-leds";
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
status {
|
status: status {
|
||||||
label = "dorin:green:status";
|
label = "dorin:green:status";
|
||||||
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
|
||||||
default-state = "off";
|
default-state = "off";
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
label = "eg200:red:wlan";
|
label = "eg200:red:wlan";
|
||||||
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||||
default-state = "off";
|
default-state = "off";
|
||||||
|
linux,default-trigger = "phy0tpt";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue