Skip to content

Commit e35ca99

Browse files
svenschwermerlag-linaro
authored andcommitted
leds: multicolor: Fix intensity setting while SW blinking
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 <[email protected]> Acked-by: Jacek Anaszewski <[email protected]> Acked-by: Pavel Machek <[email protected]> Reviewed-by: Tobias Deiminger <[email protected]> Tested-by: Sven Schuchmann <[email protected]> Signed-off-by: Sven Schwermer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent b2661df commit e35ca99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/leds/led-class-multicolor.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static ssize_t multi_intensity_store(struct device *dev,
5959
for (i = 0; i < mcled_cdev->num_colors; i++)
6060
mcled_cdev->subled_info[i].intensity = intensity_value[i];
6161

62-
led_set_brightness(led_cdev, led_cdev->brightness);
62+
if (!test_bit(LED_BLINK_SW, &led_cdev->work_flags))
63+
led_set_brightness(led_cdev, led_cdev->brightness);
6364
ret = size;
6465
err_out:
6566
mutex_unlock(&led_cdev->led_access);

0 commit comments

Comments
 (0)