ramips: express diag led handling via devicetree

Use the default-state property to express the desired led handling in
the devicetree source file instead of the userspace.

Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
Mathias Kresin 2018-08-18 11:38:13 +02:00
parent 111907e8d3
commit 99045dfc59
6 changed files with 12 additions and 9 deletions

View file

@ -117,9 +117,6 @@ d240)
set_wifi_led "$boardname:blue:wifi" set_wifi_led "$boardname:blue:wifi"
set_usb_led "$boardname:blue:usb" set_usb_led "$boardname:blue:usb"
;; ;;
dch-m225)
ucidef_set_led_default "status" "STATUS" "$board:red:status" "0"
;;
dcs-930l-b1) dcs-930l-b1)
ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps" ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
;; ;;
@ -143,7 +140,6 @@ wt1520-8M)
;; ;;
dir-615-d|\ dir-615-d|\
dir-615-h1) dir-615-h1)
ucidef_set_led_default "status" "Status LED (amber)" "$boardname:amber:status" "0"
set_wifi_led "rt2800pci-phy0::radio" set_wifi_led "rt2800pci-phy0::radio"
;; ;;
dir-620-d1|\ dir-620-d1|\
@ -228,7 +224,6 @@ hiwifi,hc5861b)
set_wifi_led "$boardname:green:wlan2g" set_wifi_led "$boardname:green:wlan2g"
;; ;;
hpm) hpm)
ucidef_set_led_default "power" "POWER" "$boardname:orange:power" "1"
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
set_wifi_led "$boardname:green:wifi" set_wifi_led "$boardname:green:wifi"
;; ;;
@ -314,7 +309,6 @@ pbr-d1)
;; ;;
pbr-m1) pbr-m1)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
ucidef_set_led_default "sys" "sys" "$boardname:blue:sys" "1"
;; ;;
d-team,newifi-d2) d-team,newifi-d2)
set_usb_led "$boardname:blue:usb" set_usb_led "$boardname:blue:usb"

View file

@ -36,11 +36,13 @@
led_power: power { led_power: power {
label = "dch-m225:green:power"; label = "dch-m225:green:power";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
status { status {
label = "dch-m225:red:status"; label = "dch-m225:red:status";
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
default-state = "off";
}; };
}; };

View file

@ -72,11 +72,13 @@
status { status {
label = "dir-615-d:amber:status"; label = "dir-615-d:amber:status";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
default-state = "off";
}; };
led_status_green: status2 { led_status_green: status2 {
label = "dir-615-d:green:status"; label = "dir-615-d:green:status";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
wan { wan {

View file

@ -19,11 +19,13 @@
status { status {
label = "dir-615-h1:amber:status"; label = "dir-615-h1:amber:status";
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
default-state = "off";
}; };
led_status_green: status2 { led_status_green: status2 {
label = "dir-615-h1:green:status"; label = "dir-615-h1:green:status";
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
default-state = "on";
}; };
wan { wan {

View file

@ -34,11 +34,13 @@
power { power {
label = "hpm:orange:power"; label = "hpm:orange:power";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
led_status: status { led_status: status {
label = "hpm:green:status"; label = "hpm:green:status";
gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
eth { eth {

View file

@ -10,7 +10,7 @@
model = "PBR-M1"; model = "PBR-M1";
aliases { aliases {
led-status = &led_power; led-status = &led_sys;
}; };
memory@0 { memory@0 {
@ -37,12 +37,13 @@
gpio-leds { gpio-leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
led_power: power { power {
label = "pbr-m1:blue:power"; label = "pbr-m1:blue:power";
gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
sys { led_sys: sys {
label = "pbr-m1:blue:sys"; label = "pbr-m1:blue:sys";
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
}; };