linux-stable/drivers/leds
Johan Adolfsson a8c0dc453e leds: leds-lp50xx: Handle reg to get correct multi_index
[ Upstream commit 2e84a5e537 ]

mc_subled used for multi_index needs well defined array indexes,
to guarantee the desired result, use reg for that.

If devicetree child nodes is processed in random or reverse order
you may end up with multi_index "blue green red" instead of the expected
"red green blue".
If user space apps uses multi_index to deduce how to control the leds
they would most likely be broken without this patch if devicetree
processing is reversed (which it appears to be).

arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts has reg set
but I don't see how it can have worked without this change.

If reg is not set, an error is returned,
If reg is out of range, an error is returned.
reg within led child nodes starts with 0, to map to the iout in each bank.

Signed-off-by: Johan Adolfsson <johan.adolfsson@axis.com>
Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Link: https://lore.kernel.org/r/20250617-led-fix-v7-1-cdbe8efc88fa@axis.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:24:23 +02:00
..
blink
flash leds: sgm3140: Add missing timer cleanup and flash gpio control 2024-03-26 18:21:31 -04:00
trigger leds: triggers: Flush pending brightness before activating trigger 2024-08-19 05:45:29 +02:00
Kconfig
led-class-flash.c
led-class-multicolor.c leds: multicolor: Fix intensity setting while SW blinking 2025-07-10 15:57:32 +02:00
led-class.c leds: class: Protect brightness_show() with led_cdev->led_access mutex 2024-12-14 19:51:41 +01:00
led-core.c
led-triggers.c leds: triggers: Flush pending brightness before activating trigger 2024-08-19 05:45:29 +02:00
leds-88pm860x.c
leds-acer-a500.c
leds-adp5520.c
leds-an30259a.c
leds-apu.c
leds-ariel.c
leds-asic3.c
leds-aw2013.c leds: aw2013: Unlock mutex before destroying it 2024-03-26 18:21:31 -04:00
leds-bcm6328.c
leds-bcm6358.c
leds-bd2802.c
leds-blinkm.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c
leds-cr0014114.c
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-el15203000.c
leds-fsg.c
leds-gpio-register.c
leds-gpio.c
leds-hp6xx.c
leds-ip30.c
leds-ipaq-micro.c
leds-is31fl32xx.c
leds-is31fl319x.c
leds-lm355x.c
leds-lm3530.c
leds-lm3532.c
leds-lm3533.c
leds-lm3642.c
leds-lm3692x.c
leds-lm3697.c
leds-lm36274.c
leds-locomo.c
leds-lp50xx.c leds: leds-lp50xx: Handle reg to get correct multi_index 2025-08-28 16:24:23 +02:00
leds-lp55xx-common.c leds: lp55xx: Remove redundant test for invalid channel number 2024-12-14 19:50:34 +01:00
leds-lp55xx-common.h
leds-lp3944.c
leds-lp3952.c
leds-lp5521.c
leds-lp5523.c
leds-lp5562.c
leds-lp8501.c
leds-lp8788.c
leds-lp8860.c leds: lp8860: Write full EEPROM, not only half of it 2025-03-13 12:50:23 +01:00
leds-lt3593.c
leds-max8997.c
leds-max77650.c
leds-mc13783.c
leds-menf21bmc.c
leds-mlxcpld.c
leds-mlxreg.c
leds-mt6323.c
leds-net48xx.c
leds-netxbig.c leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata() 2025-03-13 12:49:56 +01:00
leds-nic78bx.c
leds-ns2.c
leds-ot200.c
leds-pca955x.c
leds-pca963x.c
leds-pca9532.c
leds-pm8058.c
leds-powernv.c
leds-pwm.c
leds-rb532.c
leds-regulator.c
leds-s3c24xx.c
leds-sc27xx-bltc.c
leds-spi-byte.c leds: spi-byte: Call of_node_put() on error path 2024-09-12 11:07:46 +02:00
leds-ss4200.c leds: ss4200: Convert PCIBIOS_* return codes to errnos 2024-08-19 05:45:14 +02:00
leds-sunfire.c
leds-syscon.c
leds-tca6507.c
leds-ti-lmu-common.c
leds-tlc591xx.c
leds-tps6105x.c
leds-turris-omnia.c
leds-wm831x-status.c
leds-wm8350.c
leds-wrap.c
leds.h
Makefile
TODO
uleds.c