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
This commit is contained in:
John Crispin 2013-04-03 10:01:07 +00:00
parent a4c745ee74
commit d9bb7ff7a5

View file

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