[RFC PATCH 0/2] leds: flash: LM3643 dual LED flash driver

Rillian Grant <[email protected]>
Newsgroups org.kernel.vger.linux-leds
Message-ID <[email protected]>
This series adds a flash LED driver for the Texas Instruments
LM3643. I wrote it to support the Windows Hello NIR illuminator on my
ThinkPad X9-15 Gen 1, which appears to have a single LED connected to
both current sources. All non-error code paths have been tested on my
device.

This device is enumerated by ACPI (HID TXNW3643) as an I2C client with
no _DSD. The driver, following the leds/flash convention, sees no LED
child nodes and fails to probe. For testing I have been using an SSDT
overlay.

On Windows, Lenovo distributes an LM3643 driver authored by Intel. Its
inf file matches on the HID alone and contains a default intensity for
each LED, 100% for LED1 and 60% for LED2, which suggests the driver
applies a static configuration to any enumerated LM3643.

I am sending this RFC to ask how best to supply this default static
configuration. The options I can see are:

1. A DMI-matched table, similar to touchscreen_dmi.c, that attaches
   LED child nodes on verified boards. I haven't found any existing
   examples of this being done for LED child nodes.
2. A generic fallback in the driver exposing both current sources as
   independent LEDs. However this would apply to all matches without
   a firmware description.

I'd appreciate any guidance on the preferred approach.

Rillian Grant (2):
  dt-bindings: leds: Document TI LM3643 dual LED flash driver
  leds: flash: Add support for the TI LM3643 dual LED flash driver

 .../devicetree/bindings/leds/ti,lm3643.yaml   | 126 +++
 MAINTAINERS                                   |   7 +
 drivers/leds/flash/Kconfig                    |  12 +
 drivers/leds/flash/Makefile                   |   1 +
 drivers/leds/flash/leds-lm3643.c              | 775 ++++++++++++++++++
 5 files changed, 921 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3643.yaml
 create mode 100644 drivers/leds/flash/leds-lm3643.c


base-commit: a4ff2be345d0abc943da8dd8da98151843b750dc
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.