Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity
@ 2026-06-04 11:06 Jonas Rebmann
  2026-06-04 11:06 ` [PATCH 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
  2026-06-04 11:06 ` [PATCH 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
  0 siblings, 2 replies; 5+ messages in thread
From: Jonas Rebmann @ 2026-06-04 11:06 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>
---
Jonas Rebmann (2):
      dt-bindings: leds: Add default-intensity property
      leds: pwm-multicolor: Introduce default-intensity property

 Documentation/devicetree/bindings/leds/common.yaml             | 10 ++++++++++
 .../devicetree/bindings/leds/leds-pwm-multicolor.yaml          |  4 ++++
 drivers/leds/rgb/leds-pwm-multicolor.c                         |  2 ++
 3 files changed, 16 insertions(+)
---
base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
change-id: 20260604-multicolor-default-11e3becde05a

Best regards,
--  
Jonas Rebmann <jre@pengutronix.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] dt-bindings: leds: Add default-intensity property
  2026-06-04 11:06 [PATCH 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
@ 2026-06-04 11:06 ` Jonas Rebmann
  2026-06-04 11:13   ` sashiko-bot
  2026-06-04 14:37   ` Rob Herring (Arm)
  2026-06-04 11:06 ` [PATCH 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann
  1 sibling, 2 replies; 5+ messages in thread
From: Jonas Rebmann @ 2026-06-04 11:06 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             | 10 ++++++++++
 .../devicetree/bindings/leds/leds-pwm-multicolor.yaml          |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
index f4e44b33f56d..159a89f77982 100644
--- a/Documentation/devicetree/bindings/leds/common.yaml
+++ b/Documentation/devicetree/bindings/leds/common.yaml
@@ -73,6 +73,16 @@ 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 is effectively initialized at minimum brightness regardless of
+      its linux,default-trigger and default-brightness attributes.
+    $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..05cc83f4bb82 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>;
+                linux,default-intensity = <65535>;
             };
 
             led-green {

-- 
2.54.0.129.g3edf2eeba9


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] leds: pwm-multicolor: Introduce default-intensity property
  2026-06-04 11:06 [PATCH 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
  2026-06-04 11:06 ` [PATCH 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
@ 2026-06-04 11:06 ` Jonas Rebmann
  1 sibling, 0 replies; 5+ messages in thread
From: Jonas Rebmann @ 2026-06-04 11:06 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] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: leds: Add default-intensity property
  2026-06-04 11:06 ` [PATCH 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
@ 2026-06-04 11:13   ` sashiko-bot
  2026-06-04 14:37   ` Rob Herring (Arm)
  1 sibling, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-06-04 11:13 UTC (permalink / raw)
  To: Jonas Rebmann; +Cc: robh, conor+dt, devicetree

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The example in `leds-pwm-multicolor.yaml` incorrectly uses `linux,default-intensity` instead of the newly defined `default-intensity` property, causing dt_binding_check validation to fail.
- [Low] The description for `default-intensity` contains a grammatical error that makes the sentence confusing.
--

commit 99b08e914db877e1b3d69129c24e623ae6ddf4d3
Author: Jonas Rebmann <jre@pengutronix.de>

dt-bindings: leds: Add default-intensity property

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.

> diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
> index f4e44b33f56d1..159a89f77982b 100644
> --- a/Documentation/devicetree/bindings/leds/common.yaml
> +++ b/Documentation/devicetree/bindings/leds/common.yaml
> @@ -73,6 +73,16 @@ 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 is effectively initialized at minimum brightness regardless of

[Severity: Low]
This isn't a bug, but there appears to be a grammatical error in this sentence.
Should it be "without this property, a sub-LED is effectively initialized"
instead of "without this property on a sub-LED is effectively initialized"?

> +      its linux,default-trigger and default-brightness attributes.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 0
> +

[ ... ]

> diff --git a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
> index a31a202afe5cc..05cc83f4bb825 100644
> --- a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml

[ ... ]

> @@ -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>;
> +                linux,default-intensity = <65535>;

[Severity: Low]
Is this example property name correct? The new property is defined as
default-intensity, not linux,default-intensity. Does this mismatch cause
schema validation to fail during make dt_binding_check?

>              };
>  
>              led-green {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260604-multicolor-default-v1-0-b07bff431537@pengutronix.de?part=1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: leds: Add default-intensity property
  2026-06-04 11:06 ` [PATCH 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
  2026-06-04 11:13   ` sashiko-bot
@ 2026-06-04 14:37   ` Rob Herring (Arm)
  1 sibling, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2026-06-04 14:37 UTC (permalink / raw)
  To: Jonas Rebmann
  Cc: Pavel Machek, Lee Jones, Krzysztof Kozlowski, Jacek Anaszewski,
	Conor Dooley, Pavel Machek, Sven Schwermer, kernel, devicetree,
	linux-leds, linux-kernel


On Thu, 04 Jun 2026 13:06:57 +0200, Jonas Rebmann wrote:
> 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             | 10 ++++++++++
>  .../devicetree/bindings/leds/leds-pwm-multicolor.yaml          |  4 ++++
>  2 files changed, 14 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.example.dtb: led-controller (pwm-leds-multicolor): multi-led:led-red: 'linux,default-intensity' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/leds/leds-pwm-multicolor.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20260604-multicolor-default-v1-1-b07bff431537@pengutronix.de

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-04 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 11:06 [PATCH 0/2] leds: pwm-multicolor: Fix default-trigger by allowing default-intensity Jonas Rebmann
2026-06-04 11:06 ` [PATCH 1/2] dt-bindings: leds: Add default-intensity property Jonas Rebmann
2026-06-04 11:13   ` sashiko-bot
2026-06-04 14:37   ` Rob Herring (Arm)
2026-06-04 11:06 ` [PATCH 2/2] leds: pwm-multicolor: Introduce " Jonas Rebmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox