aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-12-16 07:07:34 +0100
committerRafał Miłecki <rafal@milecki.pl>2022-01-03 14:28:13 +0100
commit739e359241a3855bf8f7b6b99978495ad52d1004 (patch)
treefc2e15dc232c9a0cd82566eaa11d13f0a32166ce /target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch
parent608c7dccf27c64ff3c8e09430481b66af18bdaf4 (diff)
downloadupstream-739e359241a3855bf8f7b6b99978495ad52d1004.tar.gz
upstream-739e359241a3855bf8f7b6b99978495ad52d1004.tar.bz2
upstream-739e359241a3855bf8f7b6b99978495ad52d1004.zip
kernel: backport support for multicolor & RGB LEDs to 5.4
This is a requirement for backporting DT files defining such LEDs. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 85ad48c9579c0482c98fc6b69e885102511e9194)
Diffstat (limited to 'target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch')
-rw-r--r--target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch b/target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch
new file mode 100644
index 0000000000..17c28149f6
--- /dev/null
+++ b/target/linux/generic/backport-5.4/900-v5.9-0003-leds-add-RGB-color-option-as-that-is-different-from-.patch
@@ -0,0 +1,48 @@
+From 54212f5a1ba3123281877e54c1e5f672bf7563d8 Mon Sep 17 00:00:00 2001
+From: Pavel Machek <pavel@ucw.cz>
+Date: Mon, 3 Aug 2020 13:20:06 +0200
+Subject: [PATCH] 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>
+---
+ drivers/leds/led-core.c | 1 +
+ drivers/leds/leds-lp55xx-common.c | 2 +-
+ include/dt-bindings/leds/common.h | 6 ++++--
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/leds/led-core.c
++++ b/drivers/leds/led-core.c
+@@ -35,6 +35,7 @@ const char * const led_colors[LED_COLOR_
+ [LED_COLOR_ID_YELLOW] = "yellow",
+ [LED_COLOR_ID_IR] = "ir",
+ [LED_COLOR_ID_MULTI] = "multicolor",
++ [LED_COLOR_ID_RGB] = "rgb",
+ };
+ EXPORT_SYMBOL_GPL(led_colors);
+
+--- a/include/dt-bindings/leds/common.h
++++ b/include/dt-bindings/leds/common.h
+@@ -29,8 +29,10 @@
+ #define LED_COLOR_ID_VIOLET 5
+ #define LED_COLOR_ID_YELLOW 6
+ #define LED_COLOR_ID_IR 7
+-#define LED_COLOR_ID_MULTI 8
+-#define LED_COLOR_ID_MAX 9
++#define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */
++#define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color,
++ so this would include RGBW and similar */
++#define LED_COLOR_ID_MAX 10
+
+ /* Standard LED functions */
+ #define LED_FUNCTION_ACTIVITY "activity"