mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
@ 2025-11-17 13:45 Konrad Dybcio
  2025-11-17 14:54 ` David Heidelberg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Konrad Dybcio @ 2025-11-17 13:45 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Bjorn Andersson
  Cc: linux-leds, linux-kernel, linux-arm-msm, Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

There's nothing special about RGB multi-led instances. Allow any color
combinations by simply extending the "if _RGB" checks.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 4f2a178e3d26..c8afc68e442f 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1382,7 +1382,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
 		return dev_err_probe(lpg->dev, ret,
 			      "failed to parse \"color\" of %pOF\n", np);
 
-	if (color == LED_COLOR_ID_RGB)
+	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
 		num_channels = of_get_available_child_count(np);
 	else
 		num_channels = 1;
@@ -1394,7 +1394,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
 	led->lpg = lpg;
 	led->num_channels = num_channels;
 
-	if (color == LED_COLOR_ID_RGB) {
+	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI) {
 		info = devm_kcalloc(lpg->dev, num_channels, sizeof(*info), GFP_KERNEL);
 		if (!info)
 			return -ENOMEM;
@@ -1454,7 +1454,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
 
 	init_data.fwnode = of_fwnode_handle(np);
 
-	if (color == LED_COLOR_ID_RGB)
+	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
 		ret = devm_led_classdev_multicolor_register_ext(lpg->dev, &led->mcdev, &init_data);
 	else
 		ret = devm_led_classdev_register_ext(lpg->dev, &led->cdev, &init_data);

---
base-commit: b179ce312bafcb8c68dc718e015aee79b7939ff0
change-id: 20251117-topic-lpg_multi-cf47ea164b14

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


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

* Re: [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
  2025-11-17 13:45 [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI Konrad Dybcio
@ 2025-11-17 14:54 ` David Heidelberg
  2025-11-18  4:31 ` Dmitry Baryshkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Heidelberg @ 2025-11-17 14:54 UTC (permalink / raw)
  To: Konrad Dybcio, Lee Jones, Pavel Machek, Bjorn Andersson
  Cc: linux-leds, linux-kernel, linux-arm-msm, Konrad Dybcio

On 17/11/2025 14:45, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> There's nothing special about RGB multi-led instances. Allow any color
> combinations by simply extending the "if _RGB" checks.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>   drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: David Heidelberg <david@ixit.cz>

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

* Re: [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
  2025-11-17 13:45 [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI Konrad Dybcio
  2025-11-17 14:54 ` David Heidelberg
@ 2025-11-18  4:31 ` Dmitry Baryshkov
  2025-11-18 16:28 ` Bjorn Andersson
  2025-11-20 14:25 ` (subset) " Lee Jones
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2025-11-18  4:31 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Lee Jones, Pavel Machek, Bjorn Andersson, linux-leds,
	linux-kernel, linux-arm-msm, Konrad Dybcio

On Mon, Nov 17, 2025 at 02:45:59PM +0100, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> There's nothing special about RGB multi-led instances. Allow any color
> combinations by simply extending the "if _RGB" checks.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
  2025-11-17 13:45 [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI Konrad Dybcio
  2025-11-17 14:54 ` David Heidelberg
  2025-11-18  4:31 ` Dmitry Baryshkov
@ 2025-11-18 16:28 ` Bjorn Andersson
  2025-11-20 14:25 ` (subset) " Lee Jones
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2025-11-18 16:28 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Lee Jones, Pavel Machek, linux-leds, linux-kernel, linux-arm-msm,
	Konrad Dybcio

On Mon, Nov 17, 2025 at 02:45:59PM +0100, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> There's nothing special about RGB multi-led instances. Allow any color
> combinations by simply extending the "if _RGB" checks.
> 

Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Regards,
Bjorn

> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 4f2a178e3d26..c8afc68e442f 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -1382,7 +1382,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
>  		return dev_err_probe(lpg->dev, ret,
>  			      "failed to parse \"color\" of %pOF\n", np);
>  
> -	if (color == LED_COLOR_ID_RGB)
> +	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
>  		num_channels = of_get_available_child_count(np);
>  	else
>  		num_channels = 1;
> @@ -1394,7 +1394,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
>  	led->lpg = lpg;
>  	led->num_channels = num_channels;
>  
> -	if (color == LED_COLOR_ID_RGB) {
> +	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI) {
>  		info = devm_kcalloc(lpg->dev, num_channels, sizeof(*info), GFP_KERNEL);
>  		if (!info)
>  			return -ENOMEM;
> @@ -1454,7 +1454,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
>  
>  	init_data.fwnode = of_fwnode_handle(np);
>  
> -	if (color == LED_COLOR_ID_RGB)
> +	if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
>  		ret = devm_led_classdev_multicolor_register_ext(lpg->dev, &led->mcdev, &init_data);
>  	else
>  		ret = devm_led_classdev_register_ext(lpg->dev, &led->cdev, &init_data);
> 
> ---
> base-commit: b179ce312bafcb8c68dc718e015aee79b7939ff0
> change-id: 20251117-topic-lpg_multi-cf47ea164b14
> 
> Best regards,
> -- 
> Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 

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

* Re: (subset) [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
  2025-11-17 13:45 [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI Konrad Dybcio
                   ` (2 preceding siblings ...)
  2025-11-18 16:28 ` Bjorn Andersson
@ 2025-11-20 14:25 ` Lee Jones
  3 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2025-11-20 14:25 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Bjorn Andersson, Konrad Dybcio
  Cc: linux-leds, linux-kernel, linux-arm-msm, Konrad Dybcio

On Mon, 17 Nov 2025 14:45:59 +0100, Konrad Dybcio wrote:
> There's nothing special about RGB multi-led instances. Allow any color
> combinations by simply extending the "if _RGB" checks.
> 
> 

Applied, thanks!

[1/1] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
      commit: fc6a6da64fd847c3122848c5a0850daaeb0874e5

--
Lee Jones [李琼斯]


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

end of thread, other threads:[~2025-11-20 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 13:45 [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI Konrad Dybcio
2025-11-17 14:54 ` David Heidelberg
2025-11-18  4:31 ` Dmitry Baryshkov
2025-11-18 16:28 ` Bjorn Andersson
2025-11-20 14:25 ` (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

all inboxes | Powered by JetHome®