mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/wigyori.git] / target / linux / generic / backport-5.4 / 900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch
1 From 54212f5a1ba3123281877e54c1e5f672bf7563d8 Mon Sep 17 00:00:00 2001
2 From: Pavel Machek <pavel@ucw.cz>
3 Date: Mon, 3 Aug 2020 13:20:06 +0200
4 Subject: [PATCH] leds: add RGB color option, as that is different from
5 multicolor.
6
7 Multicolor is a bit too abstract. Yes, we can have
8 Green-Magenta-Ultraviolet LED, but so far all the LEDs we support are
9 RGB, and not even RGB-White or RGB-Yellow variants emerged.
10
11 Multicolor is not a good fit for RGB LED. It does not really know
12 about LED color. In particular, there's no way to make LED "white".
13
14 Userspace is interested in knowing "this LED can produce arbitrary
15 color", which not all multicolor LEDs can.
16
17 Signed-off-by: Pavel Machek <pavel@ucw.cz>
18 ---
19 drivers/leds/led-core.c | 1 +
20 drivers/leds/leds-lp55xx-common.c | 2 +-
21 include/dt-bindings/leds/common.h | 6 ++++--
22 3 files changed, 6 insertions(+), 3 deletions(-)
23
24 --- a/drivers/leds/led-core.c
25 +++ b/drivers/leds/led-core.c
26 @@ -35,6 +35,7 @@ const char * const led_colors[LED_COLOR_
27 [LED_COLOR_ID_YELLOW] = "yellow",
28 [LED_COLOR_ID_IR] = "ir",
29 [LED_COLOR_ID_MULTI] = "multicolor",
30 + [LED_COLOR_ID_RGB] = "rgb",
31 };
32 EXPORT_SYMBOL_GPL(led_colors);
33
34 --- a/include/dt-bindings/leds/common.h
35 +++ b/include/dt-bindings/leds/common.h
36 @@ -29,8 +29,10 @@
37 #define LED_COLOR_ID_VIOLET 5
38 #define LED_COLOR_ID_YELLOW 6
39 #define LED_COLOR_ID_IR 7
40 -#define LED_COLOR_ID_MULTI 8
41 -#define LED_COLOR_ID_MAX 9
42 +#define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */
43 +#define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color,
44 + so this would include RGBW and similar */
45 +#define LED_COLOR_ID_MAX 10
46
47 /* Standard LED functions */
48 #define LED_FUNCTION_ACTIVITY "activity"