leds: pwm-multicolor: Introduce default-intensity property

Like all LED drivers, pwm-multicolor supports turning on an LED on boot
by setting linux,default-trigger, e.g. to "default-on". pwm-multicolor
however scales the brightness of the color-component sub-LEDs with their
individual intensity value. Since these intensities are
zero-initialized, on boot a trigger is invisible until colors are set
from userspace.

Fix linux,default-trigger for pwm-multicolor by allowing for nonzero
default-intensities but default to 0 for backwards-compatibility.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260605-multicolor-default-v2-2-ed07271df6b0@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Jonas Rebmann 2026-06-05 09:27:48 +02:00 committed by Lee Jones
parent dc59e4fea9
commit 782cca1ac6

View File

@ -95,6 +95,8 @@ static int iterate_subleds(struct device *dev, struct pwm_mc_led *priv,
}
subled[priv->mc_cdev.num_colors].color_index = color;
fwnode_property_read_u32(fwnode, "default-intensity",
&subled[priv->mc_cdev.num_colors].intensity);
priv->mc_cdev.num_colors++;
}