mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] platform: arm64: lenovo-thinkpad-t14s: Add support for the Gen 7 EC
@ 2026-11-23  9:35 Abel Vesa
  2026-11-23  9:35 ` [PATCH v2 1/4] dt-bindings: embedded-controller: lenovo,thinkpad-t14s-ec: Add Gen 7 support Abel Vesa
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Abel Vesa @ 2026-11-23  9:35 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Bjorn Andersson, Konrad Dybcio, Abel Vesa
  Cc: devicetree, linux-kernel, platform-driver-x86, linux-arm-msm,
	Krzysztof Kozlowski, Abel Vesa, Hans de Goede, Konrad Dybcio

The Lenovo ThinkPad T14s Gen 7 (Snapdragon X2, Mahua) has an embedded
controller at the same I2C address as the Gen 6 one, with the same
register layout and event codes, but it speaks a different command
protocol over I2C. With the existing driver the EC never reports any
event and the LED and keyboard backlight writes have no effect.

The Gen 7 protocol is taken from the ACPI EC accessors in the Gen 7
firmware (RDEC, WREC and QEVT): reads, writes and event reads use the
0x80, 0x81 and 0x84 commands. The firmware also describes the EC
interrupt as edge triggered, active low.

Patch 1 adds a Gen 7 compatible to the binding, patch 2 adds the Gen 7
variant to the driver, patch 3 sorts the TLMM states of the T14s Gen 7
by pin number and patch 4 describes the EC on the T14s Gen 7.

Tested on a ThinkPad T14s Gen 7 (LCD): the hotkeys handled by the EC
(mic mute, F10, F12) are reported, the duplicate EC events of the
volume and mute keys are ignored, the mic mute, speaker mute and lid
logo LEDs (including the hardware blinking) and the keyboard backlight
work, and Fn+Space changes are reported through the LED class.

Prepared with help from an LLM-based assistant.

---
Changes in v2:
- Patch 1: pick up Krzysztof's R-b.
- Squashed in Hans' fixups for patch 2 (added his Co-developed-by and
  Signed-off-by):
  - Gen 7 suspend/resume: set bit 5 of register 0xcf and make the
    power and lid logo LEDs glow while suspended
  - report Fn+F12 (event 0x19) as KEY_BOOKMARKS
  - ignore the EC events of hotkeys which also come in through the
    I2C-HID keyboard
  - check the variant directly instead of the two feature bools
  - lock the I2C bus around the Gen 7 reads instead of a driver mutex
    and drop the 5 ms delay between the transfers
- Patch 2: return -EIO instead of EIO on a short read.
- Patch 2: reword the commit message to match the above.
- New patch 3 sorting the TLMM states by pin number (Konrad).
- Patch 4: place the EC pin state by pin number and pick up Konrad's
  R-b.
- Link to v1: https://patch.msgid.link/20261107-t14s-gen7-ec-v1-0-f4a8edaac447@oss.qualcomm.com

---
Abel Vesa (4):
      dt-bindings: embedded-controller: lenovo,thinkpad-t14s-ec: Add Gen 7 support
      platform: arm64: lenovo-thinkpad-t14s: Add Gen 7 EC support
      arm64: dts: qcom: mahua-lenovo-thinkpad-t14s-gen7: Sort the TLMM states by pin number
      arm64: dts: qcom: mahua-lenovo-thinkpad-t14s-gen7: Describe the Embedded Controller

 .../lenovo,thinkpad-t14s-ec.yaml                   |   4 +-
 .../qcom/mahua-lenovo-thinkpad-t14s-gen7-lcd.dts   | 126 +++++++------
 drivers/platform/arm64/lenovo-thinkpad-t14s.c      | 197 +++++++++++++++++++--
 3 files changed, 264 insertions(+), 63 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261106-t14s-gen7-ec-297593bda0fc

Best regards,
--  

Abel


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

end of thread, other threads:[~2026-11-25  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:35 [PATCH v2 0/4] platform: arm64: lenovo-thinkpad-t14s: Add support for the Gen 7 EC Abel Vesa
2026-11-23  9:35 ` [PATCH v2 1/4] dt-bindings: embedded-controller: lenovo,thinkpad-t14s-ec: Add Gen 7 support Abel Vesa
2026-11-23  9:35 ` [PATCH v2 2/4] platform: arm64: lenovo-thinkpad-t14s: Add Gen 7 EC support Abel Vesa
2026-11-23  9:35 ` [PATCH v2 3/4] arm64: dts: qcom: mahua-lenovo-thinkpad-t14s-gen7: Sort the TLMM states by pin number Abel Vesa
2026-11-25  9:13   ` Konrad Dybcio
2026-11-23  9:35 ` [PATCH v2 4/4] arm64: dts: qcom: mahua-lenovo-thinkpad-t14s-gen7: Describe the Embedded Controller Abel Vesa

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®