linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Dan Murphy <dmurphy@ti.com>, linux-leds@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, pavel@ucw.cz,
	devicetree@vger.kernel.org, dachaac@gmail.com,
	robh+dt@kernel.org
Subject: Re: [PATCH v2 1/2] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers
Date: Tue, 15 Jan 2019 22:42:23 +0100	[thread overview]
Message-ID: <45f28e71-54c5-dfa8-78b8-c68b2d39c019@gmail.com> (raw)
In-Reply-To: <20190114211723.11186-1-dmurphy@ti.com>

Hi Dan,

Thank you for the patch.

Seeing the mess with regs and led-modules I think
it will be better to abide by the regs alone.

Please see below how I would structure that.

On 1/14/19 10:17 PM, Dan Murphy wrote:
> Introduce the bindings for the Texas Instruments LP5036, LP5030, LP5024 and the LP5018
> RGB LED device driver.  The LP5036/3024/18 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/lp5024.pdf
> http://www.ti.com/lit/ds/symlink/lp5036.pdf
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
> 
> v2 - Added the LP5030/36 devices, defined the modules vs banked properties
> renamed the file from lp5024 to lp50xx. - https://lore.kernel.org/patchwork/patch/1026514/
> 
>   .../devicetree/bindings/leds/leds-lp50xx.txt  | 143 ++++++++++++++++++
>   1 file changed, 143 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..7bc6843ddba4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.txt
> @@ -0,0 +1,143 @@
> +* Texas Instruments - LP5018/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 strings.

Maybe it would be better to replace "strings" with "modules"?
Strings usually mean LEDs connected in a row, which is specific
to backlights.

> +Required properties:
> +	- compatible:
> +		"ti,lp5018"
> +		"ti,lp5024"
> +		"ti,lp5030"
> +		"ti,lp5036"
> +	- reg :  I2C slave address
> +		lp5018/24 - 0x28
> +		lp5030/36 - 0x30
> +	- #address-cells : 1
> +	- #size-cells : 0
> +
> +Optional properties:
> +	- enable-gpios : gpio pin to enable/disable the device.
> +	- vled-supply : LED supply
> +
> +Required child properties:
> +	- reg : Is the child node iteration.

Let's change it to:

- reg : RGB LED module number. For the node describing RGB cluster bank
         it should match first element of ti,led-bank array.

> +
> +Required Child properties but only one should be defined per child:
> +Either one of these two properties are required for each node.  The
> +property ti,led-bank takes precedence over the ti,led-module within the same
> +node.
> +
> +	- ti,led-module : This property denotes the single LED module number
> +			  that will be controlled in the LED class instance.

It will be not needed then.

> +	- 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.
> +
> +The LED outpus associated with the LED modules are defined in Table 1 of the
> +corresponding data sheets.
> +
> +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:
> +LP5018 and LP5024 example:
> +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>;
> +
> +	led@0 {
> +	        reg = <0>;
> +	        label = "led1_mod";
> +		ti,led-module = <1>;
> +	};
> +
> +	led@1 {
> +	        reg = <1>;
> +	        label = "banked_leds";
> +		ti,led-bank = <0 2 5 3 >;
> +	};
> +
> +	led@2 {
> +	        reg = <2>;
> +	        label = "led4_mod";
> +		ti,led-module = <4>;
> +	};
> +
> +	led@3 {
> +	        reg = <3>;
> +	        label = "led7_mod";
> +		ti,led-module = <7>;
> +	};
> +
> +	led@4 {
> +	        reg = <4>;
> +	        label = "led6_mod";
> +		ti,led-module = <6>;
> +	};

Without ti,led-module it will look like below:


led@0 {
         reg = <0>;
         label = "banked_leds";
         ti,led-bank = <0 2 5 3 >;
};

led@1 {
         reg = <1>;
         label = "led1_mod";
};


led@4 {
         reg = <4>;
         label = "led4_mod";
};

led@6 {
         reg = <6>;
         label = "led6_mod";
};

led@7 {
         reg = <7>;
         label = "led7_mod";
};



