From: Jonas Rebmann <jre@pengutronix.de>
To: Stefan Wahren <wahrenst@gmx.net>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity
Date: Mon, 3 Aug 2026 10:53:34 +0200 [thread overview]
Message-ID: <955ff88f-8fe2-4e58-8d2d-9d871d0aacdb@pengutronix.de> (raw)
In-Reply-To: <20260802115727.50411-3-wahrenst@gmx.net>
On 2026-08-02 13:57, Stefan Wahren wrote:
> Currently it's not possible to specify the initial color of a LED
> multicolor group during boot. So implement the default-intensity property
> similar to the leds-pwm-multicolor driver. In case the property is
> missing, the old behavior is kept.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Jonas Rebmann <jre@pengutronix.de>
> ---
> drivers/leds/rgb/leds-group-multicolor.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/rgb/leds-group-multicolor.c b/drivers/leds/rgb/leds-group-multicolor.c
> index 548c7dd63ba1..69b203ec89fa 100644
> --- a/drivers/leds/rgb/leds-group-multicolor.c
> +++ b/drivers/leds/rgb/leds-group-multicolor.c
> @@ -109,8 +109,14 @@ static int leds_gmc_probe(struct platform_device *pdev)
>
> subled[i].color_index = led_cdev->color;
>
> - /* Configure the LED intensity to its maximum */
> - subled[i].intensity = max_brightness;
> + ret = fwnode_property_read_u32(led_cdev->dev->fwnode, "default-intensity",
> + &subled[i].intensity);
> +
> + /* In case default-intensity is missing, fallback to maximum */
> + if (ret)
> + subled[i].intensity = max_brightness;
> + else if (subled[i].intensity > max_brightness)
> + subled[i].intensity = max_brightness;
> }
>
> /* Initialise the multicolor's LED class device */
--
Pengutronix e.K. | Jonas Rebmann |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
prev parent reply other threads:[~2026-08-03 8:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 11:57 [PATCH V2 0/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
2026-08-02 11:57 ` [PATCH V2 1/2] dt-bindings: leds-group-multicolor: Enable default-intensity Stefan Wahren
2026-08-02 12:09 ` sashiko-bot
2026-08-02 11:57 ` [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
2026-08-02 12:11 ` sashiko-bot
2026-08-03 8:53 ` Jonas Rebmann [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=955ff88f-8fe2-4e58-8d2d-9d871d0aacdb@pengutronix.de \
--to=jre@pengutronix.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jjhiblot@traphandler.com \
--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 \
--cc=wahrenst@gmx.net \
/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