Re: [PATCH v5 3/3] dt-bindings: leds: Convert pwm to yaml
From: Rob Herring
Date: Tue Sep 29 2020 - 09:59:02 EST
On Tue, Sep 29, 2020 at 2:39 AM Alexander Dahl <ada@xxxxxxxxxxx> wrote:
>
> Hei hei,
>
> Am Dienstag, 22. September 2020, 17:57:47 CEST schrieb Rob Herring:
> > Use generic node names:
> >
> > led-controller {
> >
> > > + compatible = "pwm-leds";
> > > +
> > > + led-1 {
> > > + label = "omap4::keypad";
> > > + pwms = <&twl_pwm 0 7812500>;
> > > + max-brightness = <127>;
> > > + };
> > > +
> > > + led-2 {
> > > + color = <LED_COLOR_ID_GREEN>;
> > > + function = LED_FUNCTION_CHARGING;
> > > + pwms = <&twl_pwmled 0 7812500>;
> > > + max-brightness = <255>;
> > > + };
> > > + };
> > > +
> > > +...
>
> This is clear for the "one led-controller" case. However, when trying to fix
> those node names in existing .dts files, I wondered how those should be named
> for multiple, different led-controllers, e.g. one using "pwm-leds" and another
> one using "gpio-leds"?
>
> See arch/arm/boot/dts/at91-kizbox3-hs.dts for example, the nodes are called
> "pwm_leds" and "leds" currently. If both were part of a .dtsi and both named
> the same, you could not overwrite/complement those in a .dts file including
> that .dtsi due to a name conflict.
>
> Just append a numerical index like this?
>
> led-controller-1 {
> …
> };
>
> led-controller-2 {
> …
> };
Yes, that's generally what we've been doing.
Rob