diff --git a/arch/arm64/boot/dts/freescale/imx93-charge-som-ac-pb.dtso b/arch/arm64/boot/dts/freescale/imx93-charge-som-ac-pb.dtso index 20c6eac7de82b4..8b0bacc619c3b6 100644 --- a/arch/arm64/boot/dts/freescale/imx93-charge-som-ac-pb.dtso +++ b/arch/arm64/boot/dts/freescale/imx93-charge-som-ac-pb.dtso @@ -53,6 +53,15 @@ enable-active-high; regulator-always-on; }; + + multi-led { + compatible = "leds-group-multicolor"; + color = ; + function = LED_FUNCTION_STATUS; + leds = <&led0>, <&led1>, <&led2>, <&led3>; + default-intensity = <0>, <0>, <0>, <255>; + linux,default-trigger = "timer"; + }; }; &bbnsm_pwrkey { @@ -280,25 +289,25 @@ #address-cells = <1>; #size-cells = <0>; - led@0 { + led0: led@0 { reg = <0>; color = ; function = LED_FUNCTION_STATUS; }; - led@1 { + led1: led@1 { reg = <1>; color = ; function = LED_FUNCTION_STATUS; }; - led@2 { + led2: led@2 { reg = <2>; color = ; function = LED_FUNCTION_STATUS; }; - led@3 { + led3: led@3 { reg = <3>; color = ; function = LED_FUNCTION_STATUS; diff --git a/arch/arm64/configs/imx93-chargebyte_defconfig b/arch/arm64/configs/imx93-chargebyte_defconfig index 24c7796271b9f5..a5c98a1d9fb08d 100644 --- a/arch/arm64/configs/imx93-chargebyte_defconfig +++ b/arch/arm64/configs/imx93-chargebyte_defconfig @@ -628,14 +628,16 @@ CONFIG_SCSI_UFSHCD=y CONFIG_SCSI_UFSHCD_PLATFORM=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y -CONFIG_LEDS_CLASS_MULTICOLOR=m +CONFIG_LEDS_CLASS_MULTICOLOR=y +CONFIG_LEDS_CROS_EC=m CONFIG_LEDS_LM3692X=m CONFIG_LEDS_PCA9532=m CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PCA963X=m +CONFIG_LEDS_PCA963X=y CONFIG_LEDS_PCA995X=m CONFIG_LEDS_PWM=y CONFIG_LEDS_SYSCON=y +CONFIG_LEDS_GROUP_MULTICOLOR=y CONFIG_LEDS_TRIGGER_TIMER=y CONFIG_LEDS_TRIGGER_ONESHOT=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y @@ -645,6 +647,7 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=y CONFIG_LEDS_TRIGGER_TRANSIENT=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_LEDS_TRIGGER_NETDEV=y +CONFIG_LEDS_TRIGGER_PATTERN=y CONFIG_LEDS_TRIGGER_TTY=y CONFIG_EDAC=y CONFIG_EDAC_SYNOPSYS=y diff --git a/drivers/leds/rgb/leds-group-multicolor.c b/drivers/leds/rgb/leds-group-multicolor.c index b6c7679015fdf5..b76b13bfa343f3 100644 --- a/drivers/leds/rgb/leds-group-multicolor.c +++ b/drivers/leds/rgb/leds-group-multicolor.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -106,11 +107,27 @@ static int leds_gmc_probe(struct platform_device *pdev) for (i = 0; i < count; i++) { struct led_classdev *led_cdev = priv->monochromatics[i]; + u32 intensity; subled[i].color_index = led_cdev->color; - /* Configure the LED intensity to its maximum */ - subled[i].intensity = max_brightness; + ret = of_property_read_u32_index(pdev->dev.of_node, "default-intensity", + i, &intensity); + if (ret) { + if (ret != -EINVAL) { + dev_warn(dev, "Unable to get default-intensity[%d]: %d\n", + i, ret); + } + subled[i].intensity = max_brightness; + } else if (intensity > max_brightness) { + dev_warn(dev, "default-intensity[%d] is invalid\n", i); + subled[i].intensity = max_brightness; + } else { + subled[i].intensity = intensity; + } + + dev_dbg(dev, "subled[%d]: color_index: %u, intensity: %u\n", + i, subled[i].color_index, subled[i].intensity); } /* Initialise the multicolor's LED class device */