Skip to contentSkip to conversation

leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI

PATCH Applied Konrad Dybcio 5 participants 5 messages Nov 17, 2025 – Nov 20, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI

From: Konrad Dybcio <[email protected]>

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

---
 drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/leds/rgb/leds-qcom-lpg.c +3 -3
index 4f2a178e3d26..c8afc68e442f 100644
@@ -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,

Signature · 1 line
Konrad Dybcio <[email protected]>
Reviewed-by on v1 1/1
#2 lore raw
In reply to Konrad Dybcio
Quoted 10 lines · Konrad Dybcio

From: Konrad Dybcio <[email protected]>

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

---
 drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v1 1/1
#3 lore raw
In reply to Konrad Dybcio
Quoted 5 lines · Konrad Dybcio

From: Konrad Dybcio <[email protected]>

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

Regards,
Bjorn

Quoted 45 lines
---
 drivers/leds/rgb/leds-qcom-lpg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/leds/rgb/leds-qcom-lpg.c +3 -4
index 4f2a178e3d26..c8afc68e442f 100644
@@ -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,

Signature · 1 line
Konrad Dybcio <[email protected]>
maintainer Applied
#4 lore raw

Re: (subset) [PATCH] leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI

In reply to Konrad Dybcio
Quoted 4 lines · Konrad Dybcio

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 [李琼斯]