From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] led: trigger: use max_value to turn on led instead of hardcoded '1'
Date: Wed, 8 Oct 2014 16:05:03 +0200 [thread overview]
Message-ID: <1412777104-19569-1-git-send-email-s.hauer@pengutronix.de> (raw)
For PWM LEDs '1' may be really dark. Use max_value instead.
Signed-off-by: Sascha Hauer <s.hauer@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2014-10-08 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 14:05 Sascha Hauer [this message]
2014-10-08 14:05 ` [PATCH 2/2] led: trigger: Turn of flashing leds only once Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412777104-19569-1-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox