[PATCH 1/2] led: trigger: use max_value to turn on led instead of hardcoded '1'

Sascha Hauer s.hauer at pengutronix.de
Wed Oct 8 07:05:03 PDT 2014


For PWM LEDs '1' may be really dark. Use max_value instead.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/led/led-triggers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/led/led-triggers.c b/drivers/led/led-triggers.c
index c5484d5..adcb9e0 100644
--- a/drivers/led/led-triggers.c
+++ b/drivers/led/led-triggers.c
@@ -90,13 +90,13 @@ void led_trigger(enum led_trigger trigger, enum trigger_type type)
 
 	if (type == TRIGGER_FLASH) {
 		if (is_timeout(triggers[trigger].flash_start, 400 * MSECOND)) {
-			led_set(triggers[trigger].led, 1);
+			led_set(triggers[trigger].led, triggers[trigger].led->max_value);
 			triggers[trigger].flash_start = get_time_ns();
 		}
 		return;
 	}
 
-	led_set(triggers[trigger].led, type == TRIGGER_ENABLE ? 1 : 0);
+	led_set(triggers[trigger].led, type == TRIGGER_ENABLE ? triggers[trigger].led->max_value : 0);
 }
 
 /**
-- 
2.1.0




More information about the barebox mailing list