summaryrefslogtreecommitdiffstats
path: root/drivers/leds
Commit message (Collapse)AuthorAgeFilesLines
* leds-lp8788: forgotten unlock at lp8788_led_workDevendra Naga2012-07-271-0/+1
| | | | | | | at default case of switch we return with out unlocking the mutex. Signed-off-by: Devendra Naga <develkernel412222@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* LEDS: propagate error codes in blinkm_detect()Dan Carpenter2012-07-271-2/+2
| | | | | | | | Use the error codes from the lower levels instead of -ENODEV. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jan-Simon Möller <jansimon.moeller@gmx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* LEDS: memory leak in blinkm_led_common_set()Dan Carpenter2012-07-271-2/+5
| | | | | | | | | This can return without freeing the bl_work struct. Also there was no check for allocation failure. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jan-Simon Möller <jansimon.moeller@gmx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: add new lp8788 led driverKim, Milo2012-07-263-0/+200
| | | | | | | | | | | | | | | | | | | | | | | | TI LP8788 PMU has the current sink as the keyboard led driver. The brightness is controlled by the i2c commands. Configurable parameters can be defined in the platform side. Patch v2. (a) use workqueue on changing the brightness (b) use mutex_lock/unlock when the brightness is set and the led block of lp8788 device is enabled (c) remove err_dev on _probe() : just return as returned value if any errors (d) replace module_init/exit() with module_platform_driver() (e) add led configuration structure and loading them by default if platform data is null Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERSJan-Simon Möller2012-07-243-0/+821
| | | | | | | | | | | | | | | | | | | | | | Add driver for BlinkM device to drivers/leds/. Add entry to MAINTAINERS file. Add documentation in Documentation/leds/. A BlinkM is a RGB LED controlled through I2C. This driver implements an interface to the LED framework and another sysfs group to access the internal options of the BlinkM. rev6: Use module_i2c_driver(). rev5: Removed own workqueue in favor of events wq. rev4: Fixed comments by Bryan Wu. rev3: Fixed issues found by Jonathan Neuschäfer. (bryan.wu@canonical.com: remove 2 trailing whitespace) Signed-off-by: Jan-Simon Möller <jansimon.moeller@gmx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: max8997: Simplify max8997_led_set_mode implementationAxel Lin2012-07-241-47/+13
| | | | | | | | | | It is not necessary to call max8997_update_reg() twice just for updating MAX8997_REG_LEN_CNTL register. With proper val and mask arguments to max8997_update_reg() call, this can be done in one max8997_update_reg() call. And then we can remove max8997_led_clear_mode() function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds/leds-s3c24xx: use devm_gpio_requestDevendra Naga2012-07-241-2/+1
| | | | | | | | | why? because if the led_classdev_register fails we wont do gpio free because using devm_ functions, there is no need for error paths Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup ↵Bryan Wu2012-07-241-13/+6
| | | | | | | error exit path Cc: Simon Guinot <sguinot@lacie.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert DAC124S085 LED driver to devm_kzalloc()Bryan Wu2012-07-241-3/+1
| | | | | Cc: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-16/+8
| | | | | | Cc: Shreshtha Kumar SAHU <shreshthakumar.sahu@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert TCA6507 LED driver to devm_kzalloc()Bryan Wu2012-07-241-3/+1
| | | | | Cc: Neil Brown <neilb@suse.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup ↵Bryan Wu2012-07-241-5/+3
| | | | | | | error exit path Cc: Philippe Retornaz <philippe.retornaz@epfl.ch> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-5/+3
| | | | | Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-13/+5
| | | | | Cc: Nate Case <ncase@xes-inc.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-15/+6
| | | | | Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert PCA9532 LED driver to devm_kzalloc()Bryan Wu2012-07-241-8/+2
| | | | | Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert LT3593 LED driver to devm_kzalloc()Bryan Wu2012-07-241-6/+3
| | | | | Cc: Daniel Mack <daniel@caiaq.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error ↵Bryan Wu2012-07-241-14/+9
| | | | | | | exit path Cc: Magnus Damm <damm@opensource.se> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-14/+10
| | | | | Cc: Mathias Nyman <mathias.nyman@nokia.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert PCA9633 LED driver to devm_kzalloc()Bryan Wu2012-07-241-5/+1
| | | | | Cc: Peter Meerwald <p.meerwald@bct-electronic.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit ↵Bryan Wu2012-07-241-6/+2
| | | | | | | path Cc: Kim Kyuwon <q1.kim@samsung.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert LP5521 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-12/+8
| | | | Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert DA9030/DA9034 LED driver to devm_kzalloc() and cleanup error ↵Bryan Wu2012-07-241-7/+2
| | | | | | | exit path Cc: Eric Miao <eric.miao@canonical.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert LP3944 LED driver to devm_kzalloc()Bryan Wu2012-07-241-6/+3
| | | | | Cc: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Atmel PWM LED driver to devm_kzalloc()Bryan Wu2012-07-241-3/+2
| | | | Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert HTC ASIC3 LED driver to devm_kzalloc() and cleanup error exit pathBryan Wu2012-07-241-10/+6
| | | | | Cc: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert Big Networks LED driver to devm_kzalloc()Bryan Wu2012-07-241-7/+3
| | | | | Cc: Simon Guinot <sguinot@lacie.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Use devm_kzalloc in leds-gpio.c fileSachin Kamat2012-07-241-6/+5
| | | | | | | devm_kzalloc() makes cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Use devm_kzalloc in leds-max8997.c fileSachin Kamat2012-07-241-15/+6
| | | | | | | devm_kzalloc() makes code cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Use devm_kzalloc in leds-regulator.c fileSachin Kamat2012-07-241-6/+3
| | | | | | | devm_kzalloc() makes cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Use devm_kzalloc in leds-pwm.c fileSachin Kamat2012-07-241-5/+2
| | | | | | | devm_kzalloc() makes cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Use module_platform_driver() in leds-max8997.c fileSachin Kamat2012-07-241-11/+1
| | | | | | | module_platform_driver() makes the code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: convert tca6507 driver to module_i2c_driver()Peter Meerwald2012-07-241-12/+1
| | | | | | Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com> Cc: NeilBrown <neilb@suse.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Convert S3C24XX LED driver to gpiolib APISylwester Nawrocki2012-07-241-14/+20
| | | | | | | | | | | | | | | | The s3c2410_gpio* calls are obsolete and have been scheduled for removal since several kernel releases. Remove them and use common gpiolib API instead. This patch also adds gpio_request/gpio_free call for API corectness. It is a prerequisite for removal of the S3C24XX SoC specific arch/arm/plat-samsung/include/gpio-fns.h header. Tested on Micro2440-SDK. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Convert S3C24XX LED driver to devm_kzalloc()Sylwester Nawrocki2012-07-241-5/+3
| | | | | | | | | Use the device managed resource API for simplifying the error/driver remove paths. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds-mc13783: set platform data to NULL at mc13783_led_removeDevendra Naga2012-07-241-0/+1
| | | | | | | | the platform_set_drvdata (pdev, NULL) to be set at the remove of the driver, as we have set the platform data to led at probe. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds-88pm860x: use devm_kzalloc functionDevendra Naga2012-07-241-7/+2
| | | | | | | Using devm_kzalloc will remove all the error checks and the frees are automatically done at the driver unload side. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds-lp5523: BUG() in error handling in probe()Dan Carpenter2012-07-241-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>
* leds: Add LED driver for lm3556 chipG.Shark Jeong2012-07-243-0/+521
| | | | | | | | | | | | | | | | | | | LM3556 : The LM3556 is a 4 MHz fixed-frequency synchronous boost converter plus 1.5A constant current driver for a high-current white LED. Datasheet: www.national.com/ds/LM/LM3556.pdf Tested on OMAP4430 (bryan.wu@canonical.com: use module_i2c_driver() rather than lm3556_init/lm3556_exit for code simplicity; fixed some typo pointed out by Rob Landley) Signed-off-by: G.Shark Jeong <gshark.jeong@gmail.com> Reviewed-by: Axel Lin <axel.lin@gmail.com> Reviewed-by: Kim, Milo <Milo.Kim@ti.com> Acked-by: Rob Landley <rob@landley.net> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: [trivial]Remove unnecesary returnDevendra Naga2012-07-241-2/+1
| | | | | | | | | | | the ret is got the status returned by the led_classdev_register, returning ret if the led_classdev_register fails and returning 0 if the led_classdev_register success, can be done by doing just "return ret" at the end. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: fix sparse warnings due to missing staticBryan Wu2012-07-242-2/+2
| | | | | | | | drivers/leds/led-core.c:56:6: sparse: symbol 'led_blink_setup' was not declared. Should it be static? drivers/leds/led-triggers.c:233:6: sparse: symbol 'led_trigger_blink_setup' was not declared. Should it be static? Reported-by: Fengguang Wu <wfg@linux.intel.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: correct trivial type in drivers/leds/KconfigJesper Dangaard Brouer2012-07-241-1/+1
| | | | | | | Correct "hadrware" to "hardware", for LEDS_TRIGGER_TRANSIENT. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: use led_set_brightness in led_trigger_eventFabio Baltieri2012-07-241-1/+1
| | | | | | | | | | | | | | | | Fix led_trigger_event() to use led_set_brightness() instead of __led_set_brightness(), so that any pending blink timer is stopped before setting the new brightness value. Without this fix LED status may be overridden by a pending timer. This allows a trigger to use a mix of led_trigger_event(), led_trigger_blink() and led_trigger_blink_oneshot() without races. (applied over: leds: Rename led_brightness_set() to led_set_brightness()) Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Cc: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Rename led_brightness_set() to led_set_brightness()Shuah Khan2012-07-245-6/+6
| | | | | | | | | | | | Rename leds external interface led_brightness_set() to led_set_brightness(). This is the second phase of the change to reduce confusion between the leds internal and external interfaces that set brightness. With this change, now the external interface is led_set_brightness(). The first phase renamed the internal interface led_set_brightness() to __led_set_brightness(). There are no changes to the interface implementations. Signed-off-by: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: Rename led_set_brightness() to __led_set_brightness()Shuah Khan2012-07-2410-22/+22
| | | | | | | | | | Rename leds internal interface led_set_brightness() to __led_set_brightness() to reduce confusion between led_set_brightness() and the external interface led_brightness_set(). led_brightness_set() cancels the timer and then calls led_set_brightness(). Signed-off-by: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: add oneshot triggerFabio Baltieri2012-07-243-0/+219
| | | | | | | | | Add oneshot trigger to blink a led with configurale parameters via sysfs. Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Cc: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: fix led_brightness_set when soft-blinkingFabio Baltieri2012-07-241-9/+6
| | | | | | | | | | | | | | | | | | | Move led_stop_software_blink() code into led_brightness_set() to ensure software blink timer is stopped and cleared when changing trigger. Also use led_set_brightness() instead of calling led_cdev->brightness_set() directly to keep led_cdev->brightness consistent with current LED status. This ensure proper cleaning when changing triggers, as without this fix a LED may be turned off while leaving it's led_cdev->brightness = 1, leading to an erratic software-blink behaviour. The problem was easy to reproduce by changing the trigger from "timer" to "oneshot". Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* ledtrig-ide-disk: use generic one-shot blink apiFabio Baltieri2012-07-241-21/+4
| | | | | | | | | | | | | | Convert ledtrig-ide-disk code to use the generic API for one-shot LED blinking. This patch changes slightly the behaviour of the trigger, as while the original version kept the LED on under heavy activity, the new one keeps a constant on-off blink at 1 / (2 * BLINK_DELAY) Hz. (bryan.wu@canonical.com: remove 2 useless included header files) Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* leds: add oneshot blink functionsFabio Baltieri2012-07-243-11/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new functions, led_blink_set_oneshot and led_trigger_blink_oneshot, to be used by triggers for one-shot blink of led devices. This is implemented extending the existing software-blink code, and uses the same timer and handler function. The behavior of the code is to do a blink-on, blink-off sequence when the function is called, ignoring other calls until the sequence is completed so that the leds keep blinking at constant rate if the functions are called repeatedly. This is meant to be used by drivers which needs to trigger on sporadic event, but doesn't have clear busy/idle trigger points. After the blink sequence the led remains off. This behavior can be inverted setting the "invert" argument, which blink the led off, than on and leave the led on after the sequence. (bryan.wu@canonical.com: rebase to commit 'leds: don't disable blinking when writing the same value to delay_on or delay_off') Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Acked-by: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
* led-triggers: rename *trigger to *trig for unified naming schemeBryan Wu2012-07-241-42/+42
| | | | | | No functional change. Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
OpenPOWER on IntegriCloud