The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH V2 0/2] leds: rgb: leds-group-multicolor: Implement default-intensity
@ 2026-08-02 11:57 Stefan Wahren
  2026-08-02 11:57 ` [PATCH V2 1/2] dt-bindings: leds-group-multicolor: Enable default-intensity Stefan Wahren
  2026-08-02 11:57 ` [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Wahren @ 2026-08-02 11:57 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jean-Jacques Hiblot
  Cc: Jonas Rebmann, linux-leds, devicetree, linux-kernel,
	Stefan Wahren

Currently it's not possible to specify the initial color of a LED
multicolor group during boot. This series is the replacement
for the recent series "leds: rgb: leds-group-multicolor: Introduce
default-intensity" [1].

Changes in V2:
- adapt to approach (incl. error behavior) by Jonas Rebmann [2]
- address comments by Lee which still apply


[1] - https://lore.kernel.org/linux-leds/20260708224652.106632-1-wahrenst@gmx.net/
[2] - https://lore.kernel.org/linux-leds/20260605-multicolor-default-v2-0-ed07271df6b0@pengutronix.de/

Stefan Wahren (2):
  dt-bindings: leds-group-multicolor: Enable default-intensity
  leds: rgb: leds-group-multicolor: Implement default-intensity

 .../bindings/leds/leds-group-multicolor.yaml           |  2 ++
 drivers/leds/rgb/leds-group-multicolor.c               | 10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

-- 
2.43.0


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

* [PATCH V2 1/2] dt-bindings: leds-group-multicolor: Enable default-intensity
  2026-08-02 11:57 [PATCH V2 0/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
@ 2026-08-02 11:57 ` Stefan Wahren
  2026-08-11 14:03   ` Rob Herring
  2026-08-02 11:57 ` [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Wahren @ 2026-08-02 11:57 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jean-Jacques Hiblot
  Cc: Jonas Rebmann, linux-leds, devicetree, linux-kernel,
	Stefan Wahren

Since commit 2ebd1cb772b0 ("dt-bindings: leds: Add default-intensity
property") there is a property to specify the default color on
multicolor LEDs.

This is also helpful for leds-group-multicolor, so enable it.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 .../devicetree/bindings/leds/leds-group-multicolor.yaml         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
index 5c9cfa39396b..1f308cdb71c8 100644
--- a/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
@@ -19,6 +19,8 @@ properties:
 
   leds: true
 
+  default-intensity: true
+
 required:
   - leds
 
-- 
2.43.0


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

* [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity
  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 11:57 ` Stefan Wahren
  2026-08-03  8:53   ` Jonas Rebmann
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Wahren @ 2026-08-02 11:57 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jean-Jacques Hiblot
  Cc: Jonas Rebmann, linux-leds, devicetree, linux-kernel,
	Stefan Wahren

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>
---
 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 */
-- 
2.43.0


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

* Re: [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity
  2026-08-02 11:57 ` [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
@ 2026-08-03  8:53   ` Jonas Rebmann
  0 siblings, 0 replies; 5+ messages in thread
From: Jonas Rebmann @ 2026-08-03  8:53 UTC (permalink / raw)
  To: Stefan Wahren, Lee Jones, Pavel Machek, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jean-Jacques Hiblot
  Cc: linux-leds, devicetree, linux-kernel

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    |


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

* Re: [PATCH V2 1/2] dt-bindings: leds-group-multicolor: Enable default-intensity
  2026-08-02 11:57 ` [PATCH V2 1/2] dt-bindings: leds-group-multicolor: Enable default-intensity Stefan Wahren
@ 2026-08-11 14:03   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2026-08-11 14:03 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Lee Jones, Pavel Machek, Krzysztof Kozlowski, Conor Dooley,
	Jean-Jacques Hiblot, Jonas Rebmann, linux-leds, devicetree,
	linux-kernel

On Sun, Aug 02, 2026 at 01:57:26PM +0200, Stefan Wahren wrote:
> Since commit 2ebd1cb772b0 ("dt-bindings: leds: Add default-intensity
> property") there is a property to specify the default color on
> multicolor LEDs.
> 
> This is also helpful for leds-group-multicolor, so enable it.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
>  .../devicetree/bindings/leds/leds-group-multicolor.yaml         | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
> index 5c9cfa39396b..1f308cdb71c8 100644
> --- a/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-group-multicolor.yaml
> @@ -19,6 +19,8 @@ properties:
>  
>    leds: true
>  
> +  default-intensity: true
> +

Sashiko is correct. This is in the wrong place compared to other cases. 
It should be defined where there is a ref to common.yaml as that is 
where the property is defined.

Rob

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

end of thread, other threads:[~2026-08-11 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-11 14:03   ` Rob Herring
2026-08-02 11:57 ` [PATCH V2 2/2] leds: rgb: leds-group-multicolor: Implement default-intensity Stefan Wahren
2026-08-03  8:53   ` Jonas Rebmann

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