Skip to contentSkip to conversation

Add support for Microsoft Surface Pro 12in

PATCH Applied Harrison Vanderbyl 4 participants 8 messages May 29 – Jun 9

Subsystems (4)

v3 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add support for Microsoft Surface Pro 12in

Changes in v3:

Rebase:
- Rebased on next-20260528
- Removed ice device tree changes

Device tree:
- Fixed C++ style comment in &i2c9 to use /* */ style
- Flattened mdss_dp3 port into &mdss_dp3_out directly
- Whitespace and formatting nits

Changes in v2:
Ice device tree:
- Updated to use 0x0 formatting

Panel:
- Add edid to commit message

Device tree:
- Fixed formatting and ordering nits
- Removed extra dmic audio declarations
- Added suspected devices on i2c busses
- Fixed incorrect usb regulator
- Describe panel pin regulator
- Added defaults for volume button GPIOs

Already applied:
- dt-bindings: arm: qcom: Add Microsoft Surface Pro 12in (landed in linux-next)
- firmware: qcom: scm: Allow QSEECOM on Surface Pro 12in (applied by Bjorn Andersson, commit 667d05a09db3)
- platform/surface: SAM: Add support for Surface Pro 12in (applied to review-ilpo-next by Ilpo Järvinen)
- drm/panel-edp: Add panel for Surface Pro 12in (pushed to drm-misc-next by Doug Anderson, commit 02f48ffdf96c)

Pending in this series:
- hid: Pen battery quirk for Surface Pro 12in
(acked by Jiri Kosina in v1, needs a tree)
- arm64: dts: qcom: Add Microsoft Surface Pro 12in (reviewed by Dmitry Baryshkov in v2, minor style fixes applied)

Will be done in future patches:
- Camera support (pending purwa cams patchset)
- IRIS jpeg decoder support (pending purwa iris patchset)
- Accelerometer support via ADSP (probably userspace)

(Audioreach/ucm2 changes for audio)
https://github.com/linux-msm/audioreach-topology/pull/32
https://github.com/alsa-project/alsa-ucm-conf/blob/9577cd31121546b288759097901025376141177b/ucm2/Qualcomm/x1e80100/Surface12in-HiFi.conf

Link to v1:
https://lore.kernel.org/all/[email protected]/
Link to v2:
https://lore.kernel.org/all/[email protected]/

Harrison Vanderbyl (2):
hid: Pen battery quirk for Surface Pro 12in
arm64: dts: qcom: Add Microsoft Surface Pro 12in

 arch/arm64/boot/dts/qcom/Makefile             |    2 +
 .../dts/qcom/x1p42100-microsoft-sp12in.dts    | 1194 +++++++++++++++++
 drivers/hid/hid-ids.h                         |    1 +
 drivers/hid/hid-input.c                       |    2 +
 4 files changed, 1199 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts

base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad

Signature · 1 line
2.53.0
#1 lore raw

PATCH v3 1/2 hid: Pen battery quirk for Surface Pro 12in

The pen setup for this device uses bluetooth for communicating battery levels and status instead of reporting it over i2c.

Without this quirk, the device either reports an
extra, broken phantom battery, or hangs.

---
 drivers/hid/hid-ids.h   | 1 +
 drivers/hid/hid-input.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/hid/hid-ids.h +1 -0
index a1cfa436344a..c383778e241c 100644
@@ -463,6 +463,7 @@
 #define USB_DEVICE_ID_HP_X2		0x074d
 #define USB_DEVICE_ID_HP_X2_10_COVER	0x0755
 #define I2C_DEVICE_ID_CHROMEBOOK_TROGDOR_POMPOM	0x2F81
+#define I2C_DEVICE_ID_SURFACE_PRO_12IN  0x4376
 
 #define USB_VENDOR_ID_ELECOM		0x056e
 #define USB_DEVICE_ID_ELECOM_BM084	0x0061
drivers/hid/hid-input.c +2 -0
index d73cfa2e73d3..61ecd840d0bd 100644
@@ -395,6 +395,8 @@ static const struct hid_device_id hid_battery_quirks[] = {
 	  HID_BATTERY_QUIRK_AVOID_QUERY },
 	{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_CHROMEBOOK_TROGDOR_POMPOM),
 	  HID_BATTERY_QUIRK_AVOID_QUERY },
