summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lm355x.c
AgeCommit message (Collapse)Author
2020-12-30leds: Use DEVICE_ATTR_{RW, RO, WO} macrosDwaipayan Ray
Instead of open coding DEVICE_ATTR() defines, use the DEVICE_ATTR_RW(), DEVICE_ATTR_WO(), and DEVICE_ATTR_RO() macros. This required a few functions to be renamed, but the functionality itself is unchanged. Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2020-06-22leds: drop redundant struct-device pointer castsJohan Hovold
Drop the pointless and needlessly confusing casts of struct-device pointers. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2020-06-22leds: lm355x: avoid enum conversion warningArnd Bergmann
clang points out that doing arithmetic between diffent enums is usually a mistake: drivers/leds/leds-lm355x.c:167:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion] reg_val = pdata->pin_tx2 | pdata->ntc_pin; ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ drivers/leds/leds-lm355x.c:178:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion] reg_val = pdata->pin_tx2 | pdata->ntc_pin | pdata->pass_mode; ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ In this driver, it is intentional, so add a cast to hide the false-positive warning. It appears to be the only instance of this warning at the moment. Fixes: b98d13c72592 ("leds: Add new LED driver for lm355x chips") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2020-04-17leds: lm355x: Drop surplus includeLinus Walleij
This driver includes <linux/gpio.h> but does not use any symbols from that file, so drop the include. Cc: G.Shark Jeong <gshark.jeong@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-04leds: lm355x: Remove work queueJacek Anaszewski
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: G.Shark Jeong <gshark.jeong@gmail.com>
2015-08-28leds: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2014-06-25leds: lm355x: fix attribute-creation raceJohan Hovold
Use the attribute groups of the led-class to create the indicator-LED attributes during probe in order to avoid racing with userspace. Note that the comment about the pattern attribute only being for LM3554 was incorrect and did not match the code (the original leds-lm3556 driver had the attribute before LM3554 support was added). Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-08-26leds: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-04-01leds: lm355x, lm3642: support camera LED triggers for flash and torchKim, Milo
LM355x and LM3642 support flash and torch functionality. (Camera driver) (LED trigger for camera) (LED driver) Turn on the flash ...> ledtrig_flash_ctrl(true) ...> LM355x or LM3642 brightness ctrl <actual driving here> Flash/torch LEDs are controlled by other driver using LED camera trigger APIs, ledtrig_flash_ctrl()/ledtrig_torch_ctrl(). Then, actual device control is activated by each LED driver such like LM355x or LM3642. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-02-01leds: lm355x: rename devAttr to avoid CamelCaseJingoo Han
Fixed the checkpatch warning as below: WARNING: Avoid CamelCase: <devAttr> Rename devAttr to attr. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-12-15Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds Pull LED subsystem update from Bryan Wu. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (47 commits) leds: leds-lp5521: return an error code on error in probe() leds: leds-clevo-mail: Use pr_* instead of printks leds: leds-rb532: Fix checkpatch errors leds: led-triggers: Fix checkpatch warnings leds: ledtrig-backlight: Fix checkpatch error leds: leds-wrap: Use <linux/io.h> instead of <asm/io.h> leds: leds-wm8350: Use dev_err instead of printk leds: leds-pwm: Fix checkpatch warning leds: leds-pca955x: Use dev_info instead of printk leds: leds-net48xx: Use linux/io.h instead of asm/io.h leds: leds-lt3593: Fix checkpatch warnings leds: leds-gpio: Use dev_info instead of printk leds: leds-da903x: Fix checkpatch error and warnings leds: leds-bd2802: Fix checkpatch warnings leds: leds-adp5520: Fix checkpatch warnings leds: led-class: Fix checkpatch warning leds: leds-ns2: use devm_gpio_request_one leds: leds-lt3593: use devm_gpio_request_one leds: leds-gpio: use devm_gpio_request_one leds: lp3944: Fix return value ...
2012-11-28leds: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28leds: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28leds: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26leds: lm355x: Fix up world writable sysfs fileAxel Lin
We don't need the sysfs file to be world writable or group writable. This file is write-only, change it to S_IWUSR (0200). Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: G.Shark Jeong <gshark.jeong@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-11-26leds: lm355x: Return proper error for lm3556_indicator_pattern_store error pathAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: G.Shark Jeong <gshark.jeong@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-09-11leds: Add new LED driver for lm355x chipsG.Shark Jeong
This driver is a general version for LM355x,lm3554 and lm3556,led chips of TI. LM3554 : The LM3554 is a 2 MHz fixed-frequency synchronous boost converter with 1.2A dual high side led drivers. Datasheet: www.ti.com/lit/ds/symlink/lm3554.pdf 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 (bryan.wu@canonical.com: use flush_work() to replace flush_work_sync() which is deprecated) Signed-off-by: G.Shark Jeong <gshark.jeong@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>