[PATCH 00/10] leds: class: Support custom sysfs groups on multicolor and flash LEDs
From: Armin Wolf
Date: Sun Oct 18 2026 - 09:56:47 EST
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.
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: Take the LED access lock when reading
brightness_hw_changed
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 | 154 +++++++++--------
drivers/leds/led-class-multicolor.c | 79 ++++-----
drivers/leds/led-class.c | 245 +++++++++++++++++-----------
drivers/leds/leds.h | 3 +
include/linux/led-class-flash.h | 5 -
include/linux/leds.h | 4 +-
6 files changed, 268 insertions(+), 222 deletions(-)
--
2.56.0