linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Marek Behún" <marek.behun@nic.cz>
Cc: linux-leds@vger.kernel.org, "Dan Murphy" <dmurphy@ti.com>,
	"Ondřej Jirman" <megous@megous.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Andrew Lunn" <andrew@lunn.ch>,
	linux-kernel@vger.kernel.org,
	"Matthias Schiffer" <matthias.schiffer@ew.tq-group.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH leds + devicetree v2 0/2] Parse DT property `trigger-sources` for netdev LED trigger
Date: Wed, 25 Nov 2020 11:38:22 +0100	[thread overview]
Message-ID: <20201125103822.GC25562@amd> (raw)
In-Reply-To: <20200915152616.20591-1-marek.behun@nic.cz>

[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]

Hi!

> In this proposal the specific netdev LED trigger mode is determined
> from the `function` LED DT property.
> 
> Example:
>   eth0: ethernet@30000 {
>     compatible = "xyz";
>     #trigger-source-cells = <0>;
>   };
> 
>   led {
>     color = <LED_COLOR_ID_GREEN>;
>     function = LED_FUNCTION_LINK;
>     trigger-sources = <&eth0>;
>   };

> 
> When led is registered, the netdev trigger is automatically activated
> and set to light the LED on if eth0 is linked.
> 
> Please let me know if this binding is OK, or if the binding should
> instead of the `function` property determine the trigger settings from
> arguments of the `trigger-sources` property :
>   led {
>     color = <LED_COLOR_ID_GREEN>;
>     trigger-sources = <&eth0 (NETDEV_ATTR_LINK | NETDEV_ATTR_RX)>;
>   };

So... Both interfaces look relatively sane.

I might preffer the second one. For development boards, the LEDs
really have no labels (etc), thus no function -- they are user LEDs 1
to 4. But we still may want to say "user LED one should have mmc0
trigger by default".

Of course, we might also want to simply say that the LED is really mmc LED...

> I prefer the first binding, since we already have the `function`
> property. Multiple modes can be achieved by string array, but this is
> not yet implemented:
>   led {
>     color = <LED_COLOR_ID_GREEN>;
>     function = LED_FUNCTION_LINK, LED_FUNCTION_ACTIVITY;
>     trigger-sources = <&eth0>;
>   };

I don't see how multiple functions would work.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      parent reply	other threads:[~2020-11-25 10:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 15:26 [PATCH leds + devicetree v2 0/2] Parse DT property `trigger-sources` for netdev LED trigger Marek Behún
2020-09-15 15:26 ` [PATCH leds + devicetree v2 1/2] leds: trigger: add trigger sources validating method and helper functions Marek Behún
2020-09-15 16:24   ` Marek Behun
2020-11-25 10:32   ` Pavel Machek
2020-09-15 15:26 ` [PATCH leds + devicetree v2 2/2] leds: trigger: netdev: parse `trigger-sources` from device tree Marek Behún
2020-09-15 21:35   ` Jacek Anaszewski
2020-09-16  0:15     ` Marek Behun
2020-09-16 21:46       ` Jacek Anaszewski
2020-11-25 10:42   ` Pavel Machek
2020-11-25 12:19     ` Marek Behun
2020-11-25 10:38 ` Pavel Machek [this message]

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=20201125103822.GC25562@amd \
    --to=pavel@ucw.cz \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marek.behun@nic.cz \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=megous@megous.com \
    --cc=robh+dt@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).