Linux LED subsystem development
 help / color / mirror / Atom feed
* [PATCH v4 00/10] leds: class: Support custom sysfs groups on multicolor and flash LEDs
@ 2026-11-28 13:58 Armin Wolf
  2026-11-28 13:58 ` [PATCH v4 01/10] leds: class: Constify sysfs attributes Armin Wolf
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Armin Wolf @ 2026-11-28 13:58 UTC (permalink / raw)
  To: lee, pavel; +Cc: linux-leds, linux-kernel, i

Until now drivers are unable to atomically register custom sysfs
groups below multicolor and flash LED class devices, because the
led_cdev->sysfs_groups field is being overwritten inside the
associated initialization functions. This patch series tries to
fix this.

The first three patches constify the sysfs attributes of all three
LED flavors, while the next four patches fix various unrelated issues
affecting LED device initialization. The next two patches migrate
the multicolor and flash LEDs to use struct device_type for
registering their sysfs attributes, so that led_cdev->sysfs_groups is
not touched anymore. The last patch contains a minor optimization
for multicolor LEDs.

All patches have been tested on real hardware, with the flash LED
interface being tested using a custom kernel module.

Changes since v3:
- add Reviewed-by tag for Rong Zhang
- drop patch for the KTD202X driver (issue was already fixed)
- fix checkpatch issues
- replace if (ret < 0) with if (ret)

Changes since v2:
- fix issue inside KTD202X driver

Armin Wolf (10):
  leds: class: Constify sysfs attributes
  leds: multicolor: Constify sysfs attributes
  leds: flash: Constify sysfs attributes
  leds: class: Create "brightness_hw_changed" attribute atomically
  leds: class: Fix race condition when creating the device
  leds: class: Access brightness_hw_changed exactly once
  leds: class: Use correct type for brightness_hw_changed field
  leds: class: Split led_classdev_register_ext()
  leds: Support custom sysfs groups on multicolor and flash LEDs
  leds: multicolor: Adjust maximum subled intensity during
    initialization

 drivers/leds/led-class-flash.c      | 159 ++++++++++---------
 drivers/leds/led-class-multicolor.c |  78 +++++-----
 drivers/leds/led-class.c            | 233 +++++++++++++++++++---------
 drivers/leds/leds.h                 |   3 +
 include/linux/led-class-flash.h     |   5 -
 include/linux/leds.h                |   2 +-
 6 files changed, 284 insertions(+), 196 deletions(-)

-- 
2.56.1


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

end of thread, other threads:[~2026-11-28 14:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 13:58 [PATCH v4 00/10] leds: class: Support custom sysfs groups on multicolor and flash LEDs Armin Wolf
2026-11-28 13:58 ` [PATCH v4 01/10] leds: class: Constify sysfs attributes Armin Wolf
2026-11-28 13:58 ` [PATCH v4 02/10] leds: multicolor: " Armin Wolf
2026-11-28 13:58 ` [PATCH v4 03/10] leds: flash: " Armin Wolf
2026-11-28 13:58 ` [PATCH v4 04/10] leds: class: Create "brightness_hw_changed" attribute atomically Armin Wolf
2026-11-28 14:08   ` sashiko-bot
2026-11-28 13:58 ` [PATCH v4 05/10] leds: class: Fix race condition when creating the device Armin Wolf
2026-11-28 13:58 ` [PATCH v4 06/10] leds: class: Access brightness_hw_changed exactly once Armin Wolf
2026-11-28 13:58 ` [PATCH v4 07/10] leds: class: Use correct type for brightness_hw_changed field Armin Wolf
2026-11-28 13:58 ` [PATCH v4 08/10] leds: class: Split led_classdev_register_ext() Armin Wolf
2026-11-28 13:58 ` [PATCH v4 09/10] leds: Support custom sysfs groups on multicolor and flash LEDs Armin Wolf
2026-11-28 13:58 ` [PATCH v4 10/10] leds: multicolor: Adjust maximum subled intensity during initialization Armin Wolf
2026-11-28 14:08 ` [PATCH v4 00/10] leds: class: Support custom sysfs groups on multicolor and flash LEDs sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox