summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.c
AgeCommit message (Collapse)Author
2012-09-11leds-lp5523: minor code style fixesKim, Milo
(a) use LP5523_ENABLE rather than magic number 0x40 (b) use min_t() in lp5523_mux_parse() (c) skip while loop and just return if invalid command Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11leds-lp5523: change the return type of lp5523_set_mode()Kim, Milo
The return value of this function is not handled any place, so make it as void type. And three if-statements are replaced with switch-statements. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11leds-lp5523: set the brightness to 0 forcely on removing the driverKim, Milo
Turning off the brightness of each channel is required when removing the driver. So use flush_work() rather than cancel_work_sync() to execute remaining brightness works. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11leds-lp5523: add channel name in the platform dataKim, Milo
The name of each led channel is configurable. If the name is NULL, just use the channel id for making the channel name Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu
Cc: Mathias Nyman <mathias.nyman@nokia.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24leds-lp5523: BUG() in error handling in probe()Dan Carpenter
Inside the error handling in lp5523_init_led(), there is a place that calls to led_classdev_unregister(). When we unregister the LED drivers, it tries to set the brightness to OFF. In this driver setting the brightness is done through a work queue and the work queue hasn't been initialized yet. The result is that we trigger a WARN_ON() in the __queue_work(). The fix is to move the INIT_WORK() in front of the call to lp5523_init_led(). Matt Renzelmann found this using a bug finding tool. Reported-by: Matt Renzelmann <mjr@cs.wisc.edu> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-03-23drivers/leds/leds-lp5523.c: constify some dataAndrew Morton
Saves ~50 bytes text and speeds things up. Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10drivers/leds/leds-lp5523.c: remove unneeded forward declarationAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10leds: convert led i2c drivers to module_i2c_driverAxel Lin
Factor out some boilerplate code for i2c driver registration into module_i2c_driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Haojian Zhuang <hzhuang1@marvell.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Mike Rapoport <mike@compulab.co.il> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-27drivers/leds/leds-lp5523.c: fix section mismatchesRalf Baechle
Fix this section mismatch: WARNING: drivers/leds/leds-lp5523.o(.text+0x12f4): Section mismatch in reference from the function lp5523_probe() to the function .init.text:lp5523_init_led() The function lp5523_probe() references the function __init lp5523_init_led(). This is often because lp5523_probe lacks a __init annotation or the annotation of lp5523_init_led is wrong. Fixing this one triggers one more mismatch, fix that one as well. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22drivers/leds/leds-lp5523.c: world-writable engine* sysfs filesVasiliy Kulikov
Don't allow everybody to change LED settings. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13leds: lp5523: fix circular lockingSamu Onkalo
Driver contained possibility for circular locking. One lock is held by sysfs-core and another one by the driver itself. This happened when the driver created or removed sysfs entries dynamically. There is no real need to do those operations. Now all the sysfs entries are created at probe and removed at removal. Engine load and mux configuration sysfs entries are now visible all the time. However, access to the entries fails if the engine is disabled or running. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Arun Murthy <arun.murthy@stericsson.com> Reviewed-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13leds: leds-lp5523: modify the way of setting led device nameSamu Onkalo
Currently all leds channels begins with string lp5523. Patch adds a possibility to provide name via platform data. This makes it possible to have several chips without overlapping sysfs names. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Arun Murthy <arun.murthy@stericsson.com> Cc: Ilkka Koskinen <ilkka.koskinen@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-25drivers/leds/leds-lp5523.c: perform SW reset before detectionSamu Onkalo
Chip detection may fail if the chip is in some odd state for example after system restart. Chip doesn't have HW reset line. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-25drivers/leds/leds-lp5523.c: adjust delays and add comments to themSamu Onkalo
Delays were little bit too long. Adjust delay times and add some comments to them. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-25drivers/leds/leds-lp5523.c: change some macros to functionsSamu Onkalo
A small macro changed to inline function to have proper type checking. Inline added to two similar small functions. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-12leds: driver for National Semiconductors LP5523 chipSamu Onkalo
LP5523 chip is nine channel led driver with programmable engines. Driver provides support for that chip for direct access via led class or via programmable engines. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>