summaryrefslogtreecommitdiffstats
path: root/drivers/leds
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'leds-next-6.3' of ↵Linus Torvalds2023-02-2338-429/+171
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED updates from Lee Jones: "Removed Drivers: - HTC ASIC3 LED New Functionality: - Provide generic led_get() which can be used by both DT and !DT platforms Fix-ups: - Convert a bunch of I2C subsystem users to the new probing API - Explicitly provide missing include files - Make use of led_init_default_state_get() and rid the custom variants - Use simplified fwnode_device_is_compatible() API - Provide some Device Tree additions / adaptions - Fix some trivial spelling issues Bug Fixes: - Prevent device refcount leak during led_put() and of_led_get() - Clear previous data from temporary led_pwm structure before processing next child - Fix Clang's warning about incompatible function types when using devm_add_action*()" * tag 'leds-next-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (41 commits) leds: Remove ide-disk trigger dt-bindings: leds: Add disk write/read and usb-host/usb-gadget Documentation: leds: Correct spelling dt-bindings: leds: Document Bluetooth and WLAN triggers leds: Remove asic3 driver leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver leds: tca6507: Convert to use fwnode_device_is_compatible() leds: syscon: Get rid of custom led_init_default_state_get() leds: pm8058: Get rid of custom led_init_default_state_get() leds: pca955x: Get rid of custom led_init_default_state_get() leds: mt6360: Get rid of custom led_init_default_state_get() leds: mt6323: Get rid of custom led_init_default_state_get() leds: bcm6358: Get rid of custom led_init_default_state_get() leds: bcm6328: Get rid of custom led_init_default_state_get() leds: an30259a: Get rid of custom led_init_default_state_get() leds: Move led_init_default_state_get() to the global header leds: Add missing includes and forward declarations in leds.h leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest() leds: turris-omnia: Convert to i2c's .probe_new() leds: tlc591xx: Convert to i2c's .probe_new() ...
| * leds: Remove ide-disk triggerCorentin Labbe2023-02-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | No user of ide-disk remains, so remove this deprecated trigger. Only a few platforms used this and were fixed in 2016. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230131140304.626779-2-clabbe@baylibre.com
| * leds: Remove asic3 driverArnd Bergmann2023-01-303-189/+0
| | | | | | | | | | | | | | | | | | Since ASIC3 MFD driver is removed, the LED support is also obsolete. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230105134622.254560-25-arnd@kernel.org
| * leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driverHenning Schild2023-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we register a "leds-gpio" platform device for GPIO pins that do not exist we get a -EPROBE_DEFER and the probe will be tried again later. If there is no driver to provide that pin we will poll forever and also create a lot of log messages. So check if that GPIO driver is configured, if so it will come up eventually. If not, we exit our probe function early and do not even bother registering the "leds-gpio". This method was chosen over "Kconfig depends" since this way we can add support for more devices and GPIO backends more easily without "depends":ing on all GPIO backends. Fixes: a6c80bec3c93 ("leds: simatic-ipc-leds-gpio: Add GPIO version of Siemens driver") Signed-off-by: Henning Schild <henning.schild@siemens.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221007153323.1326-1-henning.schild@siemens.com
| * leds: tca6507: Convert to use fwnode_device_is_compatible()Andy Shevchenko2023-01-301-2/+1
| | | | | | | | | | | | | | | | Replace open coded fwnode_device_is_compatible() in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230119175150.77250-1-andriy.shevchenko@linux.intel.com
| * leds: syscon: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-26/+23
| | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-11-andriy.shevchenko@linux.intel.com
| * leds: pm8058: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-14/+15
| | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-10-andriy.shevchenko@linux.intel.com
| * leds: pca955x: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-20/+6
| | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-9-andriy.shevchenko@linux.intel.com
| * leds: mt6360: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-32/+6
| | | | | | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-8-andriy.shevchenko@linux.intel.com
| * leds: mt6323: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-15/+15
| | | | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-7-andriy.shevchenko@linux.intel.com
| * leds: bcm6358: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-16/+16
| | | | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-6-andriy.shevchenko@linux.intel.com
| * leds: bcm6328: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-25/+24
| | | | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-5-andriy.shevchenko@linux.intel.com
| * leds: an30259a: Get rid of custom led_init_default_state_get()Andy Shevchenko2023-01-301-17/+4
| | | | | | | | | | | | | | | | | | LED core provides a helper to parse default state from firmware node. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-4-andriy.shevchenko@linux.intel.com
| * leds: Move led_init_default_state_get() to the global headerAndy Shevchenko2023-01-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | There are users inside and outside LED framework that have implemented a local copy of led_init_default_state_get(). In order to deduplicate that, as the first step move the declaration from LED header to the global one. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230103131256.33894-3-andriy.shevchenko@linux.intel.com
| * leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()Andy Shevchenko2023-01-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang complains that devm_add_action() takes a parameter with a wrong type: warning: cast from 'void (*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict] err = devm_add_action(dev, (void (*)(void *))mutex_destroy, &is31->lock); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. It appears that the commit e1af5c815586 ("leds: is31fl319x: Fix devm vs. non-devm ordering") missed two things: - whilst the commit mentions devm_add_action_or_reset() the actual change utilised devm_add_action() call by mistake - strictly speaking the parameter is not compatible by type Fix both issues by switching to devm_add_action_or_reset() and adding a wrapper for mutex_destroy() call. Reported-by: kernel test robot <lkp@intel.com> Fixes: e1af5c815586 ("leds: is31fl319x: Fix devm vs. non-devm ordering") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Vincent Knecht <vincent.knecht@mailoo.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221228093238.82713-1-andriy.shevchenko@linux.intel.com
| * leds: turris-omnia: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-289-uwe@kleine-koenig.org
| * leds: tlc591xx: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-288-uwe@kleine-koenig.org
| * leds: tca6507: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-287-uwe@kleine-koenig.org
| * leds: pca963x: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-286-uwe@kleine-koenig.org
| * leds: pca9532: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-5/+4
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-285-uwe@kleine-koenig.org
| * leds: lp8860: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-284-uwe@kleine-koenig.org
| * leds: lp8501: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-283-uwe@kleine-koenig.org
| * leds: lp5562: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-282-uwe@kleine-koenig.org
| * leds: lp5523: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-281-uwe@kleine-koenig.org
| * leds: lp5521: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-280-uwe@kleine-koenig.org
| * leds: lp3952: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-279-uwe@kleine-koenig.org
| * leds: lp3944: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-278-uwe@kleine-koenig.org
| * leds: lm3697: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-277-uwe@kleine-koenig.org
| * leds: lm3692x: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-276-uwe@kleine-koenig.org
| * leds: lm3642: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-275-uwe@kleine-koenig.org
| * leds: lm355x: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+3
| | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-274-uwe@kleine-koenig.org
| * leds: lm3532: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-273-uwe@kleine-koenig.org
| * leds: lm3530: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-272-uwe@kleine-koenig.org
| * leds: is31fl32xx: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-271-uwe@kleine-koenig.org
| * leds: blinkm: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-270-uwe@kleine-koenig.org
| * leds: bd2802: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-269-uwe@kleine-koenig.org
| * leds: led-core: Fix refcount leak in of_led_get()Miaoqian Lin2023-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | class_find_device_by_of_node() calls class_find_device(), it will take the reference, use the put_device() to drop the reference when not need anymore. Fixes: 699a8c7c4bd3 ("leds: Add of_led_get() and led_put()") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221220121807.1543790-1-linmq006@gmail.com
| * leds: pwm: Clear the led structure before parsing each child nodeHui Wang2023-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I defined 2 leds in the device tree, in the 1st led node, the max-brightness is set to 248, while in the 2nd led node, I mis-spelled the max-brightness to max-brighttness, but the driver is still able to get the max-brightness 248 for the 2nd node, that is because the led structure is not cleared before parsing each child node. pwmleds { compatible = "pwm-leds"; pwm-green { ... max-brightness = <248>; }; pwm-red { ... max-brighttness = <128>; }; Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221220073335.393489-1-hui.wang@canonical.com
* | Merge tag 'platform-drivers-x86-v6.3-1' of ↵Linus Torvalds2023-02-211-20/+118
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: - AMD PMC: Improvements to aid s2idle debugging - Dell WMI-DDV: hwmon support - INT3472 camera sensor power-management: Improve privacy LED support - Intel VSEC: Base TPMI (Topology Aware Register and PM Capsule Interface) support - Mellanox: SN5600 and Nvidia L1 switch support - Microsoft Surface Support: Various cleanups + code improvements - tools/intel-speed-select: Various improvements - Miscellaneous other cleanups / fixes * tag 'platform-drivers-x86-v6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (80 commits) platform/x86: nvidia-wmi-ec-backlight: Add force module parameter platform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY platform/x86: dell-ddv: Prefer asynchronous probing platform/x86: dell-ddv: Add hwmon support Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform: mellanox: mlx-platform: Move bus shift assignment out of the loop platform: mellanox: mlx-platform: Add mux selection register to regmap platform_data/mlxreg: Add field with mapped resource address platform/mellanox: mlxreg-hotplug: Allow more flexible hotplug events configuration platform: mellanox: Extend all systems with I2C notification callback platform: mellanox: Split logic in init and exit flow platform: mellanox: Split initialization procedure platform: mellanox: Introduce support of new Nvidia L1 switch platform: mellanox: Introduce support for next-generation 800GB/s switch platform: mellanox: Cosmetic changes - rename to more common name platform: mellanox: Change "reset_pwr_converter_fail" attribute platform: mellanox: Introduce support for rack manager switch MAINTAINERS: dell-wmi-sysman: drop Divya Bharathi x86/platform/uv: Make kobj_type structure constant platform/x86: think-lmi: Make kobj_type structure constant ...
| * leds: led-class: Add generic [devm_]led_get()Hans de Goede2023-01-271-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a generic [devm_]led_get() method which can be used on both devicetree and non devicetree platforms to get a LED classdev associated with a specific function on a specific device, e.g. the privacy LED associated with a specific camera sensor. Note unlike of_led_get() this takes a string describing the function rather then an index. This is done because e.g. camera sensors might have a privacy LED, or a flash LED, or both and using an index approach leaves it unclear what the function of index 0 is if there is only 1 LED. This uses a lookup-table mechanism for non devicetree platforms. This allows the platform code to map specific LED class_dev-s to a specific device,function combinations this way. For devicetree platforms getting the LED by function-name could be made to work using the standard devicetree pattern of adding a -names string array to map names to the indexes. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230120114524.408368-5-hdegoede@redhat.com
| * leds: led-class: Add __devm_led_get() helperHans de Goede2023-01-271-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a __devm_led_get() helper which registers a passed in led_classdev with devm for unregistration. This is a preparation patch for adding a generic (non devicetree specific) devm_led_get() function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230120114524.408368-4-hdegoede@redhat.com
| * leds: led-class: Add led_module_get() helperHans de Goede2023-01-271-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out part of of_led_get() into a generic led_module_get() helper function. This is a preparation patch for adding a generic (non devicetree specific) led_get() function. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230120114524.408368-3-hdegoede@redhat.com
| * leds: led-class: Add missing put_device() to led_put()Hans de Goede2023-01-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | led_put() is used to "undo" a successful of_led_get() call, of_led_get() uses class_find_device_by_of_node() which returns a reference to the device which must be free-ed with put_device() when the caller is done with it. Add a put_device() call to led_put() to free the reference returned by class_find_device_by_of_node(). And also add a put_device() in the error-exit case of try_module_get() failing. Fixes: 699a8c7c4bd3 ("leds: Add of_led_get() and led_put()") Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230120114524.408368-2-hdegoede@redhat.com
* | leds: remove s3c24xx driverArnd Bergmann2023-01-163-92/+0
|/ | | | | | | | The s3c24xx platform is gone, so the led driver can be removed as well. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* treewide: Convert del_timer*() to timer_shutdown*()Steven Rostedt (Google)2022-12-254-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to several bugs caused by timers being re-armed after they are shutdown and just before they are freed, a new state of timers was added called "shutdown". After a timer is set to this state, then it can no longer be re-armed. The following script was run to find all the trivial locations where del_timer() or del_timer_sync() is called in the same function that the object holding the timer is freed. It also ignores any locations where the timer->function is modified between the del_timer*() and the free(), as that is not considered a "trivial" case. This was created by using a coccinelle script and the following commands: $ cat timer.cocci @@ expression ptr, slab; identifier timer, rfield; @@ ( - del_timer(&ptr->timer); + timer_shutdown(&ptr->timer); | - del_timer_sync(&ptr->timer); + timer_shutdown_sync(&ptr->timer); ) ... when strict when != ptr->timer ( kfree_rcu(ptr, rfield); | kmem_cache_free(slab, ptr); | kfree(ptr); ) $ spatch timer.cocci . > /tmp/t.patch $ patch -p1 < /tmp/t.patch Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/ Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ] Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ] Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge tag 'pwm/for-6.2-rc1' of ↵Linus Torvalds2022-12-211-6/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "Various changes across the board, mostly improvements and cleanups" * tag 'pwm/for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (42 commits) pwm: pca9685: Convert to i2c's .probe_new() pwm: sun4i: Propagate errors in .get_state() to the caller pwm: Handle .get_state() failures pwm: sprd: Propagate errors in .get_state() to the caller pwm: rockchip: Propagate errors in .get_state() to the caller pwm: mtk-disp: Propagate errors in .get_state() to the caller pwm: imx27: Propagate errors in .get_state() to the caller pwm: cros-ec: Propagate errors in .get_state() to the caller pwm: crc: Propagate errors in .get_state() to the caller leds: qcom-lpg: Propagate errors in .get_state() to the caller drm/bridge: ti-sn65dsi86: Propagate errors in .get_state() to the caller pwm/tracing: Also record trace events for failed API calls pwm: Make .get_state() callback return an error code pwm: pxa: Enable for MMP platform pwm: pxa: Add reference manual link and limitations pwm: pxa: Use abrupt shutdown mode pwm: pxa: Remove clk enable/disable from pxa_pwm_config pwm: pxa: Set duty cycle to 0 when disabling PWM pwm: pxa: Remove pxa_pwm_enable/disable pwm: mediatek: Add support for MT7986 ...
| * leds: qcom-lpg: Propagate errors in .get_state() to the callerUwe Kleine-König2022-12-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | .get_state() can return an error indication. Make use of it to propagate failing hardware accesses. Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20221130152148.2769768-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
| * pwm: Make .get_state() callback return an error codeUwe Kleine-König2022-12-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .get_state() might fail in some cases. To make it possible that a driver signals such a failure change the prototype of .get_state() to return an error code. This patch was created using coccinelle and the following semantic patch: @p1@ identifier getstatefunc; identifier driver; @@ struct pwm_ops driver = { ..., .get_state = getstatefunc ,... }; @p2@ identifier p1.getstatefunc; identifier chip, pwm, state; @@ -void +int getstatefunc(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) { ... - return; + return 0; ... } plus the actual change of the prototype in include/linux/pwm.h (plus some manual fixing of indentions and empty lines). So for now all drivers return success unconditionally. They are adapted in the following patches to make the changes easier reviewable. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Acked-by: Douglas Anderson <dianders@chromium.org> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20221130152148.2769768-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
* | Merge tag 'leds-6.2-rc1' of ↵Linus Torvalds2022-12-1710-48/+44
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Lee Jones offered his help with maintaining LEDs, thanks a lot. Plus, there are some bugfixes as a bonus" * tag 'leds-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: MAINTAINERS: include dt-bindings headers leds: qcom,pm8058-led: Convert to DT schema leds: use sysfs_emit() to instead of scnprintf() leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3} MAINTAINERS: Add additional co-maintainer to LEDs leds: lp5523: fix out-of-bounds bug in lp5523_selftest() dt-bindings: leds: Add 'cpuX' to 'linux,default-trigger' led: qcom-lpg: Fix sleeping in atomic leds: max8997: Don't error if there is no pdata leds: lp55xx: remove variable j leds-pca955x: Remove the unused function pca95xx_num_led_regs()
| * | leds: use sysfs_emit() to instead of scnprintf()ye xingchen2022-12-075-14/+14
| | | | | | | | | | | | | | | | | | | | | Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Pavel Machek <pavel@ucw.cz>