summaryrefslogtreecommitdiffstats
path: root/drivers/leds
Commit message (Collapse)AuthorAgeFilesLines
...
| * leds: lm36274: Put fwnode in error case during ->probe()Andy Shevchenko2021-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. In the older code the same is implied with device_for_each_child_node(). Fixes: 11e1bbc116a7 ("leds: lm36274: Introduce the TI LM36274 LED driver") Fixes: a448fcf19c9c ("leds: lm36274: don't iterate through children since there is only one") Cc: Dan Murphy <dmurphy@ti.com> Cc: Marek Behún <marek.behun@nic.cz> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lm3532: Make error handling more robustAndy Shevchenko2021-05-281-5/+2
| | | | | | | | | | | | | | | | | | It's easy to miss necessary clean up, e.g. firmware node reference counting, during error path in ->probe(). Make it more robust by moving to a single point of return. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lm3532: select regmap I2C APIAndy Shevchenko2021-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | Regmap APIs should be selected, otherwise link can fail ERROR: modpost: "__devm_regmap_init_i2c" [drivers/leds/leds-lm3532.ko] undefined! Fixes: bc1b8492c764 ("leds: lm3532: Introduce the lm3532 LED driver") Cc: Dan Murphy <dmurphy@ti.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm-sso: Drop duplicate NULL check for GPIO operationsAndy Shevchenko2021-05-281-1/+1
| | | | | | | | | | | | | | | | Since GPIO operations are NULL-aware, we don't need to duplicate this check. Remove it and fold the rest of the code. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm-sso: Remove unneeded of_match_ptr()Andy Shevchenko2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | LGM SSO is an OF dependent driver, so of_match_ptr() can be safely removed. Remove the unneeded of_match_ptr(). Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm-sso: Fix clock handlingAndy Shevchenko2021-05-281-27/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock handling has a few issues: - when getting second clock fails, the first one left prepared and enabled - on ->remove() clocks are unprepared and disabled twice Fix all these by converting to use bulk clock operations since both clocks are mandatory. Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Cc: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: el15203000: Introduce to_el15203000_led() helperAndy Shevchenko2021-05-281-13/+7
| | | | | | | | | | | | | | | | | | Introduce a helper to replace open coded container_of() calls. At the same time move ldev member to be first in the struct el15203000_led, that makes container_of() effectivelly a no-op. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: class: The -ENOTSUPP should never be seen by user spaceAndy Shevchenko2021-05-281-4/+0
| | | | | | | | | | | | | | | | | | | | Drop the bogus error code and let of_led_get() to take care about absent of_node. Fixes: e389240ad992 ("leds: Add managed API to get a LED from a device driver") Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-mlxcpld: Fix a bunch of kernel-doc formatting issuesLee Jones2021-05-281-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-mlxcpld.c:72: warning: cannot understand function prototype: 'struct mlxcpld_param ' drivers/leds/leds-mlxcpld.c:83: warning: cannot understand function prototype: 'struct mlxcpld_led_priv ' drivers/leds/leds-mlxcpld.c:98: warning: cannot understand function prototype: 'struct mlxcpld_led_profile ' drivers/leds/leds-mlxcpld.c:114: warning: cannot understand function prototype: 'struct mlxcpld_led_pdata ' Cc: Vadim Pasternak <vadimp@nvidia.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-lp8860: Fix kernel-doc related formatting issuesLee Jones2021-05-281-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'lock' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'client' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'led_dev' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'regmap' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'eeprom_regmap' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'enable_gpio' not described in 'lp8860_led' drivers/leds/leds-lp8860.c:105: warning: Function parameter or member 'regulator' not described in 'lp8860_led' Cc: Pavel Machek <pavel@ucw.cz> Cc: Dan Murphy <dmurphy@ti.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-mlxreg: Fix incorrect documentation of struct member 'led_cdev' ↵Lee Jones2021-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and 'led_cdev_name' Fixes the following W=1 kernel build warning(s): drivers/leds/leds-mlxreg.c:42: warning: Function parameter or member 'led_cdev' not described in 'mlxreg_led_data' drivers/leds/leds-mlxreg.c:42: warning: Function parameter or member 'led_cdev_name' not described in 'mlxreg_led_data' Cc: Vadim Pasternak <vadimp@nvidia.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-lm3697: Provide some missing descriptions for struct membersLee Jones2021-05-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-lm3697.c:60: warning: Function parameter or member 'enabled' not described in 'lm3697_led' drivers/leds/leds-lm3697.c:60: warning: Function parameter or member 'num_leds' not described in 'lm3697_led' drivers/leds/leds-lm3697.c:84: warning: Function parameter or member 'bank_cfg' not described in 'lm3697' drivers/leds/leds-lm3697.c:84: warning: Function parameter or member 'num_banks' not described in 'lm3697' Cc: Pavel Machek <pavel@ucw.cz> Cc: Dan Murphy <dmurphy@ti.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-lm3692x: Fix some kernel-doc formatting issuesLee Jones2021-05-281-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'lock' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'client' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'led_dev' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'regmap' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'enable_gpio' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'regulator' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'led_enable' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'model_id' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'boost_ctrl' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'brightness_ctrl' not described in 'lm3692x_led' drivers/leds/leds-lm3692x.c:121: warning: Function parameter or member 'enabled' not described in 'lm3692x_led' Cc: Pavel Machek <pavel@ucw.cz> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Dan Murphy <dmurphy@ti.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-lm3530: Fix incorrect spelling of 'brightness'Lee Jones2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-lm3530.c:113: warning: Function parameter or member 'brightness' not described in 'lm3530_data' Cc: Pavel Machek <pavel@ucw.cz> Cc: Kumar SAHU <shreshthakumar.sahu@stericsson.com> Cc: Dan Murphy <D.Murphy@motorola.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-lp3944: Provide missing function names in documentation headersLee Jones2021-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-lp3944.c:95: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/leds/leds-lp3944.c:126: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/leds/leds-lp3944.c:158: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Pavel Machek <pavel@ucw.cz> Cc: Antonio Ospite <ospite@studenti.unina.it> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-is31fl32xx: Provide missing description for member 'sw_shutdown_func'Lee Jones2021-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-is31fl32xx.c:85: warning: Function parameter or member 'sw_shutdown_func' not described in 'is31fl32xx_chipdef' Cc: Pavel Machek <pavel@ucw.cz> Cc: David Rivshin <drivshin@allworx.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-blinkm: Remove unused variable 'ret'Lee Jones2021-05-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function returns void anyway. Fixes the following W=1 kernel build warning(s): drivers/leds/leds-blinkm.c: In function ‘blinkm_init_hw’: drivers/leds/leds-blinkm.c:483:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: "Jan-Simon Möller" <dl9pf@gmx.de> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-as3645a: Fix function name 'as3645a_set_current()'Lee Jones2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-as3645a.c:198: warning: expecting prototype for as3645a_set_config(). Prototype was for as3645a_set_current() instead Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-bcm6328: Demote kernel-doc abuseLee Jones2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-bcm6328.c:97: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Pavel Machek <pavel@ucw.cz> Cc: "Fernández Rojas" <noltari@gmail.com> Cc: Jonas Gorski <jogo@openwrt.org> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: led-class: Fix incorrectly documented param 'dev'Lee Jones2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/led-class.c:521: warning: Function parameter or member 'dev' not described in 'devm_led_classdev_unregister' drivers/leds/led-class.c:521: warning: Excess function parameter 'parent' description in 'devm_led_classdev_unregister' Cc: Pavel Machek <pavel@ucw.cz> Cc: John Lenz <lenz@cs.wisc.edu> Cc: Richard Purdie <rpurdie@openedhand.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: leds-gpio-register: Supply description for param 'id'Lee Jones2021-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/leds-gpio-register.c:24: warning: Function parameter or member 'id' not described in 'gpio_led_register_device' Cc: Pavel Machek <pavel@ucw.cz> Cc: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: trigger: ledtrig-cpu: Fix incorrectly documented param 'ledevt'Lee Jones2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/leds/trigger/ledtrig-cpu.c:52: warning: Function parameter or member 'ledevt' not described in 'ledtrig_cpu' drivers/leds/trigger/ledtrig-cpu.c:52: warning: Excess function parameter 'evt' description in 'ledtrig_cpu' Cc: Pavel Machek <pavel@ucw.cz> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bryan Wu <bryan.wu@canonical.com> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: tlc591xx: fix return value check in tlc591xx_probe()Yang Yingliang2021-05-101-2/+6
| | | | | | | | | | | | | | | | | | After device_get_match_data(), tlc591xx is not checked, add check for it and also check np after dev_of_node. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* | kernel.h: split out panic and oops helpersAndy Shevchenko2021-07-013-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel.h is being used as a dump for all kinds of stuff for a long time. Here is the attempt to start cleaning it up by splitting out panic and oops helpers. There are several purposes of doing this: - dropping dependency in bug.h - dropping a loop by moving out panic_notifier.h - unload kernel.h from something which has its own domain At the same time convert users tree-wide to use new headers, although for the time being include new header back to kernel.h to avoid twisted indirected includes for existing users. [akpm@linux-foundation.org: thread_info.h needs limits.h] [andriy.shevchenko@linux.intel.com: ia64 fix] Link: https://lkml.kernel.org/r/20210520130557.55277-1-andriy.shevchenko@linux.intel.com Link: https://lkml.kernel.org/r/20210511074137.33666-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Co-developed-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Corey Minyard <cminyard@mvista.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kees Cook <keescook@chromium.org> Acked-by: Wei Liu <wei.liu@kernel.org> Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Sebastian Reichel <sre@kernel.org> Acked-by: Luis Chamberlain <mcgrof@kernel.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Helge Deller <deller@gmx.de> # parisc Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | leds: lp5523: check return value of lp5xx_read and jump to cleanup codePhillip Potter2021-05-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Check return value of lp5xx_read and if non-zero, jump to code at end of the function, causing lp5523_stop_all_engines to be executed before returning the error value up the call chain. This fixes the original commit (248b57015f35) which was reverted due to the University of Minnesota problems. Cc: stable <stable@vger.kernel.org> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210503115736.2104747-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "leds: lp5523: fix a missing check of return value of lp55xx_read"Greg Kroah-Hartman2021-05-131-3/+1
|/ | | | | | | | | | | | | | | | | | | | | | This reverts commit 248b57015f35c94d4eae2fdd8c6febf5cd703900. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change. The original commit does not properly unwind if there is an error condition so it needs to be reverted at this point in time. Cc: Kangjie Lu <kjlu@umn.edu> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> Cc: stable <stable@vger.kernel.org> Fixes: 248b57015f35 ("leds: lp5523: fix a missing check of return value of lp55xx_read") Link: https://lore.kernel.org/r/20210503115736.2104747-9-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'leds-5.13-rc1' of ↵Linus Torvalds2021-05-0311-28/+468
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Nothing too exciting here, just some fixes" * tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: pca9532: Assign gpio base dynamically leds: trigger: pattern: Switch to using the new API kobj_to_dev() leds: LEDS_BLINK_LGM should depend on X86 leds: lgm: Fix spelling mistake "prepate" -> "prepare" MAINTAINERS: Remove Dan Murphy's bouncing email leds-lm3642: convert comma to semicolon leds: rt4505: Add support for Richtek RT4505 flash LED controller leds: rt4505: Add DT binding document for Richtek RT4505 leds: Kconfig: LEDS_CLASS is usually selected. leds: lgm: Improve Kconfig help leds: lgm: fix gpiolib dependency
| * leds: pca9532: Assign gpio base dynamicallyStefan Riedmueller2021-04-251-0/+2
| | | | | | | | | | | | | | | | | | When using devicetree, gpio_base holds its initial zero value which can lead to a rejection if another gpio controller already occupies this base. To prevent that collision let the gpio base be assigned dynamically. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: trigger: pattern: Switch to using the new API kobj_to_dev()Tian Tao2021-04-251-1/+1
| | | | | | | | | | | | | | | | | | Switch to using the new API kobj_to_dev() to fix the below warnning: ./drivers/leds/trigger/ledtrig-pattern.c:336:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: LEDS_BLINK_LGM should depend on X86Geert Uytterhoeven2021-04-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | The Intel Lightning Mountain (LGM) Serial Shift Output controller (SSO) is only present on Intel Lightning Mountain SoCs. Hence add a dependency on X86, to prevent asking the user about this driver when configuring a kernel without Intel Lightning Mountain platform support. While at it, merge the other dependencies into a single statement. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm: Fix spelling mistake "prepate" -> "prepare"Colin Ian King2021-04-251-1/+1
| | | | | | | | | | | | | | There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds-lm3642: convert comma to semicolonZheng Yongjun2021-04-251-2/+2
| | | | | | | | | | | | | | Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: rt4505: Add support for Richtek RT4505 flash LED controllerChiYuan Huang2021-03-263-0/+442
| | | | | | | | | | | | | | | | | | Add support for RT4505 flash LED controller. It can support up to 1.5A flash current with hardware timeout and low input voltage protection. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: Kconfig: LEDS_CLASS is usually selected.Pavel Machek2021-03-251-1/+1
| | | | | | | | | | | | People should really say Y to the LEDS_CLASS prompt. Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm: Improve Kconfig helpRahul Tanwar2021-03-254-24/+21
| | | | | | | | | | | | | | | | Remove unnecessary Kconfig symbol LEDS_BLINK Improve Kconfig help text to make it more useful. Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm: fix gpiolib dependencyArnd Bergmann2021-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without gpiolib, the driver fails to build: drivers/leds/blink/leds-lgm-sso.c:123:19: error: field has incomplete type 'struct gpio_chip' struct gpio_chip chip; ^ include/linux/gpio.h:107:8: note: forward declaration of 'struct gpio_chip' struct gpio_chip; ^ drivers/leds/blink/leds-lgm-sso.c:263:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration] gpiod_set_value(led->gpiod, val); ^ drivers/leds/blink/leds-lgm-sso.c:263:3: note: did you mean 'gpio_set_value'? include/linux/gpio.h:168:20: note: 'gpio_set_value' declared here static inline void gpio_set_value(unsigned gpio, int value) ^ drivers/leds/blink/leds-lgm-sso.c:345:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration] gpiod_set_value(led->gpiod, 1); ^ Add the dependency in Kconfig. Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* | treewide: change my e-mail address, fix my nameMarek Behún2021-04-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change my e-mail address to kabel@kernel.org, and fix my name in non-code parts (add diacritical mark). Link: https://lkml.kernel.org/r/20210325171123.28093-2-kabel@kernel.org Signed-off-by: Marek Behún <kabel@kernel.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jassi Brar <jassisinghbrar@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | leds: trigger/tty: Use led_set_brightness_sync() from workqueueUwe Kleine-König2021-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | led_set_brightness() involves scheduling a workqueue. As here the led's brightness setting is done in context of the trigger's workqueue this is unjustified overhead and it's more sensible to use led_set_brightness_sync(). Fixes: fd4a641ac88f ("leds: trigger: implement a tty trigger") Reported-by: Pavel Machek <pavel@ucw.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20210219133307.4840-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | leds: trigger: Fix error path to not unlock the unlocked mutexUwe Kleine-König2021-03-101-5/+2
|/ | | | | | | | | | | | ttyname is allocated before the mutex is taken, so it must not be unlocked in the error path. Fixes: fd4a641ac88f ("leds: trigger: implement a tty trigger") Reported-by: Pavel Machek <pavel@ucw.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20210219133307.4840-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'leds-5.12-rc1' of ↵Linus Torvalds2021-02-2620-126/+1030
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Besides the usual fixes and new drivers, we are changing CLASS_FLASH to return success to make it easier to work with V4L2 stuff disabled, and we are getting rid of enum that should have been plain integer long time ago. I'm slightly nervous about potential warnings, but it needed to be fixed at some point" * tag 'leds-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: lp50xx: Get rid of redundant explicit casting leds: lp50xx: Update headers block to reflect reality leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() leds: lp50xx: Reduce level of dereferences leds: lp50xx: Switch to new style i2c-driver probe function leds: lp50xx: Don't spam logs when probe is deferred leds: apu: extend support for PC Engines APU1 with newer firmware leds: flash: Fix multicolor no-ops registration by return 0 leds: flash: Add flash registration with undefined CONFIG_LEDS_CLASS_FLASH leds: lgm: Add LED controller driver for LGM SoC dt-bindings: leds: Add bindings for Intel LGM SoC leds: led-core: Get rid of enum led_brightness leds: gpio: Set max brightness to 1 leds: lm3533: Switch to using the new API kobj_to_dev() leds: ss4200: simplify the return expression of register_nasgpio_led() leds: Use DEVICE_ATTR_{RW, RO, WO} macros
| * leds: lp50xx: Get rid of redundant explicit castingAndy Shevchenko2021-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In the line like u32 bar = ...; u8 foo = (u8)(bar >> 8) & 0xff; is no need to have neither explicit casting nor ' & 0xff' part. Get rid of them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lp50xx: Update headers block to reflect realityAndy Shevchenko2021-02-191-2/+1
| | | | | | | | | | | | | | | | The OF is not used in the driver, thus the OF headers are not needed, but mod_devicetable.h is missed. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable()Andy Shevchenko2021-02-191-5/+3
| | | | | | | | | | | | | | | | Since GPIO is optional the API is NULL aware and will check descriptor anyway. Remove duplicate redundant check in lp50xx_enable_disable(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lp50xx: Reduce level of dereferencesAndy Shevchenko2021-02-191-14/+12
| | | | | | | | | | | | | | | | The priv->dev is effectively the same as &priv->client->dev. So, drop the latter for the former. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lp50xx: Switch to new style i2c-driver probe functionAndy Shevchenko2021-02-191-17/+16
| | | | | | | | | | | | | | | | | | Switch to the new style i2c-driver probe_new probe function. Note we do not have any old style board files using this but user still has a possibility to instantiate device from sysfs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lp50xx: Don't spam logs when probe is deferredAndy Shevchenko2021-02-191-6/+3
| | | | | | | | | | | | | | | | | | When requesting GPIO line the probe can be deferred. In such case don't spam logs with an error message. This can be achieved by switching to dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: apu: extend support for PC Engines APU1 with newer firmwareAndreas Eberlein2021-02-191-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | The DMI_PRODUCT_NAME entry on current firmware of PC Engines APU1 changed from "APU" to "apu1" This modification adds the missing DMI data and thereby the LED support for the PC Engines APU1 with firmware versions >= 4.6.8. Signed-off-by: Andreas Eberlein <foodeas@aeberlein.de> Tested-by: Zbyněk Kocur <zbynek.kocur@fel.cvut.cz> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: lgm: Add LED controller driver for LGM SoCAmireddy Mallikarjuna reddy2021-02-195-0/+916
| | | | | | | | | | | | | | | | | | | | | | Parallel to serial conversion, which is also called SSO controller, can drive external shift register for LED outputs, reset or general purpose outputs. This driver enables LED support for Serial Shift Output Controller (SSO). Signed-off-by: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: led-core: Get rid of enum led_brightnessAbanoub Sameh2021-02-193-19/+10
| | | | | | | | | | | | | | | | | | | | | | This gets rid of enum led_brightness in the main led files, because it is deprecated, and an unsigned int can be used instead. We can get rid of led_brightness completely and patches can also be supplied for the other drivers' files. Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
| * leds: gpio: Set max brightness to 1Dylan Van Assche2021-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | GPIO LEDs only know 2 states: ON or OFF and do not have PWM capabilities. However, the max brightness is reported as 255. This patch sets the max brightness value of a GPIO controlled LED to 1. Tested on my PinePhone 1.2. Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> Signed-off-by: Pavel Machek <pavel@ucw.cz>