ramips: express diag led handling via devicetree
authorMathias Kresin <dev@kresin.me>
Sat, 18 Aug 2018 09:38:13 +0000 (11:38 +0200)
committerMathias Kresin <dev@kresin.me>
Wed, 29 Aug 2018 07:34:07 +0000 (09:34 +0200)
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>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/dts/DCH-M225.dts
target/linux/ramips/dts/DIR-615-D.dts
target/linux/ramips/dts/DIR-615-H1.dts
target/linux/ramips/dts/HPM.dts
target/linux/ramips/dts/PBR-M1.dts

index 6da04ea9b155e8ee695ded0866009064e4706d1f..c92712c4532f5be5eb04b29d3457facf90e726bb 100755 (executable)
@@ -117,9 +117,6 @@ d240)
        set_wifi_led "$boardname:blue:wifi"
        set_usb_led "$boardname:blue:usb"
        ;;
-dch-m225)
-       ucidef_set_led_default "status" "STATUS" "$board:red:status" "0"
-       ;;
 dcs-930l-b1)
        ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
        ;;
@@ -143,7 +140,6 @@ wt1520-8M)
        ;;
 dir-615-d|\
 dir-615-h1)
-       ucidef_set_led_default "status" "Status LED (amber)" "$boardname:amber:status" "0"
        set_wifi_led "rt2800pci-phy0::radio"
        ;;
 dir-620-d1|\
@@ -228,7 +224,6 @@ hiwifi,hc5861b)
        set_wifi_led "$boardname:green:wlan2g"
        ;;
 hpm)
-       ucidef_set_led_default "power" "POWER" "$boardname:orange:power" "1"
        ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
        set_wifi_led "$boardname:green:wifi"
        ;;
@@ -314,7 +309,6 @@ pbr-d1)
        ;;
 pbr-m1)
        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)
        set_usb_led "$boardname:blue:usb"
index 1e32c6d19482e94e294df10da0dc2453779e98db..b2184369299a7f4061f89d766254d8ed139951cc 100644 (file)
                led_power: power {
                        label = "dch-m225:green:power";
                        gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
                };
 
                status {
                        label = "dch-m225:red:status";
                        gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
                };
        };
 
index 7931a26fa3b09ae3a0f1a825d22bc8a783e9d3c5..b59ff3c7c2e2cb6c61987e6964e782574d78fbe7 100644 (file)
                status {
                        label = "dir-615-d:amber:status";
                        gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
                };
 
                led_status_green: status2 {
                        label = "dir-615-d:green:status";
                        gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
                };
 
                wan {
index 4bfeb951e5a921a788f99c9b31e34b35c72a53ef..cbc3dadb74ff975c7e530dfa4dea8b2cdea60778 100644 (file)
                status {
                        label = "dir-615-h1:amber:status";
                        gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
                };
 
                led_status_green: status2 {
                        label = "dir-615-h1:green:status";
                        gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
 
                wan {
index 3a262f2b9125bc1352e7479f4786d3688792c353..9d50697d887e95a8e6e1da371dbd098037a3c383 100644 (file)
                power {
                        label = "hpm:orange:power";
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
                };
 
                led_status: status {
                        label = "hpm:green:status";
                        gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
                };
 
                eth {
index 39960481f0e498bc9596bbd3e5149c1fe831ea20..537e5f208fe658e3226c5fe52f981195655de794 100644 (file)
@@ -10,7 +10,7 @@
        model = "PBR-M1";
 
        aliases {
-               led-status = &led_power;
+               led-status = &led_sys;
        };
 
        memory@0 {
        gpio-leds {
                compatible = "gpio-leds";
 
-               led_power: power {
+               power {
                        label = "pbr-m1:blue:power";
                        gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
                };
 
-               sys {
+               led_sys: sys {
                        label = "pbr-m1:blue:sys";
                        gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
                };