Re: [PATCH net-next 3/3] net: dsa: lan9303: add LED mode configuration

From: Andrew Lunn

Date: Thu Nov 26 2026 - 10:05:35 EST


On Thu, Nov 26, 2026 at 03:13:45PM +0100, Paul Louvel wrote:
> The LED function of the LAN9303 and LAN9354 is selected by a single
> LED_FUN field that applies to all six LED pins of the two external
> ports.
>
> On some boards the LED straps double as configuration straps for other
> functions, such as the PHY address or the EEPROM size, so the desired
> LED mode cannot be strapped and has to be programmed by the driver.
>
> The LED subsystem is not used here: it models each LED independently,
> while this hardware has one function field for all LEDs.

Ah. This should of been in the cover letter...

[Goes and looks at the data sheet]

https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/00002308A.pdf

So you have the choice of using the pin as a GPIO. So you can
implement pure on/off. That gives you the minimum you need for
/sys/class/leds.

TABLE 12-1: LED OPERATION AS A FUNCTION OF LED_FUN[1:0]

The functions are rather scattered all over the place, but i don't see
a blocker to supporting hardware offload. It will be messy, yes, but
possible.

We have been pushing back on vendor properties for LEDs for a number
of years, so i don't really want to add one now.

Andrew