oxnas: switch to DTS aliases for LEDs and use generic diag.sh
authorDaniel Golle <daniel@makrotopia.org>
Fri, 1 Mar 2019 22:51:19 +0000 (23:51 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 1 Mar 2019 22:51:19 +0000 (23:51 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/oxnas/base-files/etc/board.d/01_leds [deleted file]
target/linux/oxnas/base-files/etc/diag.sh [deleted file]
target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio-mycloud.dts
target/linux/oxnas/files/arch/arm/boot/dts/ox820-cloudengines-pogoplug-pro.dts
target/linux/oxnas/files/arch/arm/boot/dts/ox820-mitrastar-stg212.dts
target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts
target/linux/oxnas/patches-4.14/030-led-aliases-on-pogoplug-v3.patch [new file with mode: 0644]

diff --git a/target/linux/oxnas/base-files/etc/board.d/01_leds b/target/linux/oxnas/base-files/etc/board.d/01_leds
deleted file mode 100755 (executable)
index 0d92b16..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-. /lib/functions/uci-defaults.sh
-
-board=$(board_name)
-board_config_update
-
-case $board in
-       "akitio,myloud")
-               ucidef_set_led_default "status" "status" "akitio:red:status" "0"
-               ;;
-       "mitrastar,stg-212")
-               ucidef_set_led_default "power" "power" "zyxel:blue:status" "1"
-               ;;
-       "shuttle,kd20")
-               ucidef_set_led_default "power" "power" "kd20:blue:status" "1"
-               ;;
-       "cloudengines,pogoplug"*)
-               ucidef_set_led_default "power" "power" "pogoplug:blue:internal" "1"
-               ;;
-
-esac
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/oxnas/base-files/etc/diag.sh b/target/linux/oxnas/base-files/etc/diag.sh
deleted file mode 100644 (file)
index b8a51c2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2013 OpenWrt.org
-
-. /lib/functions.sh
-. /lib/functions/leds.sh
-
-get_status_led() {
-       case $(board_name) in
-       "akitio,mycloud")
-               status_led="akitio:red:status"
-               ;;
-       "mitrastar,stg-212")
-               status_led="zyxel:blue:status"
-               ;;
-       "shuttle,kd20")
-               status_led="kd20:blue:status"
-               ;;
-       "cloudengines,pogoplug"*)
-               status_led="pogoplug:blue:internal"
-               ;;
-       esac
-}
-
-set_state() {
-       get_status_led
-
-       case "$1" in
-       preinit)
-               status_led_blink_preinit
-               ;;
-       failsafe)
-               status_led_blink_failsafe
-               ;;
-       preinit_regular)
-               status_led_blink_preinit_regular
-               ;;
-       done)
-               status_led_on
-               ;;
-       esac
-}
index f0fa928f3d8697ee929dac42dbcd695859ce8c15..e36bc6bd70c7115374438817e985dd321dac9fe2 100644 (file)
                serial0 = &uart0;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
        };
 
        i2c-gpio {
@@ -62,7 +66,7 @@
                compatible = "gpio-leds";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_leds>;
-               status {
+               led_status: status {
                        label = "akitio:red:status";
                        gpios = <&gpio0 29 0>;
                };
index 999276e5adda3a8a759b0058aeb0c5f7e3c22351..19533930ef16ada0d00e898b472276e8ba0f1877 100644 (file)
                serial0 = &uart0;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
+               led-boot = &led_status;
+               led-failsafe = &led_warn;
+               led-running = &led_act;
+               led-upgrade = &led_warn;
        };
 
        leds {
                compatible = "gpio-leds";
 
-               blue {
+               led_status: blue {
                        label = "pogoplug:blue";
                        gpios = <&gpio0 2 0>;
                        default-state = "keep";
                };
 
-               orange {
+               led_warn: orange {
                        label = "pogoplug:orange";
                        gpios = <&gpio1 16 1>;
                        default-state = "keep";
                };
 
-               green {
+               led_act: green {
                        label = "pogoplug:green";
                        gpios = <&gpio1 17 1>;
                        default-state = "keep";
index b3282acc727a3cef1c4d02347ca1dbcf3d7d56bc..4610aab88344e9a752b42febb3bf779bf1bd2acc 100644 (file)
                serial0 = &uart0;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
+               led-boot = &led_status;
+               led-failsafe = &led_warn;
+               led-running = &led_status;
+               led-upgrade = &led_warn;
        };
 
        keys {
 
        leds {
                compatible = "gpio-leds";
-               status {
+               led_status: status {
                        label = "zyxel:blue:status";
                        gpios = <&gpio1 5 0>;
                };
-               status2 {
+               led_warn: status2 {
                        label = "zyxel:red:status";
                        gpios = <&gpio1 6 1>;
                };
index 1984e446b263fdf4e24e8d1513eea7905e43db88..40960d0f3d52badd4975c6673ef0279c1ec8a3a9 100644 (file)
                serial0 = &uart0;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
+               led-boot = &led_status;
+               led-failsafe = &led_warn;
+               led-running = &led_status;
+               led-upgrade = &led_warn;
        };
 
        i2c-gpio {
 
        leds {
                compatible = "gpio-leds";
-               status {
+               led_status: status {
                        label = "kd20:blue:status";
                        gpios = <&gpio1 16 0>;
                };
-               status2 {
+               led_warn: status2 {
                        label = "kd20:red:status";
                        gpios = <&gpio1 17 0>;
                };
diff --git a/target/linux/oxnas/patches-4.14/030-led-aliases-on-pogoplug-v3.patch b/target/linux/oxnas/patches-4.14/030-led-aliases-on-pogoplug-v3.patch
new file mode 100644 (file)
index 0000000..4025ec0
--- /dev/null
@@ -0,0 +1,34 @@
+--- a/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts
++++ b/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts
+@@ -28,24 +28,28 @@
+               serial0 = &uart0;
+               gpio0 = &gpio0;
+               gpio1 = &gpio1;
++              led-boot = &led_status;
++              led-failsafe = &led_warn;
++              led-running = &led_act;
++              led-upgrade = &led_warn;
+       };
+       leds {
+               compatible = "gpio-leds";
+-              blue {
++              led_status: blue {
+                       label = "pogoplug:blue";
+                       gpios = <&gpio0 2 0>;
+                       default-state = "keep";
+               };
+-              orange {
++              led_warn: orange {
+                       label = "pogoplug:orange";
+                       gpios = <&gpio1 16 1>;
+                       default-state = "keep";
+               };
+-              green {
++              led_act: green {
+                       label = "pogoplug:green";
+                       gpios = <&gpio1 17 1>;
+                       default-state = "keep";