linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <marek.behun@nic.cz>
To: Pavel Machek <pavel@ucw.cz>
Cc: jacek.anaszewski@gmail.com, dmurphy@ti.com, linux-leds@vger.kernel.org
Subject: Re: We have multicolor, but should we turn it into RGB?
Date: Mon, 27 Jul 2020 11:40:48 +0200	[thread overview]
Message-ID: <20200727114048.32f36c59@dellmb.labs.office.nic.cz> (raw)
In-Reply-To: <20200727084500.GA15237@amd>

On Mon, 27 Jul 2020 10:45:00 +0200
Pavel Machek <pavel@ucw.cz> wrote:

> Hi!
> 
> 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.
> 
> 	Proposal: let's add "rgb" to led_colors in
> 	drivers/leds/led-core.c, add corresponding device tree
> 	defines, and use that, instead of multicolor for RGB LEDs.
> 
> 	We really need to do that now; "white" stuff can wait.
> 
> RGB LEDs are quite common, and it would be good to be able to turn LED
> white and to turn it into any arbitrary color. It is essential that
> userspace is able to set arbitrary colors, and it might be good to
> have that ability from kernel, too... to allow full-color triggers.
> 
> Best regads,
> 									Pavel

I am not against adding RGB if you want to somehow teach the subsystem
to mix arbitrary color (either by teaching it color curves or some
other way). But I think we shouldn't remove multicolor, and here's the
reason why:

Most of the time I have seen 2 LEDs per ethernet port, green and yellow,
but some ports have 2 Bi-Color LEDs, each consisting of green and
yellow. I think most of the time these are 2-terminal LEDs.

So basically here we have, instead of a RGB LED, a GY LED (GY for
green/yellow).

Marvell PHYs support something they call Bi-Color LED Mixing. Normally
the LED can be either in ON or OFF state (in terms of LED API
max_brightness = 1), but with Bi-Color LED Mixing the 2-terminal
GY LED supports max_brightness = 8 for both green and yellow
channels.

Moreover Marvell PHYs support something called DUAL modes. This
basically means that this GY LED can be controlled by hardware in
several ways. For example one of these DUAL modes has following
behavior:

		LED[1]		LED[0]
1000 noact	Off		Solid On
1000   act	Off		Blink
 100 noact	Solid Mix	Solid Mix
 100   act	Blink Mix	Blink Mix
  10 noact	Solid On	Off
  10   act	Blink		Off
nolink		Off		Off

So if we want to reasonably add support for this configuration of LEDs
and to offer the user to configure these DUAL modes via the trigger
API, I think these LEDs should be shown in the system as multicolor
LEDs.

Marek

  reply	other threads:[~2020-07-27  9:40 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 [this message]
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 ` [PATCH] Add multicolor to the list Pavel Machek
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=20200727114048.32f36c59@dellmb.labs.office.nic.cz \
    --to=marek.behun@nic.cz \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.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).