linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Setting multi-color intensities stops software blink
@ 2022-05-03 12:16 Sven Schwermer
  2022-05-17 10:29 ` AW: " Sven Schuchmann
  0 siblings, 1 reply; 9+ messages in thread
From: Sven Schwermer @ 2022-05-03 12:16 UTC (permalink / raw)
  To: linux-leds; +Cc: pavel

Hi,

I'm experiencing an issue with multi-color LEDs when setting the 
intensities while software blinking is active (e.g. trigger=timer). This 
manifests itself by delay_on and delay_off being set to 0 when writing 
multi_intensities while the LED is off. If doing this while the LED is 
on, everything works as expected.

I suspect that this happens because multi_intensity_store() calls 
led_set_brightness(led_cdev, led_cdev->brightness) at the end. It seems 
like the software blinking modifies led_cdev->brightness directly, so if 
the LED is in its off-phase, we're effectively switching the LED off 
because we're setting its brightness to 0 which clears delay_on and 
delay_off to 0:

led_set_brightness(brightness=0): sets LED_BLINK_DISABLE
  -> set_brightness_delayed()
   -> led_stop_software_blink(): clears blink delays

How would one fix this properly? Should multi_intensity_store() call 
led_set_brightness() with brightness=led_cdev->blink_brightness if 
blinking is active? That feels like an unclean solution.

I'm hoping for some input. Thanks :)

Best regards,
Sven


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-18 19:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-03 12:16 Setting multi-color intensities stops software blink Sven Schwermer
2022-05-17 10:29 ` AW: " Sven Schuchmann
2022-05-17 21:43   ` Jacek Anaszewski
2022-05-18  6:26     ` Sven Schwermer
2022-05-18  8:22     ` [PATCH] led: multicolor: Don't set brightness when blinking Sven Schwermer
2022-05-18 14:06       ` AW: " Sven Schuchmann
2022-05-18 19:29       ` Jacek Anaszewski
2022-05-18 19:36         ` Jacek Anaszewski
2022-05-18 19:54     ` [PATCH v2] led: multicolor: Fix intensity setting while SW blinking Sven Schwermer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).