linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] leds: pca9532: Use hardware for blinking LEDs
@ 2024-06-17 14:39 Bastien Curutchet
  2024-06-17 14:39 ` [PATCH v2 1/4] leds: pca9532: Use defines to select PWM instance Bastien Curutchet
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Bastien Curutchet @ 2024-06-17 14:39 UTC (permalink / raw)
  To: Riku Voipio, Pavel Machek, Lee Jones
  Cc: linux-leds, linux-kernel, Thomas Petazzoni, Herve Codina,
	Christopher Cordahi, Bastien Curutchet

Hi all,

This series aims to use hardware more often to blink LEDs.

The pca9532_set_blink() rejects asymmetric delays. So the core's software
fallback is almost always used when we want to blink a LED. Removing
this restriction revealed some conflicts between setting brightness and
blinking as the same PWM (PWM0) configuration is used by all LEDs for
both brightness and blinking.

Make use of the second available PWM (PWM1) to blink LEDs. This PWM1 was
reserved for beepers so hardware blinking is explicitly disabled if at
least one LED is used to drive a beeper to avoid conflicts.

Tested with PCA9532

Changes in v2:
 * Add defines to get rid of magic numbers
 * Replace every 'led' by 'LED'
 * Use dev_err() when returning errors
 * Remove unused struct pca9532_data from patch 2 to add it on patch 3
   where it's actually used

[v1] : https://lore.kernel.org/all/20240527125940.155260-1-bastien.curutchet@bootlin.com/

Bastien Curutchet (4):
  leds: pca9532: Use defines to select PWM instance
  leds: pca9532: Use PWM1 for hardware blinking
  leds: pca9532: Explicitly disable hardware blink when PWM1 is
    unavailable
  leds: pca9532: Change default blinking frequency to 1Hz

 drivers/leds/leds-pca9532.c | 81 ++++++++++++++++++++++++++++---------
 1 file changed, 63 insertions(+), 18 deletions(-)

-- 
2.45.0


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

end of thread, other threads:[~2024-07-11  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 14:39 [PATCH v2 0/4] leds: pca9532: Use hardware for blinking LEDs Bastien Curutchet
2024-06-17 14:39 ` [PATCH v2 1/4] leds: pca9532: Use defines to select PWM instance Bastien Curutchet
2024-06-17 14:39 ` [PATCH v2 2/4] leds: pca9532: Use PWM1 for hardware blinking Bastien Curutchet
2024-07-10  9:17   ` Bastien Curutchet
2024-07-11  8:30     ` Lee Jones
2024-07-11  8:40       ` Bastien Curutchet
2024-06-17 14:39 ` [PATCH v2 3/4] leds: pca9532: Explicitly disable hardware blink when PWM1 is unavailable Bastien Curutchet
2024-06-17 14:39 ` [PATCH v2 4/4] leds: pca9532: Change default blinking frequency to 1Hz Bastien Curutchet
2024-06-20 16:49 ` [PATCH v2 0/4] leds: pca9532: Use hardware for blinking LEDs Lee Jones

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).