Re: [PATCH v6 2/3] dt-bindings: leds: Add multicolor PWM LED bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

On 2/10/22 10:33, Alexander Dahl wrote:
I don't see how naming them led-{0,1,2} would be better in any way, please
elaborate.

- consistency with other LED driver bindings
- spot the number of "sub"-LEDs more easily
- prevent all kinds of different names people will come up with, if
   all is allowed instead of a clear scheme

The color is in the color property anyways.

Let's hear what others on this list say. I don't feel too strongly about this either way.

I would have expected something like this:

   led-controller-0 {
       compatible = "pwm-leds-multicolor";

       multi-led-0 {
         color = <LED_COLOR_ID_RGB>;
         function = LED_FUNCTION_INDICATOR;
         max-brightness = <65535>;

         led-0 {
             pwms = <&pwm1 0 1000000>;
             color = <LED_COLOR_ID_RED>;
         };

         led-1 {
             pwms = <&pwm2 0 1000000>;
             color = <LED_COLOR_ID_GREEN>;
         };

         led-2 {
             pwms = <&pwm3 0 1000000>;
             color = <LED_COLOR_ID_BLUE>;
         };
       };

       multi-led-1 {
         color = <LED_COLOR_ID_RGB>;
         function = LED_FUNCTION_INDICATOR;
         max-brightness = <65535>;

         led-0 {
             pwms = <&pwm1 0 1000000>;
             color = <LED_COLOR_ID_RED>;
         };

         led-1 {
             pwms = <&pwm2 0 1000000>;
             color = <LED_COLOR_ID_GREEN>;
         };

         led-2 {
             pwms = <&pwm3 0 1000000>;
             color = <LED_COLOR_ID_BLUE>;
         };
       };
   };

That would make the driver more complex. I'm not sure that would be worth it. Additionally, we'd have to change the node name pattern for the multi LED class. Other opinions?

Best regards,
Sven



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux