Re: [PATCH RFC] net: dsa: mv88e6xxx: Support LED control

From: Linus Walleij
Date: Sat Nov 25 2023 - 18:46:19 EST


On Thu, Nov 23, 2023 at 5:13 PM Andrew Lunn <andrew@xxxxxxx> wrote:

> What i would really like to see happen is that the DSA core handles
> the registration of the LEDs, similar to how phylib does. The DT
> binding should be identical for all DSA devices, so there is no need
> for each driver to do its own parsing.
>
> There are some WIP patches at
>
> https://github.com/lunn/linux.git leds-offload-support-reduced-auto-netdev
>
> which implement this. Feel free to make use of them.

Oh it's quite a lot of patches, I really cannot drive that because there are
so many things about them that I don't understand the thinking behind...
But I like what I see!

While I defined the bits a bit differently, some of it looks similar enough.

> > +/* Entries are listed in selector order */
> > +static const struct mv88e6xxx_led_hwconfig mv88e6xxx_led_hwconfigs[] = {
>
> You need to be careful with naming. These are probably specific to the
> 6352. Different switches probably have different capabilities. So it
> would be good to have the names reflect the switch family they are
> valid for.

OK I'll try to name them like such.

> When we come to add support for other switch families, i wounder how
> tables like this scale. Is there some things which can be shared, if
> we break the table up? I need to check the data sheets.

We will see I guess. It falls back to the whole question of whether
supporting all variants in a single module is even scaling. So far
it does I guess? One day the MV88E6xxx may need to be broken
into submodules.

Yours,
Linus Walleij