mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v3 2/4] leds: flash: Add support for the TI LM3643 dual LED flash driver
@ 2026-11-11 19:29 Roman Vivchar
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Vivchar @ 2026-11-11 19:29 UTC (permalink / raw)
  To: Rillian Grant
  Cc: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Ruslan Koreev, linux-leds, devicetree,
	linux-kernel

Hi Rillian,

On 10/11/26 22:09, Rillian Grant wrote:
> The LM3643 is an I2C dual LED flash driver. Its two high-side current
> sources share a synchronous boost converter and each supports torch and
> flash modes with programmable current and flash timeout alongside fault
> reporting.
> 
> It also supports connecting both sources together to supply one LED with
> current up to the boost converter's 1.5A maximum. In that case the current
> will be split between each source symmetrically and the sources will be
> enabled and disabled at the same time.
> 
> As strobing is toggled chip-wide the driver returns -EBUSY when a sibling
> LED is active.
> 
> Flash timeouts do not have a constant step. The driver advertises the most
> granular step and rounds down to the nearest supported value.
> 
> Register behavior was taken from the datasheet (SNVS967A).
> 
> Co-developed-by: Ruslan Koreev <koreev.r@gmail.com>
> Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
> Signed-off-by: Rillian Grant <rillian.grant@gmail.com>

I have tested this series on a Realme C3 phone, which uses Orient Chip 
OCP81373 IC (register-compatible clone of the LM3643, except the device 
ID is 0x3A instead of 0x00). I had to modify the driver to support 
multiple chips, since there's at least one more clone IC (Awinic 
AW3643). After applying modifications, flash and torch modes were 
confirmed to work correctly. Once this series is merged, I will send a 
small series to add support for the OCP81373.

Tested-by: Roman Vivchar <rva333@protonmail.com>

Best regards,
Roman


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH v3 0/4] leds: flash: LM3643 dual LED flash driver
@ 2026-10-11 19:09 Rillian Grant
  2026-10-11 19:09 ` [PATCH v3 2/4] leds: flash: Add support for the TI " Rillian Grant
  0 siblings, 1 reply; 2+ messages in thread
From: Rillian Grant @ 2026-10-11 19:09 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ruslan Koreev,
	linux-leds, devicetree, linux-kernel, Rillian Grant

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 has a single LED connected to both current
sources. The driver has also been tested by Ruslan Koreev on a ThinkPad
X1 Carbon Gen 14.

On both ThinkPad models the chip is described by ACPI but has no _DSD.
The original RFC asked how to supply the missing child nodes. This
series includes DMI-matched software nodes for both laptop models.

1/4 DT binding
2/4 driver
3/4 DMI match table and values for the X1 Carbon
4/4 DMI entry for the X9-15 Gen 1

Changes in v3:
- dt-bindings: document the enable-gpios (HWEN), flash-gpios (STROBE)
  and vin-supply (IN) connections (Krzysztof Kozlowski)
- dt-bindings: drop redundant minimum: 0, use led-controller as the node
  name in the example and tidy formatting (Krzysztof Kozlowski)
- driver: enable the optional vin-supply and drive the optional HWEN
  GPIO high at probe
- driver: reject an out-of-range max-brightness rather than clamping after
  registration (previously LED core applied max-brightness exposing sysfs
  before the clamp)
- driver: allow a torch output to be switched off while the device is
  flashing (previously returned -EBUSY)
- driver: take the chip lock when claiming current outputs
- driver: fix indentation in lm3643_torch_get_brightness()
- 3/4, 4/4: use DMI_EXACT_MATCH for the DMI entries
- 3/4: log use of the DMI description with dev_dbg() instead of
  dev_info()

Changes in v2:
- Rebased onto leds/for-leds-next
- dt-bindings: make flash-max-microamp, led-max-microamp and
  flash-max-timeout-us required
- driver: return device to standby state when the last output is
  switched off (squashed fix provided by Ruslan Koreev)
- New 3/4: DMI mechanism and entry for the X1 Carbon developed by
  Ruslan. Plus a minor update to provide a reg property for consistency
  with the DT bindings.
- New 4/4: DMI entry for the X9-15 Gen 1 and update struct names to be
  model-specific.

v2: https://lore.kernel.org/all/20260928094302.86966-1-rillian.grant@gmail.com/
v1: https://lore.kernel.org/all/20260821083620.68324-1-rillian.grant@gmail.com/

Rillian Grant (3):
  dt-bindings: leds: Document TI LM3643 dual LED flash driver
  leds: flash: Add support for the TI LM3643 dual LED flash driver
  leds: flash: lm3643: Describe the LED on the Lenovo ThinkPad X9-15 Gen
    1

Ruslan Koreev (1):
  leds: flash: lm3643: Describe the LED of ACPI boards without LED nodes

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


base-commit: 05b4738b0078f7d6f154f68068a11c8a0635e9df
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-11 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 19:29 [PATCH v3 2/4] leds: flash: Add support for the TI LM3643 dual LED flash driver Roman Vivchar
  -- strict thread matches above, loose matches on Subject: below --
2026-10-11 19:09 [PATCH v3 0/4] leds: flash: " Rillian Grant
2026-10-11 19:09 ` [PATCH v3 2/4] leds: flash: Add support for the TI " Rillian Grant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®