]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
leds: multicolor: Fix intensity setting while SW blinking
authorSven Schwermer <sven.schwermer@disruptive-technologies.com>
Fri, 4 Apr 2025 18:40:36 +0000 (20:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 13:57:32 +0000 (15:57 +0200)
commitbbd1511e27eec09709bfcfc10fa8377751716ecf
tree51fb4358c671ea17a8c81aad89e77aba0bec4436
parenta23b82a0693b0492a2fc8a189f4bdfc6bca30c0c
leds: multicolor: Fix intensity setting while SW blinking

[ Upstream commit e35ca991a777ef513040cbb36bc8245a031a2633 ]

When writing to the multi_intensity file, don't unconditionally call
led_set_brightness. By only doing this if blinking is inactive we
prevent blinking from stopping if the blinking is in its off phase while
the file is written.

Instead, if blinking is active, the changed intensity values are applied
upon the next blink. This is consistent with changing the brightness on
monochrome LEDs with active blinking.

Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Tobias Deiminger <tobias.deiminger@linutronix.de>
Tested-by: Sven Schuchmann <schuchmann@schleissheimer.de>
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Link: https://lore.kernel.org/r/20250404184043.227116-1-sven@svenschwermer.de
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/led-class-multicolor.c