From: sashiko-bot@kernel.org
To: "Stefan Wahren" <wahrenst@gmx.net>
Cc: linux-leds@vger.kernel.org, lee@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH V4] leds: rgb: leds-group-multicolor: Implement default-intensity
Date: Thu, 13 Aug 2026 09:25:21 +0000 [thread overview]
Message-ID: <20260813092522.0228D1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260813091428.9072-1-wahrenst@gmx.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `default-intensity` property read from individual monochromatic LED nodes is applied to the multicolor group without rescaling, causing incorrect brightness calculations.
--
--- Patch [1]: [PATCH V4] leds: rgb: leds-group-multicolor: Implement default-intensity ---
commit 13399f1aaceaf09afa7e252e35000d7d61ab1925
Author: Stefan Wahren <wahrenst@gmx.net>
leds: rgb: leds-group-multicolor: Implement default-intensity
This commit introduces support for the default-intensity property during
boot for LED multicolor groups. If the property is missing, the code falls
back to the previous behavior of configuring the sub-LED intensity to its
maximum.
> diff --git a/drivers/leds/rgb/leds-group-multicolor.c b/drivers/leds/rgb/leds-group-multicolor.c
> --- a/drivers/leds/rgb/leds-group-multicolor.c
> +++ b/drivers/leds/rgb/leds-group-multicolor.c
> @@ -108,8 +108,10 @@ 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 = device_property_read_u32(led_cdev->dev, "default-intensity",
> + &subled[i].intensity);
> + if (ret || subled[i].intensity > max_brightness)
> + subled[i].intensity = max_brightness;
[Severity: Medium]
Does this logic properly scale the intensity when the individual LEDs in the
group have different maximum brightness values?
If a multicolor group consists of LEDs with vastly different maximum brightness
capabilities (like a GPIO LED maxing at 1 and a PWM LED maxing at 255), the
overall group max_brightness will evaluate to 255.
When reading the default-intensity from the device tree, the value is typically
specified on the scale of the individual sub-LED's max brightness. If this
value is assigned directly to subled[i].intensity without being scaled up to
the group's max_brightness, the sub-LED might be initialized with only a tiny
fraction of its intended intensity, often resulting in the LED being completely
unlit instead of at the requested intensity.
> }
>
> /* Initialise the multicolor's LED class device */
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813091428.9072-1-wahrenst@gmx.net?part=1
next prev parent reply other threads:[~2026-08-13 9:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 9:14 [PATCH V4] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
2026-08-13 9:25 ` sashiko-bot [this message]
2026-08-13 9:53 ` Lee Jones
2026-08-13 10:50 ` Stefan Wahren
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=20260813092522.0228D1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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 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.