All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Lee Jones <lee@kernel.org>
Cc: Pavel Machek <pavel@kernel.org>,  Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Steffen Trumtrar <kernel@pengutronix.de>,
	linux-leds@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] leds: rgb: lp5860: add enable-gpio
Date: Thu, 05 Mar 2026 09:57:52 +0100	[thread overview]
Message-ID: <875x7avejz.fsf@pengutronix.de> (raw)
In-Reply-To: <20260217-v6-19-topic-ti-lp5860-enable-gpio-v1-2-f5e8edeb5d74@pengutronix.de> (Steffen Trumtrar's message of "Tue, 17 Feb 2026 16:35:17 +0100")

On 2026-02-17 at 16:35 +01, Steffen Trumtrar <s.trumtrar@pengutronix.de> wrote:

Hi!

> The VIO_EN pin can either be connected with VIO power supply or GPIO.
> Get the GPIO from DT if provided and set it on chip enable and disable.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
>  drivers/leds/rgb/leds-lp5860-core.c       | 10 ++++++++++
>  include/linux/platform_data/leds-lp5860.h |  1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/drivers/leds/rgb/leds-lp5860-core.c b/drivers/leds/rgb/leds-lp5860-core.c
> index 28b4d86e11f1a..1f349aa53f7a9 100644
> --- a/drivers/leds/rgb/leds-lp5860-core.c
> +++ b/drivers/leds/rgb/leds-lp5860-core.c
> @@ -61,6 +61,9 @@ static int lp5860_set_mc_brightness(struct led_classdev *cdev,
>  
>  static int lp5860_chip_enable_toggle(struct lp5860 *led, int enable)
>  {
> +	if (led->enable_gpiod)
> +		gpiod_direction_output(led->enable_gpiod, enable);
> +
>  	return regmap_write(led->regmap, LP5860_REG_CHIP_EN, enable);
>  }
>  
> @@ -170,6 +173,13 @@ int lp5860_device_init(struct device *dev)
>  	struct lp5860 *lp = dev_get_drvdata(dev);
>  	int ret;
>  
> +	lp->enable_gpiod = devm_gpiod_get_optional(lp->dev, "enable", GPIOD_ASIS);
> +	if (IS_ERR(lp->enable_gpiod))
> +		return PTR_ERR(lp->enable_gpiod);
> +
> +	if (lp->enable_gpiod)
> +		gpiod_set_consumer_name(lp->enable_gpiod, "LP5860 VIO enable");
> +
>  	ret = lp5860_chip_enable_toggle(lp, LP5860_CHIP_ENABLE);
>  	if (ret)
>  		return ret;
> diff --git a/include/linux/platform_data/leds-lp5860.h b/include/linux/platform_data/leds-lp5860.h
> index 7bc69a7a550dd..7258d0674ce59 100644
> --- a/include/linux/platform_data/leds-lp5860.h
> +++ b/include/linux/platform_data/leds-lp5860.h
> @@ -257,6 +257,7 @@ struct lp5860_led {
>  struct lp5860 {
>  	struct device *dev;
>  	struct regmap *regmap;
> +	struct gpio_desc *enable_gpiod;
>  	unsigned int leds_count;
>  
>  	DECLARE_FLEX_ARRAY(struct lp5860_led, leds);

Is this okay? Anything needs to be done here?


Best regards,
Steffen

-- 
Pengutronix e.K.                | Dipl.-Inform. Steffen Trumtrar |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |

  reply	other threads:[~2026-03-05  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 15:35 [PATCH 0/2] leds: lp5860: add enable-gpio Steffen Trumtrar
2026-02-17 15:35 ` [PATCH 1/2] dt-bindings: " Steffen Trumtrar
2026-02-17 17:54   ` Conor Dooley
2026-02-17 15:35 ` [PATCH 2/2] leds: rgb: " Steffen Trumtrar
2026-03-05  8:57   ` Steffen Trumtrar [this message]
2026-03-09 18:22 ` [PATCH 0/2] leds: " Lee Jones

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=875x7avejz.fsf@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.