Re: [PATCH v3 3/4] leds: flash: lm3643: Describe the LED of ACPI boards without LED nodes

From: Sakari Ailus

Date: Tue Oct 20 2026 - 07:25:18 EST


Hi Lee, others,

On Tue, Oct 20, 2026 at 11:45:06AM +0100, Lee Jones wrote:
> > @@ -691,6 +692,92 @@ static int lm3643_register_led(struct device *dev, struct lm3643 *chip,
> > return lm3643_register_v4l2(dev, led, fwnode);
> > }
> >
> > +/*
> > + * Lenovo ThinkPads enumerate the chip through ACPI (HID TXNW3643) without a
> > + * _DSD, so the LED is not described by firmware. On the boards below it drives
> > + * the Windows Hello IR flood illuminator, with both current sources feeding a
> > + * single LED. Describe that with a software node, with torch and flash limits
> > + * (100 mA and 300 mA per output) well below the chip's maximums.
> > + */
> > +static const u32 lm3643_ir_flood_sources[] = { 0, 1 };
> > +
> > +static const struct property_entry lm3643_ir_flood_props[] = {
> > + PROPERTY_ENTRY_U32("reg", 0),
> > + PROPERTY_ENTRY_U32_ARRAY("led-sources", lm3643_ir_flood_sources),
> > + PROPERTY_ENTRY_STRING("function", LED_FUNCTION_FLASH),
> > + PROPERTY_ENTRY_U32("color", LED_COLOR_ID_IR),
> > + PROPERTY_ENTRY_U32("led-max-microamp", 200000),
> > + PROPERTY_ENTRY_U32("flash-max-microamp", 600000),
> > + PROPERTY_ENTRY_U32("flash-max-timeout-us", 100000),
> > + { }
> > +};
> > +
> > +static const struct software_node lm3643_ir_flood_root = {
> > + .name = "lm3643",
> > +};
> > +
> > +static const struct software_node lm3643_ir_flood_led = {
> > + .name = "led-0",
> > + .parent = &lm3643_ir_flood_root,
> > + .properties = lm3643_ir_flood_props,
> > +};
> > +
> > +static const struct software_node *lm3643_ir_flood_nodes[] = {
> > + &lm3643_ir_flood_root,
> > + &lm3643_ir_flood_led,
> > + NULL
> > +};
> > +
> > +static const struct dmi_system_id lm3643_dmi_leds[] = {
> > + {
> > + /* Lenovo ThinkPad X1 Carbon Gen 14 */
> > + .matches = {
> > + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> > + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon Gen 14"),
> > + },
> > + .driver_data = (void *)lm3643_ir_flood_nodes,
>
> Andy, et al.,
>
> I don't usually allow data from other registration mechanisms to be
> passed through another (MFD data via OF for instance).
>
> Is this okay?

In this case the ipu-bridge needs to provide the information to the lm3643
driver via software nodes, as it already does for a number of other
devices. There's no point in putting the information to the LED driver.

Presumably the ACPI device node already exists so this should be
straightforward. What's also missing from the sensor then is the flash-leds
property, the lens-focus handling serves as an example.

--
Regards,

Sakari Ailus