From: Hermes Zhang <Hermes.Zhang@axis.com>
To: Pavel Machek <pavel@ucw.cz>, Marek Behun <marek.behun@nic.cz>
Cc: Dan Murphy <dmurphy@ti.com>, kernel <kernel@axis.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: RE: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver
Date: Thu, 18 Mar 2021 02:11:42 +0000 [thread overview]
Message-ID: <fbeb1c97406c4ea8b6527ccbb25d5fe9@XBOX01.axis.com> (raw)
In-Reply-To: <20210311180225.GA11650@duo.ucw.cz>
> > + priv = devm_kzalloc(dev, sizeof(struct gpio_dual_leds_priv),
> GFP_KERNEL);
> > + if (!priv)
> > + return -ENOMEM;
> > +
> > + priv->low_gpio = devm_gpiod_get(dev, "low", GPIOD_OUT_LOW);
> > + ret = PTR_ERR_OR_ZERO(priv->low_gpio);
> > + if (ret) {
> > + dev_err(dev, "cannot get low-gpios %d\n", ret);
> > + return ret;
> > + }
> > +
> > + priv->high_gpio = devm_gpiod_get(dev, "high", GPIOD_OUT_LOW);
> > + ret = PTR_ERR_OR_ZERO(priv->high_gpio);
> > + if (ret) {
> > + dev_err(dev, "cannot get high-gpios %d\n", ret);
> > + return ret;
> > + }
>
> Actually... I'd call it led-0 and led-1 or something. Someone may/will come
> with 4-bit GPIO LED one day, and it would be cool if this could be used with
> minimal effort.
>
> Calling it multi_led in the driver/bindings would bnot be bad, either.
>
Hi all,
I have try to use leds-regulator to implement my case, most works. But the only thing doesn't work is the enable-gpio. In my case, we don't have a real enable gpio, so when we set LED_OFF, it could not off the LED as we expected.
So I think I will back to the new multi LED driver, but make it more generic.
Best Regards,
Hermes
next prev parent reply other threads:[~2021-03-18 2:12 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 [this message]
2021-03-12 8:31 ` Alexander Dahl
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=fbeb1c97406c4ea8b6527ccbb25d5fe9@XBOX01.axis.com \
--to=hermes.zhang@axis.com \
--cc=dmurphy@ti.com \
--cc=kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=marek.behun@nic.cz \
--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).