linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: marek.behun@nic.cz, jacek.anaszewski@gmail.com, dmurphy@ti.com,
	linux-leds@vger.kernel.org
Subject: [PATCH] Add multicolor to the list.
Date: Mon, 3 Aug 2020 14:01:42 +0200	[thread overview]
Message-ID: <20200803120142.llmwjyfh5adsq4yw@duo.ucw.cz> (raw)
In-Reply-To: <20200727084500.GA15237@amd>

[-- Attachment #1: Type: text/plain, Size: 2301 bytes --]


commit ddfd8931c942a64c1ebdd7b93a4f18c84bd3b97b
Author: Pavel Machek <pavel@ucw.cz>
Date:   Mon Aug 3 13:20:06 2020 +0200

    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>

diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 846248a0693d..a6dce01dbd5e 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -35,6 +35,7 @@ const char * const led_colors[LED_COLOR_ID_MAX] = {
 	[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);
 
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index af14e2b2d577..56210f4ad919 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -638,7 +638,7 @@ static int lp55xx_parse_logical_led(struct device_node *np,
 	if (ret)
 		return ret;
 
-	if (led_color == LED_COLOR_ID_MULTI)
+	if (led_color == LED_COLOR_ID_RGB)
 		return lp55xx_parse_multi_led(np, cfg, child_number);
 
 	ret =  lp55xx_parse_common_child(np, cfg, child_number, &chan_nr);
diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h
index a463ce6a8794..52b619d44ba2 100644
--- a/include/dt-bindings/leds/common.h
+++ b/include/dt-bindings/leds/common.h
@@ -30,8 +30,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 */
 /* Keyboard LEDs, usually it would be input4::capslock etc. */

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2020-08-03 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  8:45 We have multicolor, but should we turn it into RGB? Pavel Machek
2020-07-27  9:40 ` Marek Behún
2020-07-27 10:20   ` Pavel Machek
2020-07-27 10:52   ` Pavel Machek
2020-07-27 11:21     ` Marek Behún
2020-08-03 12:04       ` turris-omnia: fixes needed was " Pavel Machek
2020-08-03 12:01 ` Pavel Machek [this message]
2020-08-03 12:02 ` [PATCH] leds: disallow /sys/class/leds/*:multi:* for now Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200803120142.llmwjyfh5adsq4yw@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=marek.behun@nic.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).