Skip to content

Commit 54212f5

Browse files
committed
leds: add RGB color option, as that is different from multicolor.
Multicolor is a bit too abstract. Yes, we can have Green-Magenta-Ultraviolet LED, but so far all the LEDs we support are RGB, and not even RGB-White or RGB-Yellow variants emerged. Multicolor is not a good fit for RGB LED. It does not really know about LED color. In particular, there's no way to make LED "white". Userspace is interested in knowing "this LED can produce arbitrary color", which not all multicolor LEDs can. Signed-off-by: Pavel Machek <pavel@ucw.cz>
1 parent 2742b41 commit 54212f5

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/leds/led-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const char * const led_colors[LED_COLOR_ID_MAX] = {
3535
[LED_COLOR_ID_YELLOW] = "yellow",
3636
[LED_COLOR_ID_IR] = "ir",
3737
[LED_COLOR_ID_MULTI] = "multicolor",
38+
[LED_COLOR_ID_RGB] = "rgb",
3839
};
3940
EXPORT_SYMBOL_GPL(led_colors);
4041

drivers/leds/leds-lp55xx-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static int lp55xx_parse_logical_led(struct device_node *np,
638638
if (ret)
639639
return ret;
640640

641-
if (led_color == LED_COLOR_ID_MULTI)
641+
if (led_color == LED_COLOR_ID_RGB)
642642
return lp55xx_parse_multi_led(np, cfg, child_number);
643643

644644
ret = lp55xx_parse_common_child(np, cfg, child_number, &chan_nr);

include/dt-bindings/leds/common.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
#define LED_COLOR_ID_VIOLET 5
3131
#define LED_COLOR_ID_YELLOW 6
3232
#define LED_COLOR_ID_IR 7
33-
#define LED_COLOR_ID_MULTI 8
34-
#define LED_COLOR_ID_MAX 9
33+
#define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */
34+
#define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color,
35+
so this would include RGBW and similar */
36+
#define LED_COLOR_ID_MAX 10
3537

3638
/* Standard LED functions */
3739
/* Keyboard LEDs, usually it would be input4::capslock etc. */

0 commit comments

Comments
 (0)