[OpenWrt-Devel] [PATCH v6 1/6] base-files: use max_brightness to set LED

Christian Lamparter chunkeey at googlemail.com
Sat Dec 5 17:48:03 EST 2015


From: Chris R Blake <chrisrblake93 at gmail.com>

LEDs which are controlled by a PWM need to use the supplied
max_brightness instead. Otherwise they might appear to be
very dim / broken.

Signed-off-by: Chris R Blake <chrisrblake93 at gmail.com>
---
 package/base-files/files/etc/init.d/led | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index 3f45732..84cd028 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -44,7 +44,7 @@ load_led() {
 		ret="$?"
 
 		[ $default = 1 ] &&
-			echo 1 >/sys/class/leds/${sysfs}/brightness
+			cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness
 
 		[ $ret = 0 ] || {
 			echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module"
-- 
2.6.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list