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/9/22 10:17, Alexander Dahl wrote:
+    rgb-led {

I think this should be 'led-controller'. See
Documentation/devicetree/bindings/leds/common.yaml for reference.

Sure, I don't have a preference.

+        multi-led {
+          color = <LED_COLOR_ID_RGB>;
+          function = LED_FUNCTION_INDICATOR;
+          max-brightness = <65535>;
+
+          led-red {
+              pwms = <&pwm1 0 1000000>;
+              color = <LED_COLOR_ID_RED>;
+          };
+
+          led-green {
+              pwms = <&pwm2 0 1000000>;
+              color = <LED_COLOR_ID_GREEN>;
+          };
+
+          led-blue {
+              pwms = <&pwm3 0 1000000>;
+              color = <LED_COLOR_ID_BLUE>;
+          };

Not sure if those node names should be more generic like led-0, led-1
etc.?  At least the color information is redundant here.  This would
make it more similar to bindings of other LED drivers.

I don't see how naming them led-{0,1,2} would be better in any way, please elaborate.

And how is it supposed to be named if you have multiple
"multi-led"s, e.g. one on three PWM channels, and another one on three
different PWM channels?

I'm not 100% sure what you mean. If you want multiple instances of these multi-color PWM LEDs, you'd do something like this:

indicator-led-controller {
    compatible = "pwm-leds-multicolor";
    multi-led {
      color = <LED_COLOR_ID_RGB>;
      function = LED_FUNCTION_INDICATOR;
      max-brightness = <65535>;
      led-red {
          pwms = <&pwm1 0 1000000>;
          color = <LED_COLOR_ID_RED>;
      };
      led-green {
          pwms = <&pwm2 0 1000000>;
          color = <LED_COLOR_ID_GREEN>;
      };
      led-blue {
          pwms = <&pwm3 0 1000000>;
          color = <LED_COLOR_ID_BLUE>;
      };
    };
};
status-led-controller {
    compatible = "pwm-leds-multicolor";
    multi-led {
      color = <LED_COLOR_ID_MULTI>;
      function = LED_FUNCTION_STATUS;
      max-brightness = <255>;
      led-red {
          pwms = <&pwm4 0 1000000>;
          color = <LED_COLOR_ID_RED>;
      };
      led-amber {
          pwms = <&pwm5 0 1000000>;
          color = <LED_COLOR_ID_AMBER>;
      };
    };
};



[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