Re: [PATCH v8 7/9] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers

From: Jacek Anaszewski
Date: Mon Sep 23 2019 - 17:42:10 EST


Dan,

On 9/23/19 5:28 PM, Dan Murphy wrote:
> Jacek
>
> On 9/21/19 10:13 AM, Jacek Anaszewski wrote:
>> Dan,
>>
>> On 9/20/19 7:41 PM, Dan Murphy wrote:
>>> Introduce the bindings for the Texas Instruments LP5036, LP5030, LP5024,
>>> LP5018, LP5012 and LP5009 RGB LED device driver. The
>>> LP5036/30/24/18/12/9
>>> can control RGB LEDs individually or as part of a control bank group.
>>> These devices have the ability to adjust the mixing control for the RGB
>>> LEDs to obtain different colors independent of the overall brightness of
>>> the LED grouping.
>>>
>>> Datasheet:
>>> http://www.ti.com/lit/ds/symlink/lp5012.pdf
>>> http://www.ti.com/lit/ds/symlink/lp5024.pdf
>>> http://www.ti.com/lit/ds/symlink/lp5036.pdf
>>>
>>> Signed-off-by: Dan Murphy <dmurphy@xxxxxx>
>>> ---
>>>  .../devicetree/bindings/leds/leds-lp50xx.txt | 148 ++++++++++++++++++
>>> Â 1 file changed, 148 insertions(+)
>>> Â create mode 100644
>>> Documentation/devicetree/bindings/leds/leds-lp50xx.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.txt
>>> b/Documentation/devicetree/bindings/leds/leds-lp50xx.txt
>>> new file mode 100644
>>> index 000000000000..9d05f43042e0
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.txt
>>> @@ -0,0 +1,148 @@
>>> +* Texas Instruments - LP5009/12/18/24/30/36 RGB LED driver
>>> +
>>> +The LP50XX is multi-channel, I2C RGB LED Drivers that can group RGB
>>> LEDs into
>>> +a LED group or control them individually.
>>> +
>>> +The difference in these RGB LED drivers is the number of supported
>>> RGB modules.
>>> +
>>> +Required parent properties:
>>> +ÂÂÂ - compatible:
>>> +ÂÂÂÂÂÂÂ "ti,lp5009"
>>> +ÂÂÂÂÂÂÂ "ti,lp5012"
>>> +ÂÂÂÂÂÂÂ "ti,lp5018"
>>> +ÂÂÂÂÂÂÂ "ti,lp5024"
>>> +ÂÂÂÂÂÂÂ "ti,lp5030"
>>> +ÂÂÂÂÂÂÂ "ti,lp5036"
>>> +ÂÂÂ - reg :Â I2C slave address
>>> +ÂÂÂÂÂÂÂ lp5009/12 - 0x28
>>> +ÂÂÂÂÂÂÂ lp5018/24 - 0x28
>>> +ÂÂÂÂÂÂÂ lp5030/36 - 0x30
>>> +ÂÂÂ - #address-cells : 1
>>> +ÂÂÂ - #size-cells : 0
>>> +
>>> +Optional parent properties:
>>> +ÂÂÂ - enable-gpios : gpio pin to enable/disable the device.
>>> +ÂÂÂ - vled-supply : LED supply
>>> +
>>> +Required child properties:
>>> +ÂÂÂ - #address-cells : 1
>>> +ÂÂÂ - #size-cells : 0
>>> +ÂÂÂ - reg : This is the LED module number.
>>> +ÂÂÂ - color : see Documentation/devicetree/bindings/leds/common.txt
>>> +ÂÂÂ - function : see Documentation/devicetree/bindings/leds/common.txt
>>> +
>>> +Required child properties only is LED modules will be banked:
>>> +ÂÂÂ - ti,led-bank : This property denotes the LED module numbers
>>> that will
>>> + be controlled as a single RGB cluster. Each LED module
>>> +ÂÂÂÂÂÂÂÂÂÂÂ number will be controlled by a single LED class instance.
>>> +ÂÂÂÂÂÂÂÂÂÂÂ There can only be one instance of the ti,led-bank
>>> +ÂÂÂÂÂÂÂÂÂÂÂ property for each device node.
>>> +
>>> +Required grandchildren properties:
>>> +ÂÂÂ - reg : A single entry denoting the LED module that controls
>>> +ÂÂÂÂÂÂÂ the RGB cluster.
>>> +ÂÂÂ - color : see
>>> Documentation/devicetree/bindings/leds/leds-multicolor.txt
>>> +ÂÂÂ - led-sources : see
>>> Documentation/devicetree/bindings/leds/common.txt
>>> +
>>> +The LED outputs associated with the LED modules are defined in Table
>>> 1 of the
>>> +corresponding data sheets.
>> We must enclose this information here.
>
> That will make this doc pretty messy especially with the LP5036 entries.
>
> I would have to do ascii art to make it understandable and basically
> there is not a delta in the lesser devices in the outputs
>
> I don't see value in reproducing this data sheet contents in the
> dt-bindings.

IMO DT bindings should be self-contained. We cannot assume that
user will always have Internet access.

