linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: linux-leds@vger.kernel.org
Cc: Hermes Zhang <chenhui.zhang@axis.com>,
	Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
	kernel@axis.com, Hermes Zhang <chenhuiz@axis.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver
Date: Fri, 12 Mar 2021 09:31:58 +0100	[thread overview]
Message-ID: <2315048.uTtSMl1LR1@ada> (raw)
In-Reply-To: <20210311130408.10820-1-chenhui.zhang@axis.com>

Hallo Hermes,

thanks for your effort.

Am Donnerstag, 11. März 2021, 14:04:08 CET schrieb Hermes Zhang:
> From: Hermes Zhang <chenhuiz@axis.com>
> 
> Introduce a new Dual GPIO LED driver. These two GPIOs LED will act as
> one LED as normal GPIO LED but give the possibility to change the
> intensity in four levels: OFF, LOW, MIDDLE and HIGH.

Interesting use case. Is there any real world hardware wired like that you 
could point to?

> +config LEDS_DUAL_GPIO
> +	tristate "LED Support for Dual GPIO connected LEDs"
> +	depends on LEDS_CLASS
> +	depends on GPIOLIB || COMPILE_TEST
> +	help
> +	  This option enables support for the two LEDs connected to GPIO
> +	  outputs. These two GPIO LEDs act as one LED in the sysfs and
> +	  perform different intensity by enable either one of them or both.

Well, although I never had time to implement that, I suspect that could 
conflict if someone will eventually write a driver for two pin dual color LEDs 
connected to GPIO pins.  We actually do that on our hardware and I know others 
do, too.

I asked about that back in 2019, see this thread:

https://www.spinics.net/lists/linux-leds/msg11665.html

At the time the multicolor framework was not yet merged, so today I would 
probably make something which either uses the multicolor framework or at least 
has a similar interface to userspace. However, it probably won't surprise you 
all, this is not highest priority on my ToDo list. ;-)

(What we actually do is pretend those are separate LEDs and ignore the 
conflicting case where both GPIOs are on and the LED is dark then.)

Greets
Alex




  parent reply	other threads:[~2021-03-12  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 13:04 [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver Hermes Zhang
2021-03-11 15:38 ` Marek Behun
2021-03-11 15:39   ` Marek Behun
2021-03-12  4:48     ` Hermes Zhang
2021-03-12  5:59       ` Marek Behun
2021-03-11 17:56 ` Pavel Machek
2021-03-11 18:02 ` Pavel Machek
2021-03-18  2:11   ` Hermes Zhang
2021-03-12  8:31 ` Alexander Dahl [this message]
2021-03-12  8:48   ` Hermes Zhang
2021-03-12  9:03     ` Marek Behun

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=2315048.uTtSMl1LR1@ada \
    --to=ada@thorsis.com \
    --cc=chenhui.zhang@axis.com \
    --cc=chenhuiz@axis.com \
    --cc=dmurphy@ti.com \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).