mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Robinson <alex@ironrobin.net>
To: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Steev Klimaszewski <threeway@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/3] arm64: dts: qcom: sc8280xp-x13s: Add embedded controller
Date: Tue, 29 Sep 2026 19:29:50 +0000	[thread overview]
Message-ID: <20260929192908.16507-4-alex@ironrobin.net> (raw)
In-Reply-To: <20260929192908.16507-1-alex@ironrobin.net>

Enable the ThinkPad X13s embedded controller so its driver can provide
keyboard backlight support when booting with Device Tree.

Use a pull-up on the EC interrupt line to match the firmware-inherited
configuration measured before Linux configured the pin.

Assisted-by: LLM
Signed-off-by: Alex Robinson <alex@ironrobin.net>

---
Review note: GPIO103 was measured at pinctrl probe before Linux
claimed/configured the pin. TLMM CTL offset 0x67000 read 0x00000003;
the pull field value of 3 decodes to pull-up on SC8280XP.

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 218573a97785b04528854b03a99c837558a33c1e..1e29bab37de6d192ec49dc407e24e1a3bc9496bd 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -806,6 +806,25 @@ &i2c4 {
 	};
 };
 
+&i2c8 {
+	clock-frequency = <400000>;
+
+	pinctrl-0 = <&i2c8_default>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	embedded-controller@28 {
+		compatible = "lenovo,thinkpad-x13s-ec";
+		reg = <0x28>;
+		interrupts-extended = <&tlmm 103 IRQ_TYPE_EDGE_FALLING>;
+		power-state-gpios = <&tlmm 176 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&ec_int_n>, <&ec_power_state>;
+		pinctrl-names = "default";
+		wakeup-source;
+	};
+};
+
 &i2c11 {
 	clock-frequency = <400000>;
 
@@ -1571,6 +1590,20 @@ cam_rgb_default: cam-rgb-default-state {
 		};
 	};
 
+	ec_int_n: ec-int-n-state {
+		pins = "gpio103";
+		function = "gpio";
+		input-enable;
+		bias-pull-up;
+	};
+
+	ec_power_state: ec-power-state {
+		pins = "gpio176";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	edp_reg_en: edp-reg-en-state {
 		pins = "gpio25";
 		function = "gpio";
@@ -1591,6 +1624,13 @@ i2c4_default: i2c4-default-state {
 		bias-disable;
 	};
 
+	i2c8_default: i2c8-default-state {
+		pins = "gpio43", "gpio44";
+		function = "qup8";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
 	i2c11_default: i2c11-default-state {
 		pins = "gpio18", "gpio19";
 		function = "qup11";


      parent reply	other threads:[~2026-09-29 19:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 19:29 [PATCH v4 0/3] Lenovo ThinkPad X13s embedded controller support Alex Robinson
2026-09-29 19:29 ` [PATCH v4 1/3] dt-bindings: embedded-controller: Add Lenovo ThinkPad X13s EC Alex Robinson
2026-09-29 19:29 ` [PATCH v4 2/3] platform: arm64: Add Lenovo ThinkPad X13s EC driver Alex Robinson
2026-09-30  6:38   ` Ilpo Järvinen
2026-09-29 19:29 ` Alex Robinson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929192908.16507-4-alex@ironrobin.net \
    --to=alex@ironrobin.net \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=threeway@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®