* [PATCH v2 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity
@ 2026-06-05 7:27 Jonas Rebmann
2026-06-05 7:27 ` [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
2026-06-05 7:27 ` [PATCH v2 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
0 siblings, 2 replies; 8+ messages in thread
From: Jonas Rebmann @ 2026-06-05 7:27 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jacek Anaszewski, Sven Schwermer
Cc: Pavel Machek, linux-leds, devicetree, linux-kernel, kernel,
Jonas Rebmann
Typically using linux,default-trigger allows turning LEDs on on initialization
or triggering on e.g. a kernel panic regardless of how early.
While supported in pwm-multicolor, this was not usable because the
individual color components multiplication factor (intensity), defaulted
all to 0 (black) and the LED remains off regardless of its overall
"brightness" value.
Allow setting defaults for each component's intensity to make the other
"default-" properties actually usable here.
Update binding documentation accordingly.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
Changes in v2:
- dt-bindings: Use correct property name in example
- dt-bindings: Add missing word in property description
- Link to v1: https://patch.msgid.link/20260604-multicolor-default-v1-0-b07bff431537@pengutronix.de
To: Lee Jones <lee@kernel.org>
To: Pavel Machek <pavel@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux-leds@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Jonas Rebmann (2):
dt-bindings: leds: Add default-intensity property
leds: pwm-multicolor: Introduce default-intensity property
Documentation/devicetree/bindings/leds/common.yaml | 11 +++++++++++
.../devicetree/bindings/leds/leds-pwm-multicolor.yaml | 4 ++++
drivers/leds/rgb/leds-pwm-multicolor.c | 2 ++
3 files changed, 17 insertions(+)
---
base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
change-id: 20260604-multicolor-default-11e3becde05a
Best regards,
--
Jonas Rebmann <jre@pengutronix.de>
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property
2026-06-05 7:27 [PATCH v2 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
@ 2026-06-05 7:27 ` Jonas Rebmann
2026-06-05 7:38 ` sashiko-bot
2026-06-05 7:27 ` [PATCH v2 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
1 sibling, 1 reply; 8+ messages in thread
From: Jonas Rebmann @ 2026-06-05 7:27 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jacek Anaszewski, Sven Schwermer
Cc: Pavel Machek, linux-leds, devicetree, linux-kernel, kernel,
Jonas Rebmann
Document the default-intensity property to set a default color on
multicolor LEDs.
Update pwm-multicolor to support it and update the example to turn the
LED red on boot.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
Documentation/devicetree/bindings/leds/common.yaml | 11 +++++++++++
.../devicetree/bindings/leds/leds-pwm-multicolor.yaml | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
index f4e44b33f56d..a34de0a34b42 100644
--- a/Documentation/devicetree/bindings/leds/common.yaml
+++ b/Documentation/devicetree/bindings/leds/common.yaml
@@ -73,6 +73,17 @@ properties:
- keep
default: off
+ default-intensity:
+ description:
+ The initial intensity of the LED color component. Used only during
+ initialization. Defaults to 0. As the intensity of each sub-LED is
+ multiplied with the overall brightness, without this property on a
+ sub-LED, the leds-pwm-multicolor-LED is effectively initialized at
+ minimum brightness regardless of its linux,default-trigger and
+ default-brightness properties.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+
linux,default-trigger:
description:
This parameter, if present, is a string defining the trigger assigned to
diff --git a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
index a31a202afe5c..7bf687c89411 100644
--- a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
@@ -45,6 +45,8 @@ properties:
color: true
+ default-intensity: true
+
required:
- pwms
- color
@@ -63,12 +65,14 @@ examples:
multi-led {
color = <LED_COLOR_ID_RGB>;
+ linux,default-trigger = "default-on";
function = LED_FUNCTION_INDICATOR;
max-brightness = <65535>;
led-red {
pwms = <&pwm1 0 1000000>;
color = <LED_COLOR_ID_RED>;
+ default-intensity = <65535>;
};
led-green {
--
2.54.0.129.g3edf2eeba9
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property
2026-06-05 7:27 ` [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
@ 2026-06-05 7:38 ` sashiko-bot
2026-06-05 8:45 ` Jonas Rebmann
0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-06-05 7:38 UTC (permalink / raw)
To: Jonas Rebmann; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Driver-specific name hardcoded in the generic `common.yaml` schema description.
--
commit 9beb7b4f88908b2864bd519c143e1a370071aec1
Author: Jonas Rebmann <jre@pengutronix.de>
dt-bindings: leds: Add default-intensity property
This commit documents the default-intensity property to set a default color
on multicolor LEDs. It also updates the pwm-multicolor binding and its
example to support this new initialization property.
> diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
> index f4e44b33f56d1..a34de0a34b422 100644
> --- a/Documentation/devicetree/bindings/leds/common.yaml
> +++ b/Documentation/devicetree/bindings/leds/common.yaml
[ ... ]
> @@ -73,6 +73,17 @@ properties:
> - keep
> default: off
>
> + default-intensity:
> + description:
> + The initial intensity of the LED color component. Used only during
> + initialization. Defaults to 0. As the intensity of each sub-LED is
> + multiplied with the overall brightness, without this property on a
> + sub-LED, the leds-pwm-multicolor-LED is effectively initialized at
> + minimum brightness regardless of its linux,default-trigger and
> + default-brightness properties.
[Severity: Low]
This isn't a bug, but the description for default-intensity explicitly
mentions the specific driver name leds-pwm-multicolor-LED.
Since common.yaml is intended to be a hardware-agnostic specification
for all LED bindings, could this wording be updated to refer generically
to the multicolor LED or simply the LED to avoid leaking an
implementation detail into the generic schema?
> + $ref: /schemas/types.yaml#/definitions/uint32
> + default: 0
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605-multicolor-default-v2-0-ed07271df6b0@pengutronix.de?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property
2026-06-05 7:38 ` sashiko-bot
@ 2026-06-05 8:45 ` Jonas Rebmann
2026-06-05 10:29 ` Conor Dooley
0 siblings, 1 reply; 8+ messages in thread
From: Jonas Rebmann @ 2026-06-05 8:45 UTC (permalink / raw)
To: devicetree, conor+dt, robh; +Cc: kernel@pengutronix.de, sashiko-reviews
Hello,
On 2026-06-05 09:38, sashiko-bot@kernel.org wrote:
>> @@ -73,6 +73,17 @@ properties:
>> - keep
>> default: off
>>
>> + default-intensity:
>> + description:
>> + The initial intensity of the LED color component. Used only during
>> + initialization. Defaults to 0. As the intensity of each sub-LED is
>> + multiplied with the overall brightness, without this property on a
>> + sub-LED, the leds-pwm-multicolor-LED is effectively initialized at
>> + minimum brightness regardless of its linux,default-trigger and
>> + default-brightness properties.
>
> [Severity: Low]
> This isn't a bug, but the description for default-intensity explicitly
> mentions the specific driver name leds-pwm-multicolor-LED.
>
> Since common.yaml is intended to be a hardware-agnostic specification
> for all LED bindings, could this wording be updated to refer generically
> to the multicolor LED or simply the LED to avoid leaking an
> implementation detail into the generic schema?
I'll be leaving this as-is until human feedback.
I think documenting the property in common.yaml is correct because the
default-intensity itself is applicable to other multicolor-LED drivers,
I just only implemented it for pwm-multicolor because that's what I use.
But we could just as well move it to leds-pwm-multicolor.yaml for as
long as that's the only driver supporting it.
I intentionally included the "pwm" in that sentence because the
described issue that default-intensity is effectively required when
using linux,default-trigger may be pwm-multicolor specific.
I would not like to omit the sentence either because this situation is
the reason why one might actually need (not just want)
default-intensity (for -pwm-).
Regards,
Jonas
--
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 |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property
2026-06-05 8:45 ` Jonas Rebmann
@ 2026-06-05 10:29 ` Conor Dooley
2026-06-05 10:52 ` Conor Dooley
0 siblings, 1 reply; 8+ messages in thread
From: Conor Dooley @ 2026-06-05 10:29 UTC (permalink / raw)
To: Jonas Rebmann
Cc: devicetree, conor+dt, robh, kernel@pengutronix.de,
sashiko-reviews
[-- Attachment #1: Type: text/plain, Size: 2656 bytes --]
On Fri, Jun 05, 2026 at 10:45:12AM +0200, Jonas Rebmann wrote:
> Hello,
>
> On 2026-06-05 09:38, sashiko-bot@kernel.org wrote:
> > > @@ -73,6 +73,17 @@ properties:
> > > - keep
> > > default: off
> > > + default-intensity:
> > > + description:
> > > + The initial intensity of the LED color component. Used only during
> > > + initialization. Defaults to 0. As the intensity of each sub-LED is
I'd drop sentence two here, it just duplicates sentence one.
> > > + multiplied with the overall brightness, without this property on a
> > > + sub-LED, the leds-pwm-multicolor-LED is effectively initialized at
> > > + minimum brightness regardless of its linux,default-trigger and
> > > + default-brightness properties.
> >
> > [Severity: Low]
> > This isn't a bug, but the description for default-intensity explicitly
> > mentions the specific driver name leds-pwm-multicolor-LED.
> >
> > Since common.yaml is intended to be a hardware-agnostic specification
> > for all LED bindings, could this wording be updated to refer generically
> > to the multicolor LED or simply the LED to avoid leaking an
> > implementation detail into the generic schema?
>
> I'll be leaving this as-is until human feedback.
>
> I think documenting the property in common.yaml is correct because the
> default-intensity itself is applicable to other multicolor-LED drivers,
I think this is fine.
> I just only implemented it for pwm-multicolor because that's what I use.
> But we could just as well move it to leds-pwm-multicolor.yaml for as
> long as that's the only driver supporting it.
But this is probably also fine and it can be moved if other users crop
up.
> I intentionally included the "pwm" in that sentence because the
> described issue that default-intensity is effectively required when
> using linux,default-trigger may be pwm-multicolor specific.
I don't think this is fine. However, it is almost certainly fine if you
just do s/the leds-pwm-multicolour-LED/it/ because you're no longer
tying the description to the name of one driver.
>
> I would not like to omit the sentence either because this situation is
> the reason why one might actually need (not just want)
> default-intensity (for -pwm-).
>
> Regards,
> Jonas
>
> --
> 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 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property
2026-06-05 10:29 ` Conor Dooley
@ 2026-06-05 10:52 ` Conor Dooley
0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2026-06-05 10:52 UTC (permalink / raw)
To: Jonas Rebmann
Cc: devicetree, conor+dt, robh, kernel@pengutronix.de,
sashiko-reviews
[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]
On Fri, Jun 05, 2026 at 11:29:31AM +0100, Conor Dooley wrote:
> On Fri, Jun 05, 2026 at 10:45:12AM +0200, Jonas Rebmann wrote:
> > Hello,
> >
> > On 2026-06-05 09:38, sashiko-bot@kernel.org wrote:
> > > > @@ -73,6 +73,17 @@ properties:
> > > > - keep
> > > > default: off
> > > > + default-intensity:
> > > > + description:
> > > > + The initial intensity of the LED color component. Used only during
> > > > + initialization. Defaults to 0. As the intensity of each sub-LED is
>
> I'd drop sentence two here, it just duplicates sentence one.
Also drop "Defaults to 0." since that duplicates the default: 0.
> > > > + multiplied with the overall brightness, without this property on a
> > > > + sub-LED, the leds-pwm-multicolor-LED is effectively initialized at
> > > > + minimum brightness regardless of its linux,default-trigger and
> > > > + default-brightness properties.
> > >
> > > [Severity: Low]
> > > This isn't a bug, but the description for default-intensity explicitly
> > > mentions the specific driver name leds-pwm-multicolor-LED.
> > >
> > > Since common.yaml is intended to be a hardware-agnostic specification
> > > for all LED bindings, could this wording be updated to refer generically
> > > to the multicolor LED or simply the LED to avoid leaking an
> > > implementation detail into the generic schema?
> >
> > I'll be leaving this as-is until human feedback.
> >
> > I think documenting the property in common.yaml is correct because the
> > default-intensity itself is applicable to other multicolor-LED drivers,
>
> I think this is fine.
>
> > I just only implemented it for pwm-multicolor because that's what I use.
> > But we could just as well move it to leds-pwm-multicolor.yaml for as
> > long as that's the only driver supporting it.
>
> But this is probably also fine and it can be moved if other users crop
> up.
>
> > I intentionally included the "pwm" in that sentence because the
> > described issue that default-intensity is effectively required when
> > using linux,default-trigger may be pwm-multicolor specific.
>
> I don't think this is fine. However, it is almost certainly fine if you
> just do s/the leds-pwm-multicolour-LED/it/ because you're no longer
> tying the description to the name of one driver.
>
> >
> > I would not like to omit the sentence either because this situation is
> > the reason why one might actually need (not just want)
> > default-intensity (for -pwm-).
> >
> > Regards,
> > Jonas
> >
> > --
> > 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 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] leds: pwm-multicolor: Introduce default-intensity property
2026-06-05 7:27 [PATCH v2 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
2026-06-05 7:27 ` [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
@ 2026-06-05 7:27 ` Jonas Rebmann
2026-06-17 14:47 ` (subset) " Lee Jones
1 sibling, 1 reply; 8+ messages in thread
From: Jonas Rebmann @ 2026-06-05 7:27 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jacek Anaszewski, Sven Schwermer
Cc: Pavel Machek, linux-leds, devicetree, linux-kernel, kernel,
Jonas Rebmann
Like all LED drivers, pwm-multicolor supports turning on an LED on boot
by setting linux,default-trigger, e.g. to "default-on". pwm-multicolor
however scales the brightness of the color-component sub-LEDs with their
individual intensity value. Since these intensities are
zero-initialized, on boot a trigger is invisible until colors are set
from userspace.
Fix linux,default-trigger for pwm-multicolor by allowing for nonzero
default-intensities but default to 0 for backwards-compatibility.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
drivers/leds/rgb/leds-pwm-multicolor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/leds/rgb/leds-pwm-multicolor.c b/drivers/leds/rgb/leds-pwm-multicolor.c
index e0d7d3c9215c..3e515df40583 100644
--- a/drivers/leds/rgb/leds-pwm-multicolor.c
+++ b/drivers/leds/rgb/leds-pwm-multicolor.c
@@ -95,6 +95,8 @@ static int iterate_subleds(struct device *dev, struct pwm_mc_led *priv,
}
subled[priv->mc_cdev.num_colors].color_index = color;
+ fwnode_property_read_u32(fwnode, "default-intensity",
+ &subled[priv->mc_cdev.num_colors].intensity);
priv->mc_cdev.num_colors++;
}
--
2.54.0.129.g3edf2eeba9
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: (subset) [PATCH v2 2/2] leds: pwm-multicolor: Introduce default-intensity property
2026-06-05 7:27 ` [PATCH v2 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
@ 2026-06-17 14:47 ` Lee Jones
0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2026-06-17 14:47 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jacek Anaszewski, Sven Schwermer, Jonas Rebmann
Cc: Pavel Machek, linux-leds, devicetree, linux-kernel, kernel
On Fri, 05 Jun 2026 09:27:48 +0200, Jonas Rebmann wrote:
> Like all LED drivers, pwm-multicolor supports turning on an LED on boot
> by setting linux,default-trigger, e.g. to "default-on". pwm-multicolor
> however scales the brightness of the color-component sub-LEDs with their
> individual intensity value. Since these intensities are
> zero-initialized, on boot a trigger is invisible until colors are set
> from userspace.
>
> [...]
Applied, thanks!
[2/2] leds: pwm-multicolor: Introduce default-intensity property
commit: 69dd3b9d8681085eceeb35459a12d67b848372d4
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-06-17 14:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 7:27 [PATCH v2 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
2026-06-05 7:27 ` [PATCH v2 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
2026-06-05 7:38 ` sashiko-bot
2026-06-05 8:45 ` Jonas Rebmann
2026-06-05 10:29 ` Conor Dooley
2026-06-05 10:52 ` Conor Dooley
2026-06-05 7:27 ` [PATCH v2 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
2026-06-17 14:47 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox