Migrate lantiq platform to common led helper functions

http://patchwork.openwrt.org/patch/3316/

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 36187
master
John Crispin 12 years ago
parent a4c745ee74
commit d9bb7ff7a5
  1. 40
      target/linux/lantiq/base-files/etc/diag.sh

@ -1,42 +1,24 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2012 OpenWrt.org # Copyright (C) 2012-2013 OpenWrt.org
[ -d /sys/class/leds/power/ ] || return . /lib/functions/leds.sh
set_state() { status_led="power"
[ -d /sys/class/leds/power1/ ] && {
case "$1" in
preinit)
echo heartbeat >/sys/class/leds/power/trigger
;;
failsafe)
echo none >/sys/class/leds/power/trigger
echo timer >/sys/class/leds/power1/trigger
echo 100 >/sys/class/leds/power1/delay_on
echo 100 >/sys/class/leds/power1/delay_off
;;
done)
echo none >/sys/class/leds/power/trigger
echo none >/sys/class/leds/power1/trigger
echo 1 >/sys/class/leds/power/brightness
;;
esac
return
}
set_state() {
case "$1" in case "$1" in
preinit) preinit)
echo heartbeat >/sys/class/leds/power/trigger status_led_set_heartbeat
;; ;;
failsafe) failsafe)
echo timer >/sys/class/leds/power/trigger [ -d /sys/class/leds/power1 ] && {
echo 100 >/sys/class/leds/power/delay_on status_led_off
echo 100 >/sys/class/leds/power/delay_off led_timer "power1" 100 100
} || status_led_set_timer 100 100
;; ;;
done) done)
echo none >/sys/class/leds/power/trigger status_led_on
echo 1 >/sys/class/leds/power/brightness led_off "power1"
;; ;;
esac esac
} }

Loading…
Cancel
Save