summaryrefslogtreecommitdiff
path: root/target/linux/lantiq
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-06-10 08:25:02 +0000
committerJohn Crispin <john@openwrt.org>2013-06-10 08:25:02 +0000
commitf7daed8b9a13578c5e8e5b15bfbd062139c851e3 (patch)
treeafe2cb596d240040f47fc83b20ddb7816302df10 /target/linux/lantiq
parentfc9532aeaaa73c49e50f1052f210adfda0d0c3ed (diff)
downloadmtk-20170518-f7daed8b9a13578c5e8e5b15bfbd062139c851e3.zip
mtk-20170518-f7daed8b9a13578c5e8e5b15bfbd062139c851e3.tar.gz
mtk-20170518-f7daed8b9a13578c5e8e5b15bfbd062139c851e3.tar.bz2
lantiq: diag.sh with both red and green power LEDs
This provides a boot LED sequence suitable for devices with both red and green LEDs for power. This assumes no "default-on" settings in the device tree. Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> SVN-Revision: 36899
Diffstat (limited to 'target/linux/lantiq')
-rw-r--r--target/linux/lantiq/base-files/etc/diag.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh
index 9e0e170..a6cb823 100644
--- a/target/linux/lantiq/base-files/etc/diag.sh
+++ b/target/linux/lantiq/base-files/etc/diag.sh
@@ -6,6 +6,26 @@
status_led="power"
set_state() {
+ [ -d /sys/class/leds/power2/ ] && {
+
+ case "$1" in
+ preinit)
+ led_set_attr "power2" "trigger" "heartbeat"
+ ;;
+ init)
+ status_led_on
+ ;;
+ failsafe)
+ led_off "power2"
+ status_led_set_timer 100 100
+ ;;
+ done)
+ led_off "power2"
+ ;;
+ esac
+ return
+ }
+
case "$1" in
preinit)
status_led_set_heartbeat