Re: [RFC PATCH 1/1] leds: Introduce the multi_max_intensity sysfs attribute

From: Jacek Anaszewski

Date: Mon Mar 23 2026 - 14:46:29 EST


On 3/23/26 11:22 AM, Armin Wolf wrote:
[...]
led-class-multicolor.h
index db9f34c6736e..67ac0ac0fd54 100644
--- a/include/linux/led-class-multicolor.h
+++ b/include/linux/led-class-multicolor.h
@@ -9,10 +9,33 @@
  #include <linux/leds.h>
  #include <dt-bindings/leds/common.h>
  +#define LED_USE_MAX_BRIGHTNESS 0
+
+/**
+ * struct mc_subled - Color component description.
+ * @color_index: Color ID.
+ * @brightness: Scaled intensity.
+ * @intensity: Current intensity.
+ * @max_intensity: Maximum supported intensity value.
+ * @channel: Channel index.
+ *
+ * Describes a color component of a multicolor LED. Many multicolor LEDs
+ * do no support gobal brightness control in hardware, so they use
+ * the brightness field in connection with led_mc_calc_color_components()
+ * to perform the intensity scaling in software.
+ * Such drivers should set max_intensity to LED_USE_MAX_BRIGHTNESS

I'd just mention here that the field needs to be left initialized to 0,
to let the LED subsystem to adjust it to max_brightness. Note that in
case of max_brightness we allow for the same - if it is 0, then
led-class.c adjusts it to legacy LED_FULL (255).

OK, do you think that having LED_USE_MAX_BRIGHTNESS makes sense?

Not really, let's drop it.

--
Best regards,
Jacek Anaszewski