summaryrefslogtreecommitdiff
path: root/drivers/leds/trigger
AgeCommit message (Collapse)Author
2015-11-03leds: triggers: add invert to heartbeatJiri Prchal
This patch adds possibility to invert heartbeat blinking. The inverted LED is more time ON then OFF. It's because it looks better when the heartbeat LED is next to other LED which is most time ON. The invert value is exported same way via sysfs in file invert like oneshot. I get inspiration from this trigger. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28leds: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2014-11-14leds: Add support for setting brightness in a synchronous wayJacek Anaszewski
There are use cases when setting a LED brightness has to have immediate effect (e.g. setting a torch LED brightness). This patch extends LED subsystem to support such operations. The LED subsystem internal API __led_set_brightness is changed to led_set_brightness_async and new led_set_brightness_sync API is added. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-09-11leds: trigger: gpio: fix warning in gpio trigger for gpios whose accessor ↵Lothar Waßmann
function may sleep When using a GPIO driver whose accessor functions may sleep (e.g. an I2C GPIO extender like PCA9554) the following warning is issued: WARNING: CPU: 0 PID: 665 at drivers/gpio/gpiolib.c:2274 gpiod_get_raw_value+0x3c/0x48() Modules linked in: CPU: 0 PID: 665 Comm: kworker/0:2 Not tainted 3.16.0-karo+ #115 Workqueue: events gpio_trig_work [<c00142cc>] (unwind_backtrace) from [<c00118f8>] (show_stack+0x10/0x14) [<c00118f8>] (show_stack) from [<c001bf10>] (warn_slowpath_common+0x64/0x84) [<c001bf10>] (warn_slowpath_common) from [<c001bf4c>] (warn_slowpath_null+0x1c/0x24) [<c001bf4c>] (warn_slowpath_null) from [<c020a1b8>] (gpiod_get_raw_value+0x3c/0x48) [<c020a1b8>] (gpiod_get_raw_value) from [<c02f68a0>] (gpio_trig_work+0x1c/0xb0) [<c02f68a0>] (gpio_trig_work) from [<c0030c1c>] (process_one_work+0x144/0x38c) [<c0030c1c>] (process_one_work) from [<c0030ef8>] (worker_thread+0x60/0x5cc) [<c0030ef8>] (worker_thread) from [<c0036dd4>] (kthread+0xb4/0xd0) [<c0036dd4>] (kthread) from [<c000f0f0>] (ret_from_fork+0x14/0x24) ---[ end trace cd51a1dad8b86c9c ]--- Fix this by using the _cansleep() variant of gpio_get_value(). Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-05-08drivers/leds: Replace __get_cpu_var use through this_cpu_ptrChristoph Lameter
Use this_cpu_ptr for the address calculation instead of __get_cpu_var. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-02-27ledtrig-cpu: Handle CPU hot(un)pluggingPawel Moll
When CPU is hot(un)plugged, no syscore notification is being generated, nor is cpuidle involved. This leaves the CPU LED turned on, because the dying thread is doing some work (LED on) and than it is... well, dying (LED still on :-) Added notifier block for hot(un)plugging operations, generating existing trigger events. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-08-26leds: trigger: ledtrig-backlight: Fix invalid memory access in fb_event ↵Manfred Schlaegl
notification callback fb_notifier_callback is called on any event fired by fb_notifier_call_chain. Events may, or may not contain some data (fb_event.data). In case of FB_EVENT_BLANK fb_event.data contains a pointer to an integer holdingthe blank state. The Problem is, that in ledtrig-backlight.c - fb_notifier_callback the pointer to blank state is dereferenced BEFORE the event-type is checked. Obviously this leads to problems with other events than FB_EVENT_BLANK, where fb_event.data is undefined or NULL. It seems, that this problem existed ever since the driver was added. Like in drivers/video/backlight/backlight.c line 43 I would suggest to return immediately on events other than FB_EVENT_BLANK. Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-04-01leds: add camera LED triggersKim, Milo
Some LED devices support flash/torch functionality through the LED subsystem. This patch enables direct LED trigger controls by the driver. Flash on/off and torch on/off can be done simply by other driver space. Two trigger APIs are added, ledtrig_flash_ctrl() and ledtrig_torch_ctrl(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-04-01leds: move LED trigger drivers into new subdirectoryKim, Milo
For better driver management, new subdirectory, 'trigger' is created. All LED trigger drivers are moved into this directory. Internal header, 'leds.h' is included in each LED trigger drivers. Fix the location of header file, "leds.h" -> "../leds.h" in driver files. One exception is here, 'ledtrig-timer.c'. There is no need to include 'leds.h'. so '#include "leds.h"' line was removed. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>