devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* lets settle the LED `function` property regarding the netdev trigger
@ 2021-10-01 12:36 Marek Behún
  2021-10-03 18:56 ` Andrew Lunn
  0 siblings, 1 reply; 17+ messages in thread
From: Marek Behún @ 2021-10-01 12:36 UTC (permalink / raw)
  To: Pavel Machek, Jacek Anaszewski, Rob Herring
  Cc: Andrew Lunn, linux-leds@vger.kernel.org, netdev, linux-kernel,
	devicetree

Hello Pavel, Jacek, Rob and others,

I'd like to settle DT binding for the LED function property regarding
the netdev LED trigger.

Currently we have, in include/dt-bindings/leds/common.h, the following
functions defined that could be interpreted as request to enable netdev
trigger on given LEDs:
  activity
  lan
  rx tx
  wan
  wlan

The "activity" function was originally meant to imply the CPU
activity trigger, while "rx" and "tx" are AFAIK meant as UART indicators
(tty LED trigger), see
https://lore.kernel.org/linux-leds/20190609190803.14815-27-jacek.anaszewski@gmail.com/

The netdev trigger supports different settings:
- indicate link
- blink on rx, blink on tx, blink on both

The current scheme does not allow for implying these.

I therefore propose that when a LED has a network device handle in the
trigger-sources property, the "rx", "tx" and "activity" functions
should also imply netdev trigger (with the corresponding setting).
A "link" function should be added, also implying netdev trigger.

What about if a LED is meant by the device vendor to indicate both link
(on) and activity (blink)?
The function property is currently a string. This could be changed to
array of strings, and then we can have
  function = "link", "activity";
Since the function property is also used for composing LED classdev
names, I think only the first member should be used for that.

This would allow for ethernet LEDs with names
  ethphy-0:green:link
  ethphy-0:yellow:activity
to be controlled by netdev trigger in a specific setting without the
need to set the trigger in /sys/class/leds.

Opinions?

Marek

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-10-07 17:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-01 12:36 lets settle the LED `function` property regarding the netdev trigger Marek Behún
2021-10-03 18:56 ` Andrew Lunn
2021-10-03 19:26   ` Marek Behún
2021-10-04 14:50     ` Andrew Lunn
2021-10-04 15:08       ` Marek Behún
2021-10-04 17:28         ` Andrew Lunn
2021-10-05 20:30           ` Marek Behún
2021-10-05 21:52             ` Andrew Lunn
2021-10-05 19:58         ` Jacek Anaszewski
2021-10-05 20:12           ` Andrew Lunn
2021-10-05 20:26           ` Marek Behún
2021-10-05 21:01             ` Andrew Lunn
2021-10-05 21:43               ` Marek Behún
2021-10-05 22:06                 ` Andrew Lunn
2021-10-05 23:06                   ` Marek Behún
2021-10-06 12:57                     ` Andrew Lunn
2021-10-07 17:13                       ` Marek Behún

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).