Commit Graph

441 Commits

Author SHA1 Message Date
Kim, Milo 6f6365fbac leds-lp5523: change the return type of lp5523_set_mode()
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-11 18:32:41 +08:00
Kim, Milo a39b9854c7 leds-lp5523: set the brightness to 0 forcely on removing the driver
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-11 18:32:41 +08:00
Kim, Milo 94b43b6771 leds-lp5523: add channel name in the platform data
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-09-11 18:32:41 +08:00
Tobias Klauser 127aedc8ec leds: leds-gpio: Use of_get_child_count() helper
Use of_get_child_count() instead of custom implementation.

Signed-off-by: Tobias Klauser <klto@zhaw.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Tobias Klauser 59c4dce130 leds: leds-gpio: Use platform_{get,set}_drvdata
Use the wrapper functions, so we can directly pass a struct
platfrom_device.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Tobias Klauser 6ebcebddff leds: leds-gpio: use of_match_ptr()
Instead of having to define the match table to NULL if CONFIG_OF isn't
set, use the of_match_ptr() macro which will do this for us.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Fabio Baltieri d23a22a74f leds: delay led_set_brightness if stopping soft-blink
Delay execution of led_set_brightness() if need to stop soft-blink
timer.

This allows led_set_brightness to be called in hard-irq context even if
soft-blink was activated on that LED.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Axel Lin 490dcee9b4 leds: wm8350: Convert to devm_regulator_get()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Ondrej Zary ee539a9309 leds-clevo-mail: Fix Clevo M5x0V DMI strings
There are more variants of Clevo M5x0V laptops and Positivo Mobile is just one of them.
Another one is UMAX VisionBook 2400WXC. Use only generic Clevo DMI strings to match all
variants.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:40 +08:00
Ondrej Zary 96f09791ec leds-clevo-mail: add MODULE_DEVICE_TABLE
Enable autoloading of leds-clevo-mail by using MODULE_DEVICE_TABLE.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-09-11 18:32:39 +08:00
Arnd Bergmann 4a5a418462 leds: renesas: fix error handling
bfe4c041 "leds: convert Renesas TPU LED driver to devm_kzalloc() and
cleanup error exit path" introduced a possible case in which r_tpu_probe
calls iounmap on a wild pointer. This changes the one case that was
missed in the same way as the other error paths.

Without this patch, building kota2_defconfig results in:

drivers/leds/leds-renesas-tpu.c: In function 'r_tpu_probe':
drivers/leds/leds-renesas-tpu.c:246:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
drivers/leds/leds-renesas-tpu.c:308:17: warning: 'p' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-08-13 14:34:02 +08:00
Fabio Baltieri 86e99d23d0 Revert "leds: use led_set_brightness in led_trigger_event"
This reverts commit a0193cbee0.

The problem with the original commit was that it caused a warning with
the MMC trigger calling del_timer_sync from hard-irq context.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Reported-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-08-13 14:33:02 +08:00
Axel Lin 4df7309af6 leds: lp8788: Fix updating scale configuration bits
We need to do left shift (cfg->num + LP8788_ISINK_SCALE_OFFSET) bits for
updating scale configuration.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-08-08 09:49:53 +08:00
Devendra Naga d45bb11616 leds-lp8788: forgotten unlock at lp8788_led_work
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>
2012-07-27 08:16:07 +08:00
Dan Carpenter 18d4a06f9b LEDS: propagate error codes in blinkm_detect()
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>
2012-07-27 08:15:09 +08:00
Dan Carpenter 4d8729a139 LEDS: memory leak in blinkm_led_common_set()
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>
2012-07-27 08:13:58 +08:00
Kim, Milo eb80411b54 leds: add new lp8788 led driver
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>
2012-07-26 12:04:33 +08:00
Jan-Simon Möller b54cf35a7f LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS
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>
2012-07-24 16:00:51 +08:00
Axel Lin eb18618b80 leds: max8997: Simplify max8997_led_set_mode implementation
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>
2012-07-24 15:48:47 +08:00
Devendra Naga 5ecf6e40bb leds/leds-s3c24xx: use devm_gpio_request
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>
2012-07-24 07:52:40 +08:00
Bryan Wu a209f76698 leds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:40 +08:00
Bryan Wu e58603122e leds: convert DAC124S085 LED driver to devm_kzalloc()
Cc: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:40 +08:00
Bryan Wu 0b873f3d50 leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path
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>
2012-07-24 07:52:40 +08:00
Bryan Wu 6770fc60c4 leds: convert TCA6507 LED driver to devm_kzalloc()
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu a44cdd2c1a leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Philippe Retornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu bcbf01624f leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 73759f6ab3 leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path
Cc: Nate Case <ncase@xes-inc.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 234699a8f3 leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 0f4630c90b leds: convert PCA9532 LED driver to devm_kzalloc()
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 0a8d9d4a61 leds: convert LT3593 LED driver to devm_kzalloc()
Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu bfe4c04193 leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu 94ca4bccac leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Mathias Nyman <mathias.nyman@nokia.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu 983ce8840c leds: convert PCA9633 LED driver to devm_kzalloc()
Cc: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu ac63ff50ad leds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit path
Cc: Kim Kyuwon <q1.kim@samsung.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu e430dc003f leds: convert LP5521 LED driver to devm_kzalloc() and cleanup error exit path
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu bad1c898e8 leds: convert DA9030/DA9034 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Eric Miao <eric.miao@canonical.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 9813d74fa5 leds: convert LP3944 LED driver to devm_kzalloc()
Cc: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 4aad381f0d leds: convert Atmel PWM LED driver to devm_kzalloc()
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 60a0aadbf8 leds: convert HTC ASIC3 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 8095c385aa leds: convert Big Networks LED driver to devm_kzalloc()
Cc: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Sachin Kamat 198b861131 leds: Use devm_kzalloc in leds-gpio.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 7f13bbf799 leds: Use devm_kzalloc in leds-max8997.c file
devm_kzalloc() makes code cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat d41589658e leds: Use devm_kzalloc in leds-regulator.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 0b7da746cc leds: Use devm_kzalloc in leds-pwm.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 7fafefb86e leds: Use module_platform_driver() in leds-max8997.c file
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>
2012-07-24 07:52:36 +08:00
Peter Meerwald 2e9117672d leds: convert tca6507 driver to module_i2c_driver()
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sylwester Nawrocki 7d84f66f22 leds: Convert S3C24XX LED driver to gpiolib API
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>
2012-07-24 07:52:36 +08:00
Sylwester Nawrocki 7e97b58133 leds: Convert S3C24XX LED driver to devm_kzalloc()
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>
2012-07-24 07:52:36 +08:00
Devendra Naga 317dfb148d leds-mc13783: set platform data to NULL at mc13783_led_remove
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>
2012-07-24 07:52:35 +08:00
Devendra Naga b523cfe61b leds-88pm860x: use devm_kzalloc function
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>
2012-07-24 07:52:35 +08:00