+	{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_SURFACE_PRO_12IN),
+	  HID_BATTERY_QUIRK_IGNORE },
 	/*
 	 * Elan HID touchscreens seem to all report a non present battery,
 	 * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C and USB HID devices.
Signature · 1 line
2.53.0
#2 lore raw

PATCH v3 2/2 arm64: dts: qcom: Add Microsoft Surface Pro 12in

In reply to Harrison Vanderbyl

Initial device tree for Microsoft Surface Pro 12in

Currently supported:
- UFS
- Touchscreen
- Pen
- USB 3.2 x2 (DP Alt Mode)
- Audio
- Wifi
- Bluetooth
- CDSP
- ADSP
- GPU

Not currently supported:
- Accelerometer
- Front, Back and IR cameras
- IRIS video decoder

Tested on Surface_Pro_12in_1st_Ed_with_Snapdragon_2110

---
 arch/arm64/boot/dts/qcom/Makefile             |    2 +
 .../dts/qcom/x1p42100-microsoft-sp12in.dts    | 1194 +++++++++++++++++
 2 files changed, 1196 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts
arch/arm64/boot/dts/qcom/Makefile +2 -0
index 6f33c4e2f09c..ada494ecbc64 100644
@@ -457,3 +457,5 @@ x1p42100-lenovo-thinkbook-16-el2-dtbs	:= x1p42100-lenovo-thinkbook-16.dtb x1-el2
 dtb-$(CONFIG_ARCH_QCOM)	+= x1p42100-lenovo-thinkbook-16.dtb x1p42100-lenovo-thinkbook-16-el2.dtb
 x1p64100-microsoft-denali-el2-dtbs	:= x1p64100-microsoft-denali.dtb x1-el2.dtbo
 dtb-$(CONFIG_ARCH_QCOM)	+= x1p64100-microsoft-denali.dtb x1p64100-microsoft-denali-el2.dtb
+x1p42100-microsoft-sp12in-el2-dtbs	:= x1p42100-microsoft-sp12in.dtb x1-el2.dtbo
+dtb-$(CONFIG_ARCH_QCOM)	+= x1p42100-microsoft-sp12in.dtb x1p42100-microsoft-sp12in-el2.dtb
arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +1194 -0

1,194 lines not on this page · raw message

Signature · 1 line
2.53.0
#3 lore raw

Re: [PATCH v3 2/2] arm64: dts: qcom: Add Microsoft Surface Pro 12in

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] LDO regulators defined across PMICs c, d, e, i, and j are missing their corresponding parent…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] LDO regulators defined across PMICs c, d, e, i, and j are missing their corresponding parent 'vdd-lX-supply' properties. --

commit ad40084fe87bf7f45bba2d17354ba7647d363116
Author: Harrison Vanderbyl <[email protected]>

arm64: dts: qcom: Add Microsoft Surface Pro 12in

This commit introduces the initial device tree for the Microsoft Surface Pro 12in based on the Snapdragon X Elite platform. It enables basic hardware support including ufs, touchscreen, display, and various connectivity peripherals.

Quoted 5 lines
arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +0 -0
new file mode 100644
index 0000000000000..983966e123e55

[ ... ]

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts line 621

Quoted 8 lines
arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +8 -0
+	regulators-6 {
+		compatible = "qcom,pm8550ve-rpmh-regulators";
+		qcom,pmic-id = "i";
+
+		vdd-l1-supply = <&vreg_s4c_1p8>;
+		vdd-l2-supply = <&vreg_s5j_1p2>;
+		vdd-s1-supply = <&vph_pwr>;
+		vdd-s2-supply = <&vph_pwr>;

[Severity: High]
Are we missing the parent supply properties (such as vdd-l3-supply) for the ldos defined across pmics c, d, e, i, and j?

Without linking these child ldos to their active parent buck converters on this board (for example, vreg_s1i_0p9), the regulator core cannot track the hardware dependency hierarchy.

Because the parent buck converter has no explicitly recorded consumers in the device tree, will the Linux regulator core forcefully disable it during late initcall as an unused regulator?

Since ldos like vreg_l3i_0p8 supply essential components such as the ufs phy, could this regression disconnect the storage and result in an unavoidable kernel panic?

Quoted 7 lines
arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +7 -0
+
+		vreg_s1i_0p9: smps1 {
+			regulator-name = "vreg_s1i_0p9";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <920000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#4 lore raw

Re: [PATCH v3 2/2] arm64: dts: qcom: Add Microsoft Surface Pro 12in

In reply to Harrison Vanderbyl
Quoted 19 lines · Harrison Vanderbyl

Initial device tree for Microsoft Surface Pro 12in

Currently supported:
- UFS
- Touchscreen
- Pen
- USB 3.2 x2 (DP Alt Mode)
- Audio
- Wifi
- Bluetooth
- CDSP
- ADSP
- GPU

Not currently supported:
- Accelerometer
- Front, Back and IR cameras
- IRIS video decoder

Quoted 5 lines

Tested on Surface_Pro_12in_1st_Ed_with_Snapdragon_2110

---

lg, just a couple nits

[...]

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts line 271

Quoted 3 lines
arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +3 -0
+			codec {
+				sound-dai = <&left_spkr>, <&right_spkr>,
+						<&swr0 0>, <&lpass_wsamacro 0>;

Please align the <s

[...]

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts line 759

Quoted 6 lines

+&i2c9 {

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +5 -0
+	clock-frequency = <400000>;
+
+	/* NFC @28, commercial devices only */
+
+	status = "okay";

