aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-07-24leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu1-14/+10
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 Carpenter1-3/+3
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 Morton1-3/+3
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 Lin1-2/+0
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 Lin1-19/+1
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 Baechle1-2/+2
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 Kulikov1-10/+10
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 Onkalo1-40/+16
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 Onkalo1-1/+2
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 Onkalo1-7/+5
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 Onkalo1-14/+17
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 Onkalo1-3/+6
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 Onkalo1-0/+1065
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>