From: Marek Behun <marek.behun@nic.cz>
To: "Adrian Schmutzler" <mail@adrianschmutzler.de>
Cc: <linux-leds@vger.kernel.org>
Subject: Re: How to name multiple LEDs of the same type and color
Date: Sun, 20 Sep 2020 03:17:27 +0200 [thread overview]
Message-ID: <20200920031727.731e8a66@nic.cz> (raw)
In-Reply-To: <00ab01d68eca$d2d4fcc0$787ef640$@adrianschmutzler.de>
On Sat, 19 Sep 2020 23:21:22 +0200
"Adrian Schmutzler" <mail@adrianschmutzler.de> wrote:
> Hi,
>
> I wonder what would be the correct way to deal with a set of LEDs with the same color/function combination, e.g.
>
> leds {
> compatible = "gpio-leds";
>
> link1 {
> function = LED_FUNCTION_RSSI;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
> };
>
> link2 {
> function = LED_FUNCTION_RSSI;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
> };
>
> link3 {
> function = LED_FUNCTION_RSSI;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
> };
> };
>
> or
>
> leds {
> compatible = "gpio-leds";
>
> lan1 {
> function = LED_FUNCTION_LAN;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
> };
> lan2 {
> function = LED_FUNCTION_LAN;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
> };
> lan3 {
> function = LED_FUNCTION_LAN;
> color = <LED_COLOR_ID_GREEN>;
> gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
> };
> };
>
> These nodes will automatically create names like green:lan, green:lan_1, etc.
>
> Is there a way to force a certain numbering scheme, e.g.
> green:lan1, green:lan2, etc.
> ?
>
> (For the RSSI leds, we currently even have stuff like ...:green:rssilow, ...:green:rssimedium, etc. in the label now)
>
> How does this match into the color/function concept?
>
> Thanks for some pointers ...
>
> Best
>
> Adrian
Please look at function-enumerator property.
next prev parent reply other threads:[~2020-09-20 1:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-19 21:21 How to name multiple LEDs of the same type and color Adrian Schmutzler
2020-09-20 1:17 ` Marek Behun [this message]
2020-09-20 11:08 ` Pavel Machek
2020-09-20 23:31 ` Adrian Schmutzler
2020-09-21 1:00 ` Marek Behun
2020-09-21 8:31 ` Pavel Machek
2020-09-21 9:49 ` Adrian Schmutzler
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=20200920031727.731e8a66@nic.cz \
--to=marek.behun@nic.cz \
--cc=linux-leds@vger.kernel.org \
--cc=mail@adrianschmutzler.de \
/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