Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Dan Murphy <dmurphy@ti.com>, pavel@ucw.cz
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 06/16] leds: lp50xx: Add the LP50XX family of the RGB LED driver
Date: Fri, 11 Oct 2019 22:04:44 +0200
Message-ID: <2fe811df-d9d8-1608-6ad1-060b49df5b8f@gmail.com> (raw)
In-Reply-To: <20191011130657.4713-7-dmurphy@ti.com>

Dan,

On 10/11/19 3:06 PM, Dan Murphy wrote:
> Introduce the LP5036/30/24/18/12/9 RGB LED driver.
> The difference in these parts are the number of
> LED outputs where the:
> 
> LP5036 can control 36 LEDs
> LP5030 can control 30 LEDs
> LP5024 can control 24 LEDs
> LP5018 can control 18 LEDs
> LP5012 can control 12 LEDs
> LP5009 can control 9 LEDs
> 
> The device has the ability to group LED output into control banks
> so that multiple LED banks can be controlled with the same mixing and
> brightness.  Inversely the LEDs can also be controlled independently.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  drivers/leds/Kconfig       |  11 +
>  drivers/leds/Makefile      |   1 +
>  drivers/leds/leds-lp50xx.c | 799 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 811 insertions(+)
>  create mode 100644 drivers/leds/leds-lp50xx.c
> 
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index a1ede89afc9e..fb614a6b9afa 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -363,6 +363,17 @@ config LEDS_LP3952
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called leds-lp3952.
>  
> +config LEDS_LP50XX
> +	tristate "LED Support for TI LP5036/30/24/18/12/9 LED driver chip"
> +	depends on LEDS_CLASS && REGMAP_I2C
> +	depends on LEDS_CLASS_MULTI_COLOR
> +	help
> +	  If you say yes here you get support for the Texas Instruments
> +	  LP5036, LP5030, LP5024, LP5018, LP5012 and LP5009 LED driver.
> +
> +	  To compile this driver as a module, choose M here: the
> +	  module will be called leds-lp50xx.
> +
>  config LEDS_LP55XX_COMMON
>  	tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"
>  	depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index 841038cfe35b..7a208a0f7b84 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -34,6 +34,7 @@ obj-$(CONFIG_LEDS_GPIO_REGISTER)	+= leds-gpio-register.o
>  obj-$(CONFIG_LEDS_GPIO)			+= leds-gpio.o
>  obj-$(CONFIG_LEDS_LP3944)		+= leds-lp3944.o
>  obj-$(CONFIG_LEDS_LP3952)		+= leds-lp3952.o
> +obj-$(CONFIG_LEDS_LP50XX)		+= leds-lp50xx.o
>  obj-$(CONFIG_LEDS_LP55XX_COMMON)	+= leds-lp55xx-common.o
>  obj-$(CONFIG_LEDS_LP5521)		+= leds-lp5521.o
>  obj-$(CONFIG_LEDS_LP5523)		+= leds-lp5523.o
> diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
[...]
> +		fwnode_for_each_child_node(child, led_node) {
> +			ret = fwnode_property_read_u32(led_node, "color",
> +						       &color_id);
> +			if (ret)
> +				dev_err(&priv->client->dev,
> +				"Cannot read color\n");
> +
> +			set_bit(color_id, &led->mc_cdev.available_colors);
> +			num_colors++;
> +
> +		}
> +
> +		led->priv = priv;
> +		led->mc_cdev.num_leds = num_colors;
> +		led->mc_cdev.led_cdev = &led->led_dev;
> +		led->led_dev.brightness_set_blocking = lp50xx_brightness_set;
> +		led->led_dev.brightness_get = lp50xx_brightness_get;
> +		ret = led_classdev_multicolor_register_ext(&priv->client->dev,
> +						       &led->mc_cdev,
> +						       &init_data);

s/led_classdev/devm_led_classdev/

> +		if (ret) {
> +			dev_err(&priv->client->dev, "led register err: %d\n",
> +				ret);
> +			fwnode_handle_put(child);
> +			goto child_out;
> +		}
> +		i++;
> +	}
> +
> +child_out:
> +	return ret;
> +}
> +


-- 
Best regards,
Jacek Anaszewski

  reply index

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 13:06 [PATCH v12 00/16] Multicolor Framework v12 Dan Murphy
2019-10-11 13:06 ` [PATCH v12 01/16] dt: bindings: Add multicolor class dt bindings documention Dan Murphy
2019-10-11 13:06 ` [PATCH v12 02/16] dt-bindings: leds: Add multicolor ID to the color ID list Dan Murphy
2019-10-11 13:06 ` [PATCH v12 03/16] " Dan Murphy
2019-10-11 13:06 ` [PATCH v12 04/16] leds: multicolor: Introduce a multicolor class definition Dan Murphy
2019-10-11 19:53   ` Jacek Anaszewski
2019-10-14  6:18   ` kbuild test robot
2019-10-11 13:06 ` [PATCH v12 05/16] dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers Dan Murphy
2019-10-11 13:06 ` [PATCH v12 06/16] leds: lp50xx: Add the LP50XX family of the RGB LED driver Dan Murphy
2019-10-11 20:04   ` Jacek Anaszewski [this message]
2019-10-14  9:17   ` kbuild test robot
2019-10-19 17:13     ` Jacek Anaszewski
2019-10-21 11:46       ` Dan Murphy
2019-10-11 13:06 ` [PATCH v12 07/16] dt: bindings: lp55xx: Be consistent in the document with LED acronym Dan Murphy
2019-10-11 13:06 ` [PATCH v12 08/16] dt: bindings: lp55xx: Update binding for Multicolor Framework Dan Murphy
2019-10-11 20:15   ` Jacek Anaszewski
2019-10-12  0:54     ` Dan Murphy
2019-10-12 13:32       ` Jacek Anaszewski
2019-10-11 13:06 ` [PATCH v12 09/16] ARM: dts: n900: Add reg property to the LP5523 channel node Dan Murphy
2019-10-11 13:06 ` [PATCH v12 10/16] ARM: dts: imx6dl-yapp4: Add reg property to the lp5562 " Dan Murphy
2019-10-11 13:06 ` [PATCH v12 11/16] ARM: dts: ste-href: Add reg property to the LP5521 channel nodes Dan Murphy
2019-10-11 13:06 ` [PATCH v12 12/16] leds: lp55xx: Add multicolor framework support to lp55xx Dan Murphy
2019-10-11 20:36   ` Jacek Anaszewski
2019-10-12  0:50     ` Dan Murphy
2019-10-12 13:27       ` Jacek Anaszewski
2019-10-11 13:06 ` [PATCH v12 13/16] leds: lp5523: Update the lp5523 code to add intensity function Dan Murphy
2019-10-11 13:06 ` [PATCH v12 14/16] leds: lp5521: Add multicolor framework intensity support Dan Murphy
2019-10-11 13:06 ` [PATCH v12 15/16] leds: lp55xx: Fix checkpatch file permissions issues Dan Murphy
2019-10-11 13:06 ` [PATCH v12 16/16] leds: lp5523: Fix checkpatch issues in the code Dan Murphy
2019-10-11 19:40 ` [PATCH v12 00/16] Multicolor Framework v12 Jacek Anaszewski
2019-10-12  0:48   ` Dan Murphy

Reply instructions:

You may reply publically 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=2fe811df-d9d8-1608-6ad1-060b49df5b8f@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git