[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250906-thinkpad-t14s-ec-v3-0-3ce6ec21ae89@collabora.com>
Date: Sat, 06 Sep 2025 03:12:02 +0200
From: Sebastian Reichel <sre@...nel.org>
To: Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Hans de Goede <hansg@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Mark Pearson <mpearson-lenovo@...ebb.ca>
Cc: "Derek J. Clark" <derekjohn.clark@...il.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Neil Armstrong <neil.armstrong@...aro.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Subject: [PATCH v3 0/3] platform: arm64: thinkpad-t14s-ec: new driver
Introduce driver for the ThinkPad T14s Gen6 Snapdragon EC. In theory
it seems to be compatible with the ThinkPad ACPI driver, but these
devices are booted with device tree. As the name implies, the existing
ThinkPad ACPI driver only supports the ACPI interface. Looking at
the implementation, the ACPI DSDT contains many mapping functions
to translate the low level I2C messages into the interface used by
the ThinkPad ACPI driver. Adding DT support to the ThinkPad ACPI driver
would require adding all those translation functions, which would add
more or less the same amount of code as writing a separate driver using
the low level interface directly. I don't think it's sensible to make
the existing ACPI driver even more complicated, so I went for a separate
driver.
I managed to get system LEDs, audio LEDs, extra keys and the keyboard
backlight control working. The EC also seems to be used for some thermal
bits, which I haven't looked into deeply. As far as I understand most
thermal and fan control is handled by a different controller
(0x36@...5) anyways.
Apart from that the EC is involved in proper system suspend, which
is something I do not yet understand (I don't have any documentation
apart from the dis-assembled DSDT and existing ACPI driver). Right
now I disabled wake capabilities for the IRQ, since it would wake
up the system when closing the LID. Hopefully a way to mask specific
events will be found in the future.
Changes in v3:
- Link to v2: https://lore.kernel.org/r/20250905-thinkpad-t14s-ec-v2-0-7da5d70aa423@collabora.com
- Add <linux/container_of.h> include (Ilpo Järvinen)
- Add <linux/dev_printk.h> include (Ilpo Järvinen)
- Add <linux/interrupt.h> include (Ilpo Järvinen)
- Align CMD defines (Ilpo Järvinen)
- Rename thinkpad_t14s_led_set() to thinkpad_t14s_led_brightness_set() (Ilpo Järvinen)
- Replace && with & in thinkpad_t14s_audio_led_get(); good catch! (Konrad Dybcio)
- Use regmap_assign_bits in thinkpad_t14s_audio_led_set (Konrad Dybcio)
- Directly return input_register_device() at the end of
thinkpad_t14s_input_probe (Konrad Dybcio)
- Remove THINKPAD_ prefix (Konrad Dybcio)
- Also use T14S_EC_ prefix for LEDs states (myself)
- Collect Reviewed-by tags
Changes in v2:
- Link to v1: https://lore.kernel.org/r/20250831-thinkpad-t14s-ec-v1-0-6e06a07afe0f@collabora.com
- Apply Reviewed-by tags from Bryan O'Donoghue
- Apply Tested-by tags from Neil Armstrong
- Update DT binding description, location and examples (Krzysztof Kozlowski)
- Add missing wakeup-source to DT binding (Rob Herring Bot)
- Update DTS newlines, pinctrl order, nodename (Konrad Dybcio)
- Updates to EC driver
- Add bits.h and bitfield.h include (Ilpo Järvinen)
- Drop mutex.h (myself, leftover from development)
- Drop DEBUG define (Ilpo Järvinen)
- Add THINKPAD_T14S_EC_BLINK_RATE_ON_OFF_MS (Bryan O'Donoghue, Ilpo Järvinen)
- Add THINKPAD_T14S_EC_KEY_EVT_OFFSET (Ilpo Järvinen)
- Add THINKPAD_T14S_EC_KEY_ENTRY (myself, to keep line length sane
after THINKPAD_T14S_EC_KEY_EVT_OFFSET)
- Align values of thinkpad_t14s_ec_led_status_t (Ilpo Järvinen)
- Use u8 instead of char for I2C command buffers (Ilpo Järvinen)
- Add some more newlines after goto/return (Bryan O'Donoghue)
- Use FIELD_PREP/FIELD_GET instead of _SHIFT (Ilpo Järvinen)
- Explicitly map to LED_ON/LED_OFF in audio_led_get (Ilpo Järvinen)
- Add missing , after .driver.of_match_table (Ilpo Järvinen)
- Change from KEY_MODE to KEY_PERFORMANCE (myself after seeing a patch
for HID lenovo being sent to the list)
Signed-off-by: Sebastian Reichel <sre@...nel.org>
---
Sebastian Reichel (3):
dt-bindings: platform: Add Lenovo Thinkpad T14s EC
platform: arm64: thinkpad-t14s-ec: new driver
arm64: dts: qcom: x1e80100-t14s: add EC
.../lenovo,thinkpad-t14s-ec.yaml | 50 ++
MAINTAINERS | 6 +
.../dts/qcom/x1e78100-lenovo-thinkpad-t14s.dtsi | 24 +
drivers/platform/arm64/Kconfig | 20 +
drivers/platform/arm64/Makefile | 1 +
drivers/platform/arm64/lenovo-thinkpad-t14s.c | 607 +++++++++++++++++++++
6 files changed, 708 insertions(+)
---
base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
change-id: 20250831-thinkpad-t14s-ec-ddeb23dbdafb
Best regards,
--
Sebastian Reichel <sebastian.reichel@...labora.com>
Powered by blists - more mailing lists