From: Luca Weiss <luca@z3ntu.xyz>
To: Linux LED Subsystem <linux-leds@vger.kernel.org>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: bjorn.andersson@linaro.org
Subject: Re: Clarification regarding multicolor leds
Date: Sun, 25 Oct 2020 11:54:50 +0100 [thread overview]
Message-ID: <2299544.FhU3MROB3G@g550jk> (raw)
In-Reply-To: <534b4937-b7ec-fc63-325a-c8e1e268b85b@gmail.com>
Hi Jacek
On Samstag, 24. Oktober 2020 21:34:38 CET Jacek Anaszewski wrote:
> Hi Luca,
>
> On 10/24/20 12:48 AM, Luca Weiss wrote:
> > Hi,
> > I'm currently experimenting with the qcom lpg[0] which is a driver for the
> > rgb notification led found on e.g. Snapdragon 801 devices (and many
> > more), specifically my example is about the Fairphone 2
> > (msm8974-fairphone-fp2).
> >
> > [0]
> > https://lore.kernel.org/lkml/20201021201224.3430546-1-bjorn.andersson@lin
> > aro.org/>
> > My dts is looking like the following (abbreviated):
> > [in lpg node]
> > multi-led {
> >
> > color = <LED_COLOR_ID_MULTI>;
> > function = LED_FUNCTION_STATUS;
> > ....
> >
> > };
> >
> > I'm comparing this to the PinePhone where the leds are defined as follows:
> > [in gpio-leds node]
> > blue {
> >
> > function = LED_FUNCTION_INDICATOR;
> > color = <LED_COLOR_ID_BLUE>;
> >
> > };
> >
> > green {
> >
> > function = LED_FUNCTION_INDICATOR;
> > color = <LED_COLOR_ID_GREEN>;
> >
> > };
> >
> > red {
> >
> > function = LED_FUNCTION_INDICATOR;
> > color = <LED_COLOR_ID_RED>;
> >
> > };
> >
> > (sidenote: the LED_FUNCTION_INDICATOR should probably also be
> > LED_FUNCTION_STATUS there; the dts was made before the better descriptions
> > for the defines have been added)
> >
> > This gets the following directories created in /sys/class/leds/:
> > blue:indicator
> > green:indicator
> > red:indicator
> >
> > But with the multicolor led on the Fairphone 2 only a directory with the
> > name of "multi-led" gets created which I would have expected to be
> > "multicolor:status" instead.
>
> This is because the driver from patch set [0] does not use *ext()
> multicolor registration API, but follows old-fashion LED name
> initialization via 'name' property of struct led_classdev, which is
> initialized to DT 'label' value or DT node name if the former is absent.
Right, I remember now having done something similar with my sgm3140 flash led
driver half a year ago, thanks for the reminder!
With the qcom-lpg driver using the _ext function it works as expected.
@Bjorn I've prepared a diff for your patches at
https://public.z3ntu.xyz/tmp/lpg.diff where
1. LED_COLOR_ID_MULTI is replaced with LED_COLOR_ID_RGB based on these emails
2. The example in the documentation uses LED_FUNCTION_STATUS (see description
for the constant in include/dt-bindings/leds/common.h)
3. The _ext registration api now gets used, see e.g. commit 5b4b723c483f
Thanks for your help, really appreciate it!
Regards
Luca
next prev parent reply other threads:[~2020-10-25 10:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 22:48 Clarification regarding multicolor leds Luca Weiss
2020-10-24 6:42 ` Alexander Dahl
2020-10-24 6:48 ` Pavel Machek
2020-10-24 9:16 ` Luca Weiss
2020-10-24 21:50 ` Dan Murphy
2020-10-24 19:34 ` Jacek Anaszewski
2020-10-25 10:54 ` Luca Weiss [this message]
2020-10-26 3:26 ` Bjorn Andersson
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=2299544.FhU3MROB3G@g550jk \
--to=luca@z3ntu.xyz \
--cc=bjorn.andersson@linaro.org \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-leds@vger.kernel.org \
/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).