netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>,
	 Vladimir Oltean <olteanv@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Russell King <linux@armlinux.org.uk>,
	 Gregory Clement <gregory.clement@bootlin.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	 Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: [PATCH net-next v4 0/8] net: Add generic support for netdev LEDs
Date: Sat, 06 Apr 2024 15:13:27 -0500	[thread overview]
Message-ID: <20240406-v6-8-0-net-next-mv88e6xxx-leds-v4-v4-0-eb97665e7f96@lunn.ch> (raw)

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 v4:
- Fix leak of OF nodes
- Switch -> switch
- Replace patch with Vladimirs 3 patches.
- Drop new helpers, use dsa_port_from_netdev()
- One list head per netdev/port, not shared
- Drop usage of devm_led_classdev_register_ext() which might be unsafe.
- Link to v3: https://lore.kernel.org/r/20240401-v6-8-0-net-next-mv88e6xxx-leds-v4-v3-0-221b3fa55f78@lunn.ch

Changes in v3:
- Change Internet port LED from LED_FUNCTION_LAN to LED_FUNCTION_WAN
- Another attempt to get Kconfig correct
- Link to v2: https://lore.kernel.org/r/20240330-v6-8-0-net-next-mv88e6xxx-leds-v4-v2-0-fc5beb9febc5@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 (5):
      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
      dsa: mv88e6xxx: Create port/netdev LEDs
      arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs

Vladimir Oltean (3):
      net: dsa: consolidate setup and teardown for shared ports
      net: dsa: break out port setup and teardown code per port type
      net: dsa: move call to driver port_setup after creation of netdev

 .../boot/dts/marvell/armada-xp-linksys-mamba.dts   |  53 ++++++
 drivers/net/dsa/mv88e6xxx/Kconfig                  |   1 +
 drivers/net/dsa/mv88e6xxx/chip.c                   | 127 ++++++++++++-
 drivers/net/dsa/mv88e6xxx/chip.h                   |  20 +++
 drivers/net/dsa/mv88e6xxx/port.c                   |  93 ++++++++++
 drivers/net/dsa/mv88e6xxx/port.h                   |  76 +++++++-
 include/net/netdev_leds.h                          |  50 ++++++
 net/Kconfig                                        |  11 ++
 net/core/Makefile                                  |   1 +
 net/core/netdev-leds.c                             | 199 +++++++++++++++++++++
 net/dsa/devlink.c                                  |  17 +-
 net/dsa/dsa.c                                      | 177 ++++++++++++------
 12 files changed, 752 insertions(+), 73 deletions(-)
---
base-commit: 3b4cf29bdab08328dfab5bb7b41a62937ea5b379
change-id: 20240316-v6-8-0-net-next-mv88e6xxx-leds-v4-ab77d73d52a4

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


             reply	other threads:[~2024-04-06 20:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 20:13 Andrew Lunn [this message]
2024-04-06 20:13 ` [PATCH net-next v4 1/8] net: dsa: consolidate setup and teardown for shared ports Andrew Lunn
2024-04-06 20:13 ` [PATCH net-next v4 2/8] net: dsa: break out port setup and teardown code per port type Andrew Lunn
2024-04-06 20:13 ` [PATCH net-next v4 3/8] net: dsa: move call to driver port_setup after creation of netdev Andrew Lunn
2024-04-10 23:50   ` Vladimir Oltean
2024-04-06 20:13 ` [PATCH net-next v4 4/8] net: Add helpers for netdev LEDs Andrew Lunn
2024-04-07 17:26   ` Andrew Lunn
2024-04-10 23:32   ` Vladimir Oltean
2024-04-06 20:13 ` [PATCH net-next v4 5/8] net: dsa: mv88e6xxx: Add helpers for 6352 LED blink and brightness Andrew Lunn
2024-04-06 20:13 ` [PATCH net-next v4 6/8] net: dsa: mv88e6xxx: Tie the low level LED functions to device ops Andrew Lunn
2024-04-06 20:13 ` [PATCH net-next v4 7/8] dsa: mv88e6xxx: Create port/netdev LEDs Andrew Lunn
2024-04-10 23:45   ` Vladimir Oltean
2024-04-06 20:13 ` [PATCH net-next v4 8/8] arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs Andrew Lunn

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=20240406-v6-8-0-net-next-mv88e6xxx-leds-v4-v4-0-eb97665e7f96@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.clement@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.com \
    /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).