linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC leds + net-next v2 0/1] Add support for LEDs on Marvell PHYs
@ 2020-07-23 18:13 Marek Behún
  2020-07-23 18:13 ` [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class Marek Behún
  2020-07-24 10:29 ` [PATCH RFC leds + net-next v2 0/1] Add support for LEDs on Marvell PHYs Pavel Machek
  0 siblings, 2 replies; 13+ messages in thread
From: Marek Behún @ 2020-07-23 18:13 UTC (permalink / raw)
  To: linux-leds
  Cc: Pavel Machek, jacek.anaszewski, Dan Murphy, Ondřej Jirman,
	netdev, Russell King, Thomas Petazzoni, Gregory Clement,
	Andrew Lunn, linux-kernel, Marek Behún

Hi,

this is v2 of my RFC adding support for LEDs connected to Marvell PHYs.

The LED subsystem patches are not contained:
- the patch adding support for LED private triggers is already accepted
  in Pavel Machek's for-next tree.
  If you want to try this patch on top of net-next, please also apply
  https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/commit/?h=for-next&id=93690cdf3060c61dfce813121d0bfc055e7fa30d
- the other led-trigger patch is not needed in this version of the RFC

The main difference from v1 is that only one trigger, named
"hw-control", is added to the /sys/class/leds/<LED>/trigger file.

When this trigger is activated, another file called "hw_control" is
created in the /sys/class/leds/<LED>/ directory. This file lists
available HW control modes for this LED in the same way the trigger
file does for triggers.

Example:

  # cd /sys/class/leds/eth0\:green\:link/
  # cat trigger
  [none] hw-control timer oneshot heartbeat ...
  # echo hw-control >trigger
  # cat trigger
  none [hw-control] timer oneshot heartbeat ...
  # cat hw_control
  link/nolink link/act/nolink 1000/100/10/nolink act/noact
  blink-act/noact transmit/notransmit copperlink/else [1000/else]
  force-hi-z force-blink
  # echo 1000/100/10/nolink >hw_control
  # cat hw_control
  link/nolink link/act/nolink [1000/100/10/nolink] act/noact
  blink-act/noact transmit/notransmit copperlink/else 1000/else
  force-hi-z force-blink

The benefit here is that only one trigger is registered via LED API.
I guess there are other PHY drivers which too support HW controlled
blinking modes. So of this way of controlling PHY LED HW controlled
modes is accepted, the code creating the hw-control trigger and
hw_control file should be made into library code so that it can be
reused.

What do you think?

Marek

Marek Behún (1):
  net: phy: marvell: add support for PHY LEDs via LED class

 drivers/net/phy/Kconfig   |   7 +
 drivers/net/phy/marvell.c | 423 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 429 insertions(+), 1 deletion(-)

-- 
2.26.2


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

end of thread, other threads:[~2020-07-25  9:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 18:13 [PATCH RFC leds + net-next v2 0/1] Add support for LEDs on Marvell PHYs Marek Behún
2020-07-23 18:13 ` [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class Marek Behún
2020-07-23 21:35   ` Andrew Lunn
2020-07-23 21:44     ` Pavel Machek
2020-07-23 21:46     ` Marek Behun
2020-07-23 22:53     ` Marek Behun
2020-07-24 10:24       ` Pavel Machek
2020-07-24 13:11         ` Andrew Lunn
2020-07-25  9:41           ` Pavel Machek
2020-07-24 10:29 ` [PATCH RFC leds + net-next v2 0/1] Add support for LEDs on Marvell PHYs Pavel Machek
2020-07-24 13:12   ` Marek Behún
2020-07-24 13:18     ` Marek Behún
2020-07-24 22:38     ` Pavel Machek

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