> +};
> +
> +LP5030 and LP5036 example:
> +led-controller@30 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	compatible = "ti,lp5036";
> +	reg = <0x30>;
> +	enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
> +	vled-supply = <&vmmcsd_fixed>;
> +
> +	led@0 {
> +	        reg = <0>;
> +	        label = "led1_mod";
> +		ti,led-module = <1>;
> +	};
> +
> +	led@1 {
> +	        reg = <1>;
> +	        label = "led_banked";
> +		ti,led-bank = <0 2 5 3 9 10 >;
> +	};
> +
> +	led@2 {
> +	        reg = <2>;
> +	        label = "led4_mod";
> +		ti,led-module = <4>;
> +	};
> +
> +	led@3 {
> +	        reg = <3>;
> +	        label = "led7_mod";
> +		ti,led-module = <7>;
> +	};
> +
> +	led@4 {
> +	        reg = <4>;
> +	        label = "led6_mod";
> +		ti,led-module = <6>;
> +	};
> +
> +	led@5 {
> +	        reg = <5>;
> +	        label = "led8_mod";
> +		ti,led-module = <8>;
> +	};
> +};
> +
> +
> +For more product information please see the link below:
> +http://www.ti.com/lit/ds/symlink/lp5024.pdf
> +http://www.ti.com/lit/ds/symlink/lp5036.pdf
> 

-- 
Best regards,
Jacek Anaszewski

      parent reply	other threads:[~2019-01-15 21:42 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 21:17 [PATCH v2 1/2] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers Dan Murphy
2019-01-14 21:17 ` [PATCH v2 2/2] leds: lp50xx: Add the LP50XX family of the RGB LED driver Dan Murphy
2019-01-15 21:47   ` Jacek Anaszewski
2019-01-15 22:22     ` Pavel Machek
2019-01-16  0:20       ` Dan Murphy
2019-01-16 10:55         ` Pavel Machek
2019-01-16 18:41           ` Dan Murphy
2019-01-16 22:04             ` Pavel Machek
2019-01-16 23:33               ` Dan Murphy
2019-01-17 10:06                 ` Pavel Machek
2019-01-17 13:27                   ` Dan Murphy
2019-01-17 21:10             ` Jacek Anaszewski
2019-01-18  0:02               ` RGB LED class " Pavel Machek
2019-01-18 15:57                 ` Dan Murphy
2019-01-28 23:03                   ` Pavel Machek
2019-01-18 22:13                 ` Jacek Anaszewski
2019-01-19 21:36                   ` Pavel Machek
2019-01-20 15:30                     ` Jacek Anaszewski
2019-01-21 19:38                       ` Jacek Anaszewski
2019-01-28 23:04                       ` Pavel Machek
2019-01-18 13:45               ` Dan Murphy
2019-01-18 13:58                 ` Dan Murphy
2019-01-20  6:42                   ` Vesa Jääskeläinen
2019-01-22 21:39                     ` Jacek Anaszewski
2019-01-22 22:44                       ` Dan Murphy
2019-01-23 21:52                         ` Jacek Anaszewski
2019-01-24 21:00                           ` Dan Murphy
2019-01-24 21:55                             ` Jacek Anaszewski
2019-01-29 13:56                               ` Dan Murphy
2019-01-29 20:19                                 ` Jacek Anaszewski
2019-01-29 20:26                                   ` Dan Murphy
2019-01-29 21:45                                     ` Pavel Machek
2019-01-29 21:46                                       ` Dan Murphy
2019-01-29 21:53                                     ` Jacek Anaszewski
2019-01-20 15:32                 ` Jacek Anaszewski
2019-01-17 21:08           ` Jacek Anaszewski
2019-01-19 19:11             ` Vesa Jääskeläinen
2019-01-19 21:46               ` Pavel Machek
2019-01-19 22:44                 ` Vesa Jääskeläinen
2019-01-20  6:51                 ` Vesa Jääskeläinen
2019-01-21 13:27               ` Dan Murphy
2019-01-21 15:12                 ` Vesa Jääskeläinen
2019-01-24 20:32     ` Dan Murphy
2019-01-24 21:14       ` Jacek Anaszewski
2019-01-15 21:42 ` Jacek Anaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45f28e71-54c5-dfa8-78b8-c68b2d39c019@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dachaac@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).