> For example (LP5012) and then for the LP5036 multiply this by 3
>
> Table 1.
>
> Bank Number and LED Number Assignment
> OUT NUMBER BANK NUMBERÂ RGB LED MODULE NUMBER
> OUT0ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Bank A
> OUT1 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank BÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ LED0
> OUT2 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank C
>
> OUT3 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank A
> OUT4 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank BÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ LED1
> OUT5 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank C
>
> OUT6 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank A
> OUT7 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank BÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ LED2
> OUT8 ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂ Bank C
>
> OUT9 (LP5012 only) Bank A
> OUT10 (LP5012 only) Bank BÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â LED3
> OUT11 (LP5012 only) Bank C


I'd say it is required. But let's wait for DT guys' opinion.


>>> +
>>> +LP5009 - 2 Total RGB cluster LED outputs 0-1
>
> This should be 3 total not 2
>
> Dan
>
>>> +LP5012 - 4 Total RGB cluster LED outputs 0-3
>>> +LP5018 - 6 Total RGB cluster LED outputs 0-5
>>> +LP5024 - 8 Total RGB cluster LED outputs 0-7
>>> +LP5030 - 10 Total RGB cluster LED outputs 0-9
>>> +LP5036 - 12 Total RGB cluster LED outputs 0-11
>>> +
>>> +Optional child properties:
>>> +ÂÂÂ - label : see Documentation/devicetree/bindings/leds/common.txt
>>> +ÂÂÂ - linux,default-trigger :
>>> +ÂÂÂÂÂÂ see Documentation/devicetree/bindings/leds/common.txt
>>> +
>>> +Examples:
>>> +led-controller@29 {
>>> +ÂÂÂ #address-cells = <1>;
>>> +ÂÂÂ #size-cells = <0>;
>>> +ÂÂÂ compatible = "ti,lp5024";
>>> +ÂÂÂ reg = <0x29>;
>>> +ÂÂÂ enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
>>> +ÂÂÂ vled-supply = <&vmmcsd_fixed>;
>>> +
>>> +ÂÂÂ multi-led@1 {
>>> +ÂÂÂÂÂÂÂ #address-cells = <1>;
>>> +ÂÂÂÂÂÂÂ #size-cells = <0>;
>>> +ÂÂÂÂÂÂÂ reg = <1>;
>>> +ÂÂÂÂÂÂÂ color = <LED_COLOR_ID_MULTI>;
>>> +ÂÂÂÂÂÂÂ function = LED_FUNCTION_STATUS;
>>> +
>>> +ÂÂÂÂÂÂÂ led@3 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <3>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_RED>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@4 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <4>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_GREEN>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@5 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <5>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_BLUE>;
>>> +ÂÂÂÂÂÂÂ };
>>> +ÂÂÂ };
>>> +
>>> +ÂÂÂ multi-led@2 {
>>> +ÂÂÂÂÂÂÂ #address-cells = <1>;
>>> +ÂÂÂÂÂÂÂ #size-cells = <0>;
>>> +ÂÂÂÂÂÂÂ reg = <2>;
>>> +ÂÂÂÂÂÂÂ color = <LED_COLOR_ID_MULTI>;
>>> +ÂÂÂÂÂÂÂ function = LED_FUNCTION_STANDBY;
>>> +ÂÂÂÂÂÂÂ ti,led-bank = <2 3 5>;
>>> +
>>> +ÂÂÂÂÂÂÂ led@6 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <0x6>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_RED>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ led-sources = <6 9 15>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@7 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <0x7>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_GREEN>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ led-sources = <7 10 16>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@8 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <0x8>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_BLUE>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ led-sources = <8 11 17>;
>>> +ÂÂÂÂÂÂÂ };
>>> +ÂÂÂ };
>>> +
>>> +ÂÂÂ multi-led@4 {
>>> +ÂÂÂÂÂÂÂ #address-cells = <1>;
>>> +ÂÂÂÂÂÂÂ #size-cells = <0>;
>>> +ÂÂÂÂÂÂÂ reg = <4>;
>>> +ÂÂÂÂÂÂÂ color = <LED_COLOR_ID_MULTI>;
>>> +ÂÂÂÂÂÂÂ function = LED_FUNCTION_ACTIVITY;
>>> +
>>> +ÂÂÂÂÂÂÂ led@12 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <12>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_RED>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@13 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <13>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_GREEN>;
>>> +ÂÂÂÂÂÂÂ };
>>> +
>>> +ÂÂÂÂÂÂÂ led@14 {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ reg = <14>;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ color = <LED_COLOR_ID_BLUE>;
>>> +ÂÂÂÂÂÂÂ };
>>> +ÂÂÂ };
>>> +};
>>> +
>>> +For more product information please see the link below:
>>> +http://www.ti.com/lit/ds/symlink/lp5012.pdf
>>> +http://www.ti.com/lit/ds/symlink/lp5024.pdf
>>> +http://www.ti.com/lit/ds/symlink/lp5036.pdf
>>>
>

--
Best regards,
Jacek Anaszewski