Skip to content

Commit fc6a6da

Browse files
quic-kdybciolag-linaro
authored andcommitted
leds: rgb: leds-qcom-lpg: Allow LED_COLOR_ID_MULTI
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> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: David Heidelberg <david@ixit.cz> Link: https://patch.msgid.link/20251117-topic-lpg_multi-v1-1-05604374a2dd@oss.qualcomm.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent c7a2e5e commit fc6a6da

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/leds/rgb/leds-qcom-lpg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
13821382
return dev_err_probe(lpg->dev, ret,
13831383
"failed to parse \"color\" of %pOF\n", np);
13841384

1385-
if (color == LED_COLOR_ID_RGB)
1385+
if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
13861386
num_channels = of_get_available_child_count(np);
13871387
else
13881388
num_channels = 1;
@@ -1394,7 +1394,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
13941394
led->lpg = lpg;
13951395
led->num_channels = num_channels;
13961396

1397-
if (color == LED_COLOR_ID_RGB) {
1397+
if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI) {
13981398
info = devm_kcalloc(lpg->dev, num_channels, sizeof(*info), GFP_KERNEL);
13991399
if (!info)
14001400
return -ENOMEM;
@@ -1454,7 +1454,7 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
14541454

14551455
init_data.fwnode = of_fwnode_handle(np);
14561456

1457-
if (color == LED_COLOR_ID_RGB)
1457+
if (color == LED_COLOR_ID_RGB || color == LED_COLOR_ID_MULTI)
14581458
ret = devm_led_classdev_multicolor_register_ext(lpg->dev, &led->mcdev, &init_data);
14591459
else
14601460
ret = devm_led_classdev_register_ext(lpg->dev, &led->cdev, &init_data);

0 commit comments

Comments
 (0)