summaryrefslogtreecommitdiffstats
path: root/drivers/led/core.c
Commit message (Collapse)AuthorAgeFilesLines
* led: core: Make use of ARRAY_AND_SIZEAndrey Smirnov2018-12-101-2/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: core: Initialize blink_next_event with 0Andrey Smirnov2018-12-101-1/+1
| | | | | | | | | A simpler way to make pattern to trigger immediately is to initialize blink_next_event to 0 instead of current time value. Save a function call and convert the code to do just that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: core: Don't call get_time_us() twiceAndrey Smirnov2018-12-101-2/+3
| | | | | | | | | The code doesn't seem to be time-sensitive enough to warrant calling get_time_ns() twice instead of caching its value and using it no both places. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: use max led value in case of led triggerOleg.Karfich@wago.com2018-09-101-1/+3
| | | | | | | | | | The led_poller function blink_func uses for flashing and blinking only the values 1/0 for setting the leds. In case of an e.g. gpio led this is true. But in case of pwm driven leds, where someone could dimm the leds, the value of 1 dimms the led. Use the max value for blinking and flashing of a led when enabling. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: add blinking/flashing and led_blink_pattern interfaceSascha Hauer2017-03-301-1/+100
| | | | | | | | | | | | | | | So far blinking/flashing LEDs is only supported on led-trigger level. Even without triggers it useful to be able to blink/flash LEDs, so add this functionality to the LED core. A led_blink_pattern consists of a number of on and off-periods which are described in an array. Using such an array you can encode nearly every blink pattern you need. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: Add default-on triggerSascha Hauer2014-03-031-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: move led_of_parse_trigger to coreSascha Hauer2014-03-031-0/+34
| | | | | | So that other LED drivers can use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: test for led->set callback before calling itSascha Hauer2013-01-141-0/+3
| | | | | | | | Registering a LED can fail. If someone calls led_set for such a LED no set function will be there. Fail gracefully in this case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* led: remove gpio includeSascha Hauer2012-07-251-1/+0
| | | | | | | The LED core itself does not need gpio support, so remove include so that it compiles on architectures without gpio support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* basic LED supportSascha Hauer2010-12-201-0/+157
This patch adds core functionality for controlling LEDs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>