Re: [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage

Luiz Angelo Daros de Luca
2024-03-21T12:03:48Z

Hi Andrew,

Em dom., 10 de mar. de 2024 às 15:02, Andrew Lunn <andrew@lunn.ch> escreveu:
>> On Sun, Mar 10, 2024 at 01:51:58AM -0300, Luiz Angelo Daros de Luca wrote:
> > Each port can have up to 4 LEDs (3 for current rtl8365mb devices). The
> > LED reg property will indicate its LED group.
> > + properties:
> > + reg:
> > + description:
> > + "reg indicates the LED group for this LED"
> > + enum: [0, 1, 2, 3]
>
> If this identifies the group, what identifies the actual LED? There
> are four of them. How do i say LEDs 0 and 1 are unused, 2 and 3 are
> wired to LEDs?

Do we need to mention a specific HW is not present? I guess we just
omit it, like the led@1 and led@2 in the example.

> It would be much more usual for reg to be the LED number for the
> port. And there then be a group property indicating what group the LED
> belongs to. However, i'm wondering, is group fixed? Do we actually
> need it in DT, or can there just be a table in the driver which maps
> port:led to group?

The LED groups are a fixed HW feature. The chip has dedicated pins for
each LED in each group. Those pins might have an alternative usage (as
an GPIO) but you cannot change a LED from a group to another in SW.
That's why I thought it was a thing to be described in the DT.

> Andrew

Regards,

Luiz