[PATCH v2 0/3] Lenovo ThinkPad X13s embedded controller support

From: Clover

Date: Sat Sep 26 2026 - 15:54:59 EST


Add support for the embedded controller found in the Lenovo ThinkPad X13s.

The X13s EC uses an I2C command transport similar to the ThinkPad T14s EC,
but its event, keyboard backlight, and power-management interfaces differ
enough to warrant a separate driver.

The EC event interrupt is provided by GPIO103. GPIO176 is a separate
host-controlled power-state signal used during low-power transitions. The
driver follows the EC command and GPIO sequencing described by the X13s
ACPI DSDT and defers EC event queries during suspend until the I2C
controller is available again on resume.

This initial series provides EC transport and power-management support,
wake handling, and keyboard-backlight control. Other EC events have been
left for follow-up work rather than exposing unverified input mappings.

This follows earlier X13s EC work by Konrad Dybcio and Steev Klimaszewski.

Development was assisted by an LLM, including analysis of the decompiled
X13s ACPI DSDT and review of the resulting implementation. The resulting
behavior was verified against the hardware.

This series is based on Linux v7.3-rc4.

The series has been tested on a Lenovo ThinkPad X13s, including keyboard
backlight control and firmware-driven brightness changes, s2idle
suspend/resume, keyboard-backlight state restoration across lid close/open,
and wake from EC events. The QUP8 pin configuration was also verified on
hardware, including Linux ownership of GPIO43 and GPIO44 and the expected
mux, drive-strength, and pull configuration.

The binding passes dt_binding_check. The X13s DTB has also been validated
against the binding, and the driver builds cleanly with W=1.

Changes in v2:
- Make keyboard-backlight snapshot and EC power-management operations
best-effort so EC failures do not prevent system suspend or resume.
- Save firmware-selected keyboard-backlight brightness in the EC on
Fn+Space, following the DSDT's SCMS(0x20) operation.
- Save software-selected keyboard-backlight brightness in the EC so lid
opening does not restore a stale setting.
- Restore the EC-saved keyboard-backlight brightness on lid open,
following the DSDT's SCMS(0x21) operation.
- Process deferred EC events after the normal resume brightness restore
so a lid-open restore takes precedence.
- Add the QUP8 pinctrl state for GPIO43 and GPIO44 using the configuration
observed on the running hardware.
- Fix the placement and ordering of the i2c8 and EC pinctrl nodes.

Link: https://lore.kernel.org/all/20260925215358.33417-1-alex@xxxxxxxxxxxxx/

Clover (3):
dt-bindings: embedded-controller: Add Lenovo ThinkPad X13s EC
platform: arm64: Add Lenovo ThinkPad X13s EC driver
arm64: dts: qcom: sc8280xp-x13s: Add embedded controller