netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] net: Add generic support for netdev LEDs
@ 2024-03-30 18:31 Andrew Lunn
  2024-03-30 18:31 ` [PATCH net-next v2 1/7] dsa: move call to driver port_setup after creation of netdev Andrew Lunn
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Andrew Lunn @ 2024-03-30 18:31 UTC (permalink / raw)
  To: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Russell King, Gregory Clement
  Cc: netdev, Andrew Lunn

For some devices, the MAC controls the LEDs in the RJ45 connector, not
the PHY. This patchset provides generic support for such LEDs, and
adds the first user, mv88e6xxx.

The common code netdev_leds_setup() is passed a DT node containing the
LEDs and a structure of operations to act on the LEDs. The core will
then create an cdev LED for each LED found in the device tree node.

The callbacks are passed the netdev, and the index of the LED. In
order to make use of this within DSA, helpers are added to convert a
netdev to a ds and port.

The mv88e6xxx has been extended to add basic support for the 6352
LEDs. Only software control is added, but the API supports hardware
offload which can be added to the mv88e6xxx driver later.

For testing and demonstration, the Linksys Mamba aka. wrt1900ac has
the needed DT nodes added to describe its LEDs.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v2:
- Validate maximum number of LEDs in core code
- Change Kconfig due to 0-day reports
- Link to v1: https://lore.kernel.org/r/20240317-v6-8-0-net-next-mv88e6xxx-leds-v4-v1-0-80a4e6c6293e@lunn.ch

---
Andrew Lunn (7):
      dsa: move call to driver port_setup after creation of netdev.
      net: Add helpers for netdev LEDs
      net: dsa: mv88e6xxx: Add helpers for 6352 LED blink and brightness
      net: dsa: mv88e6xxx: Tie the low level LED functions to device ops
      net: dsa: Add helpers to convert netdev to ds or port index
      dsa: mv88e6xxx: Create port/netdev LEDs
      arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs

 .../boot/dts/marvell/armada-xp-linksys-mamba.dts   |  66 +++++++
 drivers/net/dsa/mv88e6xxx/Kconfig                  |   1 +
 drivers/net/dsa/mv88e6xxx/chip.c                   | 125 ++++++++++++-
 drivers/net/dsa/mv88e6xxx/chip.h                   |  19 ++
 drivers/net/dsa/mv88e6xxx/port.c                   |  93 ++++++++++
 drivers/net/dsa/mv88e6xxx/port.h                   |  76 +++++++-
 include/net/dsa.h                                  |  17 ++
 include/net/netdev_leds.h                          |  45 +++++
 net/Kconfig                                        |  11 ++
 net/core/Makefile                                  |   1 +
 net/core/netdev-leds.c                             | 201 +++++++++++++++++++++
 net/dsa/devlink.c                                  |  17 +-
 net/dsa/dsa.c                                      |   3 +
 net/dsa/user.c                                     |   8 +
 net/dsa/user.h                                     |   7 -
 15 files changed, 665 insertions(+), 25 deletions(-)
---
base-commit: 537c2e91d3549e5d6020bb0576cf9b54a845255f
change-id: 20240316-v6-8-0-net-next-mv88e6xxx-leds-v4-ab77d73d52a4

Best regards,
-- 
Andrew Lunn <andrew@lunn.ch>


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

end of thread, other threads:[~2024-04-01 12:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30 18:31 [PATCH net-next v2 0/7] net: Add generic support for netdev LEDs Andrew Lunn
2024-03-30 18:31 ` [PATCH net-next v2 1/7] dsa: move call to driver port_setup after creation of netdev Andrew Lunn
2024-03-30 18:31 ` [PATCH net-next v2 2/7] net: Add helpers for netdev LEDs Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 3/7] net: dsa: mv88e6xxx: Add helpers for 6352 LED blink and brightness Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 4/7] net: dsa: mv88e6xxx: Tie the low level LED functions to device ops Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 5/7] net: dsa: Add helpers to convert netdev to ds or port index Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 6/7] dsa: mv88e6xxx: Create port/netdev LEDs Andrew Lunn
2024-03-31 15:55   ` Russell King (Oracle)
2024-04-01 12:43     ` Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 7/7] arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs Andrew Lunn
2024-03-31 16:35   ` Florian Fainelli

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