Because we'd put the subnodes for devices under the 'status' line (DTC enforces that), please move the comment below as well

Or since it's @28, perhaps it's just nxp,nxp-nci-i2c and it could work for you ootb?

[...]

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts line 973

Quoted 3 lines

+&tlmm {

arch/arm64/boot/dts/qcom/x1p42100-microsoft-sp12in.dts new file +2 -0
+	gpio-reserved-ranges = <34 2>, /* Unused */
+				   <44 4>; /* SPI (TPM) */

Please align the <s (or is it my mail client playing tricks on me?)

Konrad

#5 lore raw

Re: [PATCH v3 2/2] arm64: dts: qcom: Add Microsoft Surface Pro 12in

Quoted 2 lines · Konrad Dybcio

Because we'd put the subnodes for devices under the 'status' line (DTC enforces that), please move the comment below as well

Will do,

Quoted 2 lines

Or since it's @28, perhaps it's just nxp,nxp-nci-i2c and it could work for you ootb?

Unfortunately for me, the device/antenna is not present on the consumer version, I was able to confirm this during a speaker replacement.

Quoted 1 line

Please align the <s (or is it my mail client playing tricks on me?)

The alignment changes depending on what text editor I copy paste this section into. I have them aligned the same as the other device trees are aligned though.

#6 lore raw

Re: [PATCH v3 2/2] arm64: dts: qcom: Add Microsoft Surface Pro 12in

Quoted 11 lines · Harrison Vanderbyl
Quoted 2 lines · Konrad Dybcio

Because we'd put the subnodes for devices under the 'status' line (DTC enforces that), please move the comment below as well

Will do,

Quoted 2 lines

Or since it's @28, perhaps it's just nxp,nxp-nci-i2c and it could work for you ootb?

Unfortunately for me, the device/antenna is not present on the consumer version, I was able to confirm this during a speaker replacement.

So perhaps "commercial devices only" refers to ""Surface Pro for Business 12-inch"" [1] which is presumably an actual separate SKU?

I initially interpreted "commercial devices" as "not prototypes"

[1] https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/microsoft/mlsd/documents/presentations/en-us/surface/MSFT-echo-surface-pro-12-inch-snapdragon-techspecs-factsheet.pdf

Quoted 4 lines
Quoted 2 lines

Please align the <s (or is it my mail client playing tricks on me?)

The alignment changes depending on what text editor I copy paste this section into.

This shouldn't be the case, so long as you set the kernel-standard tab width to 8.

Konrad

maintainer Applied
#7 lore raw

Re: (subset) [PATCH v3 0/2] Add support for Microsoft Surface Pro 12in

In reply to Harrison Vanderbyl
Quoted 6 lines · Harrison Vanderbyl

Changes in v3:

Rebase:
- Rebased on next-20260528
- Removed ice device tree changes

Quoted 6 lines

Device tree:
- Fixed C++ style comment in &i2c9 to use /* */ style
- Flattened mdss_dp3 port into &mdss_dp3_out directly
- Whitespace and formatting nits

[...]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-7.2/core), thanks!

[1/2] hid: Pen battery quirk for Surface Pro 12in

      https://git.kernel.org/hid/hid/c/3a1e4e77e3ee

Cheers,

Signature · 1 line
Benjamin Tissoires <[email protected]>