Skip to contentSkip to conversation

Microsoft Surface Pro 9 5G support

PATCH Applied Jérôme de Bretagne 6 participants 21 messages Sep 8, 2024 – Oct 24, 2024

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover Microsoft Surface Pro 9 5G support

This series brings support for the SC8280XP-based Microsoft Surface Pro 9 5G.

---
Changes in v2:
- Style fixes
- Rename the devicetree to sc8280xp-microsoft-arcata.dts
- Update the audio nodes to use codec@ instead of wcd9380-rx or -tx
- Document which node corresponds to which physical USB Type-C port
- Reordering to get property-0 followed by property-names consistently
- Add a dedicated Wi-Fi calibration variant
- Remove gpio-reserved-ranges in tlmm node as not needed to boot
- Add support for Surface Pro 9 5G in surface_aggregator_registry.c
- Switch to the upstream "microsoft,surface-sam" binding
- Fix uart18 clock from S1 to S2
- Include Acked-by: and Reviewed-by: tags
- Link to v1: https://lore.kernel.org/all/[email protected]/

---
Jérôme de Bretagne (5):
dt-bindings: arm: qcom: Document Microsoft Surface Pro 9 5G
firmware: qcom: scm: Allow QSEECOM on Microsoft Surface Pro 9 5G platform/surface: aggregator_registry: Add Surface Pro 9 5G
arm64: dts: qcom: sc8280xp: Add uart18
arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G

 .../devicetree/bindings/arm/qcom.yaml         |    1 +
 arch/arm64/boot/dts/qcom/Makefile             |    1 +
 .../dts/qcom/sc8280xp-microsoft-arcata.dts    | 1032 +++++++++++++++++
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        |   48 +
 drivers/firmware/qcom/qcom_scm.c              |    1 +
 .../surface/surface_aggregator_registry.c     |   17 +
 6 files changed, 1100 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/5 dt-bindings: arm: qcom: Document Microsoft Surface Pro 9 5G

Add compatible for the SC8280XP-based Microsoft Surface Pro 9 5G, using its Arcata codename.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
index f08e13b61172..114c7f5dc402 100644
@@ -810,6 +810,7 @@ properties:
       - items:
           - enum:
               - lenovo,thinkpad-x13s
+              - microsoft,arcata
               - qcom,sc8280xp-crd
               - qcom,sc8280xp-qrd
           - const: qcom,sc8280xp
Signature · 1 line
2.45.2
#2 lore raw

PATCH v2 2/5 firmware: qcom: scm: Allow QSEECOM on Microsoft Surface Pro 9 5G

In reply to Jérôme de Bretagne

Add the SC8280XP-based Microsoft Surface Pro 9 5G to the allowlist.

---
 drivers/firmware/qcom/qcom_scm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/qcom/qcom_scm.c +1 -0
index 00c379a3cceb..5c8d8d75fb0a 100644
@@ -1725,6 +1725,7 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
 static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
 	{ .compatible = "lenovo,flex-5g" },
 	{ .compatible = "lenovo,thinkpad-x13s", },
+	{ .compatible = "microsoft,arcata", },
 	{ .compatible = "qcom,sc8180x-primus" },
 	{ .compatible = "qcom,x1e80100-crd" },
 	{ .compatible = "qcom,x1e80100-qcp" },
Signature · 1 line
2.45.2
maintainer Reviewed-by on v2 2/5
#3 lore raw

Re: [PATCH v2 2/5] firmware: qcom: scm: Allow QSEECOM on Microsoft Surface Pro 9 5G

Quoted 13 lines · Jérôme de Bretagne

Add the SC8280XP-based Microsoft Surface Pro 9 5G to the allowlist.

---
  drivers/firmware/qcom/qcom_scm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/firmware/qcom/qcom_scm.c +0 -0
index 00c379a3cceb..5c8d8d75fb0a 100644

drivers/firmware/qcom/qcom_scm.c EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send); · line 1731

Quoted 7 lines
drivers/firmware/qcom/qcom_scm.c +1 -0
@@ -1725,6 +1725,7 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
  static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
  	{ .compatible = "lenovo,flex-5g" },
  	{ .compatible = "lenovo,thinkpad-x13s", },
+	{ .compatible = "microsoft,arcata", },
  	{ .compatible = "qcom,sc8180x-primus" },
  	{ .compatible = "qcom,x1e80100-crd" },
  	{ .compatible = "qcom,x1e80100-qcp" },

Looks good to me.

#4 lore raw

PATCH v2 3/5 platform/surface: aggregator_registry: Add Surface Pro 9 5G

In reply to Jérôme de Bretagne

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
 .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +17 -0
index 25c8aa2131d6..8b34d7e465c2 100644
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
 	NULL,
 };
 
+/* Devices for Surface Pro 9 5G. */
+static const struct software_node *ssam_node_group_sp9_5G[] = {
+	&ssam_node_root,
+	&ssam_node_hub_kip,
+	&ssam_node_bat_ac,
+	&ssam_node_bat_main,
+	&ssam_node_tmp_sensors,
+	&ssam_node_hid_kip_keyboard,
+	&ssam_node_hid_kip_penstash,
+	&ssam_node_hid_kip_touchpad,
+	&ssam_node_hid_kip_fwupd,
+	&ssam_node_hid_sam_sensors,
+	&ssam_node_kip_tablet_switch,
+	NULL,
+};
 
 /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
 static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+	/* Surface Pro 9 5G */
+	{ .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
 	/* Surface Laptop 7 */
 	{ .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
 	{ .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },
Signature · 1 line
2.45.2
maintainer Reviewed-by on v2 3/5
#5 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

Looks good. Two very small nit-picks below, if this goes for a v3:

Quoted 13 lines · Jérôme de Bretagne

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
  .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +0 -0
index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 393

Quoted 4 lines
drivers/platform/surface/surface_aggregator_registry.c +1 -0
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
  	NULL,
  };
 
+/* Devices for Surface Pro 9 5G. */

Would be nice if you could change the comment on the SP9 node group to "Surface Pro 9 (Intel/x86)" and the comment here to "Surface Pro 9 5G (ARM/QCOM)" or something along those lines to make things a bit more clear.

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 394

Quoted 1 line
drivers/platform/surface/surface_aggregator_registry.c +1 -0
+static const struct software_node *ssam_node_group_sp9_5G[] = {

(This is really just me being a bit obsessive:) It would be nice to have all-lowercase variable names (regarding the 5G).

Quoted 17 lines
drivers/platform/surface/surface_aggregator_registry.c +13 -0
+	&ssam_node_root,
+	&ssam_node_hub_kip,
+	&ssam_node_bat_ac,
+	&ssam_node_bat_main,
+	&ssam_node_tmp_sensors,
+	&ssam_node_hid_kip_keyboard,
+	&ssam_node_hid_kip_penstash,
+	&ssam_node_hid_kip_touchpad,
+	&ssam_node_hid_kip_fwupd,
+	&ssam_node_hid_sam_sensors,
+	&ssam_node_kip_tablet_switch,
+	NULL,
+};
 
  /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 

drivers/platform/surface/surface_aggregator_registry.c static const struct acpi_device_id ssam_platform_hub_acpi_match[] = { · line 484

Quoted 8 lines
drivers/platform/surface/surface_aggregator_registry.c +2 -0
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
  MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
  static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+	/* Surface Pro 9 5G */
+	{ .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
  	/* Surface Laptop 7 */
  	{ .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
  	{ .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

Thanks!

On a related note: I'm wondering whether we should also already add the ACPI IDs for the as-of-now ARM-only devices. Technically, things won't work with ACPI right now, but it's not because of the SAM driver stack. Or maybe at least add them to the comments as a way of documenting it.

Best regards,
Max

#6 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

Hi,

I'm replying with Hans and Ilpo, who I initially forgot for this patch, sorry about that.

Quoted 2 lines · Maximilian Luz

Looks good. Two very small nit-picks below, if this goes for a v3:

Atm I'm not planning for a v3 as Bjorn has applied the other v2 patches earlier today.
Feel free to include the 2 small suggestions when applying this patch maybe?

Quoted 24 lines · Jérôme de Bretagne
Quoted 13 lines

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
  .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +0 -0
index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 393

Quoted 4 lines
drivers/platform/surface/surface_aggregator_registry.c +1 -0
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
      NULL,
  };
 
+/* Devices for Surface Pro 9 5G. */

Would be nice if you could change the comment on the SP9 node group to "Surface Pro 9 (Intel/x86)" and the comment here to "Surface Pro 9 5G (ARM/QCOM)" or something along those lines to make things a bit more clear.

Quoted 4 lines

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 394

Quoted 1 line
drivers/platform/surface/surface_aggregator_registry.c +1 -0
+static const struct software_node *ssam_node_group_sp9_5G[] = {

(This is really just me being a bit obsessive:) It would be nice to have all-lowercase variable names (regarding the 5G).

:)

Quoted 28 lines
Quoted 17 lines
drivers/platform/surface/surface_aggregator_registry.c +13 -0
+     &ssam_node_root,
+     &ssam_node_hub_kip,
+     &ssam_node_bat_ac,
+     &ssam_node_bat_main,
+     &ssam_node_tmp_sensors,
+     &ssam_node_hid_kip_keyboard,
+     &ssam_node_hid_kip_penstash,
+     &ssam_node_hid_kip_touchpad,
+     &ssam_node_hid_kip_fwupd,
+     &ssam_node_hid_sam_sensors,
+     &ssam_node_kip_tablet_switch,
+     NULL,
+};
 
  /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 

drivers/platform/surface/surface_aggregator_registry.c static const struct acpi_device_id ssam_platform_hub_acpi_match[] = { · line 484

Quoted 8 lines
drivers/platform/surface/surface_aggregator_registry.c +2 -0
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
  MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
  static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+     /* Surface Pro 9 5G */
+     { .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
      /* Surface Laptop 7 */
      { .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
      { .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

Thanks!

Quoted 1 line

Thanks for your review and all the work about SSAM for Surface owners!

Regards,
Jérôme

Quoted 7 lines

On a related note: I'm wondering whether we should also already add the ACPI IDs for the as-of-now ARM-only devices. Technically, things won't work with ACPI right now, but it's not because of the SAM driver stack. Or maybe at least add them to the comments as a way of documenting it.

Best regards,
Max

#7 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

Hi Jérôme,

Quoted 4 lines · Jérôme de Bretagne

Hi,

I'm replying with Hans and Ilpo, who I initially forgot for this patch, sorry about that.

No worries thank you for forwarding Maximilian's review.

Quoted 68 lines
Quoted 2 lines · Maximilian Luz

Looks good. Two very small nit-picks below, if this goes for a v3:

Atm I'm not planning for a v3 as Bjorn has applied the other v2 patches earlier today.
Feel free to include the 2 small suggestions when applying this patch maybe?

Quoted 24 lines · Jérôme de Bretagne
Quoted 13 lines

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
  .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +0 -0
index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 393

Quoted 4 lines
drivers/platform/surface/surface_aggregator_registry.c +1 -0
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
      NULL,
  };
 
+/* Devices for Surface Pro 9 5G. */

Would be nice if you could change the comment on the SP9 node group to "Surface Pro 9 (Intel/x86)" and the comment here to "Surface Pro 9 5G (ARM/QCOM)" or something along those lines to make things a bit more clear.

Quoted 4 lines

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 394

Quoted 1 line
drivers/platform/surface/surface_aggregator_registry.c +1 -0
+static const struct software_node *ssam_node_group_sp9_5G[] = {

(This is really just me being a bit obsessive:) It would be nice to have all-lowercase variable names (regarding the 5G).

:)

Quoted 28 lines
Quoted 17 lines
drivers/platform/surface/surface_aggregator_registry.c +13 -0
+     &ssam_node_root,
+     &ssam_node_hub_kip,
+     &ssam_node_bat_ac,
+     &ssam_node_bat_main,
+     &ssam_node_tmp_sensors,
+     &ssam_node_hid_kip_keyboard,
+     &ssam_node_hid_kip_penstash,
+     &ssam_node_hid_kip_touchpad,
+     &ssam_node_hid_kip_fwupd,
+     &ssam_node_hid_sam_sensors,
+     &ssam_node_kip_tablet_switch,
+     NULL,
+};
 
  /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 

drivers/platform/surface/surface_aggregator_registry.c static const struct acpi_device_id ssam_platform_hub_acpi_match[] = { · line 484

Quoted 8 lines
drivers/platform/surface/surface_aggregator_registry.c +2 -0
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
  MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
  static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+     /* Surface Pro 9 5G */
+     { .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
      /* Surface Laptop 7 */
      { .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
      { .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

Thanks!

Quoted 3 lines
Quoted 1 line

Thanks for your review and all the work about SSAM for Surface owners!

FWIW I agree with Maximilian's remarks and I would really like to see these applied to clearly differentiate the x86 and ARM versions.

Normally I would pick up a patch like this which just adds hw-ids as a fix for 6.12-rc# and squash in the suggested changes.

But looking at the test of the series this is more 6.13 material since the rest is landing in 6.13, right ?

Patches for linux-next / 6.13 are managed by Ilpo this cycle.

So I'll leave it up to Ilpo if he will squash in the suggested changes or if he wants a new version (of just this patch, no need for a v3 of the already applied patches).

Regards,

Hans

#8 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

Quoted 79 lines · Hans de Goede

Hi Jérôme,

Quoted 4 lines · Jérôme de Bretagne

Hi,

I'm replying with Hans and Ilpo, who I initially forgot for this patch, sorry about that.

No worries thank you for forwarding Maximilian's review.

Quoted 68 lines
Quoted 2 lines · Maximilian Luz

Looks good. Two very small nit-picks below, if this goes for a v3:

Atm I'm not planning for a v3 as Bjorn has applied the other v2 patches earlier today.
Feel free to include the 2 small suggestions when applying this patch maybe?

Quoted 24 lines · Jérôme de Bretagne
Quoted 13 lines

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
  .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +0 -0
index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 393

Quoted 4 lines
drivers/platform/surface/surface_aggregator_registry.c +1 -0
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
      NULL,
  };
 
+/* Devices for Surface Pro 9 5G. */

Would be nice if you could change the comment on the SP9 node group to "Surface Pro 9 (Intel/x86)" and the comment here to "Surface Pro 9 5G (ARM/QCOM)" or something along those lines to make things a bit more clear.

Quoted 4 lines

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 394

Quoted 1 line
drivers/platform/surface/surface_aggregator_registry.c +1 -0
+static const struct software_node *ssam_node_group_sp9_5G[] = {

(This is really just me being a bit obsessive:) It would be nice to have all-lowercase variable names (regarding the 5G).

:)

Quoted 28 lines
Quoted 17 lines
drivers/platform/surface/surface_aggregator_registry.c +13 -0
+     &ssam_node_root,
+     &ssam_node_hub_kip,
+     &ssam_node_bat_ac,
+     &ssam_node_bat_main,
+     &ssam_node_tmp_sensors,
+     &ssam_node_hid_kip_keyboard,
+     &ssam_node_hid_kip_penstash,
+     &ssam_node_hid_kip_touchpad,
+     &ssam_node_hid_kip_fwupd,
+     &ssam_node_hid_sam_sensors,
+     &ssam_node_kip_tablet_switch,
+     NULL,
+};
 
  /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 

drivers/platform/surface/surface_aggregator_registry.c static const struct acpi_device_id ssam_platform_hub_acpi_match[] = { · line 484

Quoted 8 lines
drivers/platform/surface/surface_aggregator_registry.c +2 -0
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
  MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
  static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+     /* Surface Pro 9 5G */
+     { .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
      /* Surface Laptop 7 */
      { .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
      { .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

Thanks!

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Thanks for your review and all the work about SSAM for Surface owners!

FWIW I agree with Maximilian's remarks and I would really like to see these applied to clearly differentiate the x86 and ARM versions.

I stuck to the official names but they can be confusing as-is.

Quoted 5 lines

Normally I would pick up a patch like this which just adds hw-ids as a fix for 6.12-rc# and squash in the suggested changes.

But looking at the test of the series this is more 6.13 material since the rest is landing in 6.13, right ?

The rest is in arm64-for-6.13 and drivers-for-6.13 in Bjorn's tree indeed.

Quoted 9 lines

Patches for linux-next / 6.13 are managed by Ilpo this cycle.

So I'll leave it up to Ilpo if he will squash in the suggested changes or if he wants a new version (of just this patch, no need for a v3 of the already applied patches).

Regards,

Hans

Sure, let's see what Ilpo prefers.

Regards,
Jérôme

maintainer
#9 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

In reply to Hans de Goede
Quoted 88 lines · Hans de Goede

Hi Jérôme,

Quoted 4 lines · Jérôme de Bretagne

Hi,

I'm replying with Hans and Ilpo, who I initially forgot for this patch, sorry about that.

No worries thank you for forwarding Maximilian's review.

Quoted 68 lines
Quoted 2 lines · Maximilian Luz

Looks good. Two very small nit-picks below, if this goes for a v3:

Atm I'm not planning for a v3 as Bjorn has applied the other v2 patches earlier today.
Feel free to include the 2 small suggestions when applying this patch maybe?

Quoted 24 lines · Jérôme de Bretagne
Quoted 13 lines

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
  .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +0 -0
index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 393

Quoted 4 lines
drivers/platform/surface/surface_aggregator_registry.c +1 -0
@@ -390,6 +390,21 @@ static const struct software_node *ssam_node_group_sp9[] = {
      NULL,
  };
 
+/* Devices for Surface Pro 9 5G. */

Would be nice if you could change the comment on the SP9 node group to "Surface Pro 9 (Intel/x86)" and the comment here to "Surface Pro 9 5G (ARM/QCOM)" or something along those lines to make things a bit more clear.

Quoted 4 lines

drivers/platform/surface/surface_aggregator_registry.c static const struct software_node *ssam_node_group_sp9[] = { · line 394

Quoted 1 line
drivers/platform/surface/surface_aggregator_registry.c +1 -0
+static const struct software_node *ssam_node_group_sp9_5G[] = {

(This is really just me being a bit obsessive:) It would be nice to have all-lowercase variable names (regarding the 5G).

:)

Quoted 28 lines
Quoted 17 lines
drivers/platform/surface/surface_aggregator_registry.c +13 -0
+     &ssam_node_root,
+     &ssam_node_hub_kip,
+     &ssam_node_bat_ac,
+     &ssam_node_bat_main,
+     &ssam_node_tmp_sensors,
+     &ssam_node_hid_kip_keyboard,
+     &ssam_node_hid_kip_penstash,
+     &ssam_node_hid_kip_touchpad,
+     &ssam_node_hid_kip_fwupd,
+     &ssam_node_hid_sam_sensors,
+     &ssam_node_kip_tablet_switch,
+     NULL,
+};
 
  /* -- SSAM platform/meta-hub driver. ---------------------------------------- */
 

drivers/platform/surface/surface_aggregator_registry.c static const struct acpi_device_id ssam_platform_hub_acpi_match[] = { · line 484

Quoted 8 lines
drivers/platform/surface/surface_aggregator_registry.c +2 -0
@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
  MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);
 
  static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
+     /* Surface Pro 9 5G */
+     { .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },
      /* Surface Laptop 7 */
      { .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
      { .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

Thanks!

Quoted 3 lines
Quoted 1 line

Thanks for your review and all the work about SSAM for Surface owners!

FWIW I agree with Maximilian's remarks and I would really like to see these applied to clearly differentiate the x86 and ARM versions.

Normally I would pick up a patch like this which just adds hw-ids as a fix for 6.12-rc# and squash in the suggested changes.

Quoted 8 lines

But looking at the test of the series this is more 6.13 material since the rest is landing in 6.13, right ?

Patches for linux-next / 6.13 are managed by Ilpo this cycle.

So I'll leave it up to Ilpo if he will squash in the suggested changes or if he wants a new version (of just this patch, no need for a v3 of the already applied patches).

Hi all,

I've now applied patch 3 to review-ilpo branch in pdx86 repo.

I'd appreciate if somebody confirms I got those comment edits right.

Signature · 1 line
 i.
maintainer
#10 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

On 10/22/24 10:56 AM, Ilpo Järvinen wrote:

[...]

Quoted 6 lines

Hi all,

I've now applied patch 3 to review-ilpo branch in pdx86 repo.

I'd appreciate if somebody confirms I got those comment edits right.

Hi Ilpo,

looks good to me. Thanks for fixing this up!

Best regards,
Max

#11 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

Quoted 12 lines · Maximilian Luz

On 10/22/24 10:56 AM, Ilpo Järvinen wrote:

[...]

Quoted 6 lines

Hi all,

I've now applied patch 3 to review-ilpo branch in pdx86 repo.

I'd appreciate if somebody confirms I got those comment edits right.

Quoted 6 lines

Hi Ilpo,

looks good to me. Thanks for fixing this up!

Best regards,
Max

Hi Ilpo, hi Max,

It looks good to me too.

Thank you both,
Jérôme

maintainer
#12 lore raw

Re: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G

In reply to Maximilian Luz
Quoted 6 lines · Maximilian Luz

On 10/22/24 10:56 AM, Ilpo Järvinen wrote:

[...]

Quoted 2 lines

Hi all,

Quoted 8 lines
Quoted 4 lines

I've now applied patch 3 to review-ilpo branch in pdx86 repo.

I'd appreciate if somebody confirms I got those comment edits right.

Hi Ilpo,

looks good to me. Thanks for fixing this up!

Great! Thanks for confirmation.

Signature · 1 line
 i.
#13 lore raw

PATCH v2 3/5 platform/surface: aggregator_registry: Add Surface Pro 9 5G

In reply to Jérôme de Bretagne

Hi,

I've not sent this specific patch to the correct recipients according to get_maintainer.pl, here is the forward to include you, Hans and Ilpo. Sorry for the mistake.

Regards,
Jérôme

---------- Forwarded message ---------
De : Jérôme de Bretagne <[email protected]>
Date: lun. 9 sept. 2024 à 00:40
Subject: [PATCH v2 3/5] platform/surface: aggregator_registry: Add Surface Pro 9 5G
To: Bjorn Andersson <[email protected]>, Konrad Dybcio <[email protected]>, Rob Herring <[email protected]>, Krzysztof Kozlowski <[email protected]>, Conor Dooley <[email protected]>
Cc: Johan Hovold <[email protected]>, <[email protected]>, <[email protected]>, <[email protected]>, Maximilian Luz <[email protected]>

Add SAM client device nodes for the Surface Pro 9 5G, with the usual battery/AC and HID nodes for keyboard and touchpad support.

---
 .../surface/surface_aggregator_registry.c       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/drivers/platform/surface/surface_aggregator_registry.c index 25c8aa2131d6..8b34d7e465c2 100644

drivers/platform/surface/surface_aggregator_registry.c +0 -0
@@ -390,6 +390,21 @@ static const struct software_node

*ssam_node_group_sp9[] = {
NULL,
};

+/* Devices for Surface Pro 9 5G. */
+static const struct software_node *ssam_node_group_sp9_5G[] = {

+       &ssam_node_root,
+       &ssam_node_hub_kip,
+       &ssam_node_bat_ac,
+       &ssam_node_bat_main,
+       &ssam_node_tmp_sensors,
+       &ssam_node_hid_kip_keyboard,
+       &ssam_node_hid_kip_penstash,
+       &ssam_node_hid_kip_touchpad,
+       &ssam_node_hid_kip_fwupd,
+       &ssam_node_hid_sam_sensors,
+       &ssam_node_kip_tablet_switch,
+       NULL,

+};

/* -- SSAM platform/meta-hub driver.
---------------------------------------- */

@@ -462,6 +477,8 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
MODULE_DEVICE_TABLE(acpi, ssam_platform_hub_acpi_match);

static const struct of_device_id ssam_platform_hub_of_match[]
__maybe_unused = {
+ /* Surface Pro 9 5G */
+ { .compatible = "microsoft,arcata", (void *)ssam_node_group_sp9_5G },

        /* Surface Laptop 7 */
        { .compatible = "microsoft,romulus13", (void *)ssam_node_group_sl7 },
        { .compatible = "microsoft,romulus15", (void *)ssam_node_group_sl7 },

--
2.45.2

#14 lore raw

PATCH v2 4/5 arm64: dts: qcom: sc8280xp: Add uart18

In reply to Jérôme de Bretagne

Add the node describing uart18 for sc8280xp devices.

---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 48 ++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +48 -0
index 14c3b1d6ad47..1e520113db07 100644
@@ -1013,6 +1013,24 @@ spi18: spi@888000 {
 				status = "disabled";
 			};
 
+			uart18: serial@888000 {
+				compatible = "qcom,geni-uart";
+				reg = <0 0x00888000 0 0x4000>;
+				clocks = <&gcc GCC_QUPV3_WRAP2_S2_CLK>;
+				clock-names = "se";
+				interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
+				operating-points-v2 = <&qup_opp_table_100mhz>;
+				power-domains = <&rpmhpd SC8280XP_CX>;
+				interconnects = <&clk_virt MASTER_QUP_CORE_2 0 &clk_virt SLAVE_QUP_CORE_2 0>,
+						<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_2 0>;
+				interconnect-names = "qup-core", "qup-config";
+
+				pinctrl-0 = <&qup_uart18_default>;
+				pinctrl-names = "default";
+
+				status = "disabled";
+			};
+
 			i2c19: i2c@88c000 {
 				compatible = "qcom,geni-i2c";
 				reg = <0 0x0088c000 0 0x4000>;
@@ -4957,6 +4975,36 @@ cci3_i2c1_sleep: cci3-i2c1-sleep-pins {
 					bias-pull-down;
 				};
 			};
+
+			qup_uart18_default: qup-uart18-default-state {
+				cts-pins {
+					pins = "gpio66";
+					function = "qup18";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				rts-pins {
+					pins = "gpio67";
+					function = "qup18";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				tx-pins {
+					pins = "gpio68";
+					function = "qup18";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				rx-pins {
+					pins = "gpio69";
+					function = "qup18";
+					drive-strength = <2>;
+					bias-disable;
+				};
+			};
 		};
 
 		apps_smmu: iommu@15000000 {
Signature · 1 line
2.45.2
#15 lore raw

PATCH v2 5/5 arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G

In reply to Jérôme de Bretagne

Add an initial devicetree for the Microsoft Surface Pro 9 5G, based on SC8280XP.

It enables the support for Wi-Fi, NVMe, the two USB Type-C ports, Bluetooth, 5G cellular modem, audio output (via Bluetooth headsets or USB audio), external display via DisplayPort over Type-C (only the bottom USB Type-C port is working so far), charging, the Surface Aggregator Module (SAM) to get keyboard and touchpad working with Surface Type Cover accessories.

Some key features not supported yet:
- built-in display (but software fallback is working with efifb when blacklisting the msm module)
- built-in display touchscreen
- external display with the top USB Type-C port
- speakers and microphones
- physical volume up and down keys
- LID switch detection

This devicetree is based on the other SC8280XP ones, for the Lenovo ThinkPad X13s and the Qualcomm CRD.

---
 arch/arm64/boot/dts/qcom/Makefile             |    1 +
 .../dts/qcom/sc8280xp-microsoft-arcata.dts    | 1032 +++++++++++++++++
 2 files changed, 1033 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index 0e5c810304fb..feebd1af5fe6 100644
@@ -184,6 +184,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sc8180x-lenovo-flex-5g.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sc8180x-primus.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sc8280xp-crd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sc8280xp-lenovo-thinkpad-x13s.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sc8280xp-microsoft-arcata.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sda660-inforce-ifc6560.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm450-lenovo-tbx605f.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm450-motorola-ali.dtb
arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts new file +1032 -0

1,032 lines not on this page · raw message

Signature · 1 line
2.45.2
#16 lore raw

Re: [PATCH v2 5/5] arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G

Quoted 25 lines · Jérôme de Bretagne

Add an initial devicetree for the Microsoft Surface Pro 9 5G, based on SC8280XP.

It enables the support for Wi-Fi, NVMe, the two USB Type-C ports, Bluetooth, 5G cellular modem, audio output (via Bluetooth headsets or USB audio), external display via DisplayPort over Type-C (only the bottom USB Type-C port is working so far), charging, the Surface Aggregator Module (SAM) to get keyboard and touchpad working with Surface Type Cover accessories.

Some key features not supported yet:
- built-in display (but software fallback is working with efifb when blacklisting the msm module)
- built-in display touchscreen
- external display with the top USB Type-C port
- speakers and microphones
- physical volume up and down keys
- LID switch detection

This devicetree is based on the other SC8280XP ones, for the Lenovo ThinkPad X13s and the Qualcomm CRD.

arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts line 4

Quoted 4 lines
arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts new file +4 -0
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2024, Jérôme de Bretagne <[email protected]>
+ */

You mention it in the commit message, but since a lot of this is copied from the X13s (and CRD) devicetrees you should probably make that clear here as well and include the relevant copyright notices. For example by adding:

Based on ...

Copyright ...

Johan

#17 lore raw

Re: [PATCH v2 5/5] arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G

Quoted 37 lines · Johan Hovold
Quoted 25 lines · Jérôme de Bretagne

Add an initial devicetree for the Microsoft Surface Pro 9 5G, based on SC8280XP.

It enables the support for Wi-Fi, NVMe, the two USB Type-C ports, Bluetooth, 5G cellular modem, audio output (via Bluetooth headsets or USB audio), external display via DisplayPort over Type-C (only the bottom USB Type-C port is working so far), charging, the Surface Aggregator Module (SAM) to get keyboard and touchpad working with Surface Type Cover accessories.

Some key features not supported yet:
- built-in display (but software fallback is working with efifb when blacklisting the msm module)
- built-in display touchscreen
- external display with the top USB Type-C port
- speakers and microphones
- physical volume up and down keys
- LID switch detection

This devicetree is based on the other SC8280XP ones, for the Lenovo ThinkPad X13s and the Qualcomm CRD.

arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts line 4

Quoted 4 lines
arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts new file +4 -0
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2024, Jérôme de Bretagne <[email protected]>
+ */

You mention it in the commit message, but since a lot of this is copied from the X13s (and CRD) devicetrees you should probably make that clear here as well and include the relevant copyright notices. For example by adding:

Quoted 5 lines

Based on ...

Copyright ...

Johan

Thank you for the suggestion, so it would look like this?

+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Based on sc8280xp-crd.dts and sc8280xp-lenovo-thinkpad-x13s.dts
+ *
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ * Copyright (c) 2024, Jérôme de Bretagne <...>
+ */

Bjorn,

How do you want me to add this to the patchset?
Should I send a separate fix-up patch?
Or should I create a newer v3 patchset?

Thank you,
Jérôme

#18 lore raw

Re: [PATCH v2 5/5] arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G

Quoted 8 lines · Jérôme de Bretagne
Quoted 7 lines · Johan Hovold

On Mon, Sep 09, 2024 at 12:35:05AM +0200, Jérôme de Bretagne wrote:

You mention it in the commit message, but since a lot of this is copied from the X13s (and CRD) devicetrees you should probably make that clear here as well and include the relevant copyright notices. For example by adding:

Quoted 5 lines
Quoted 3 lines

Based on ...

Copyright ...

Thank you for the suggestion, so it would look like this?

You can still keep your copyright notice first, and I meant something like:

	/*
	 * Microsoft Surface Pro 9 5G devicetree
	 *
	 * Copyright (c) 2024, Jérôme de Bretagne <...>
	 *
	 * Based on sc8280xp-crd.dts and sc8280xp-lenovo-thinkpad-x13s.dts:
	 *
	 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
	 * Copyright (c) 2022, Linaro Limited
	 */
Quoted 3 lines

How do you want me to add this to the patchset?
Should I send a separate fix-up patch?
Or should I create a newer v3 patchset?

Ah, sorry, I missed that Bjorn had already picked this one up. Either leave it as is, or send an incremental (fix-up) patch.

Johan

maintainer Applied
#19 lore raw

Re: (subset) [PATCH v2 0/5] Microsoft Surface Pro 9 5G support

In reply to Jérôme de Bretagne
Quoted 4 lines · Jérôme de Bretagne

This series brings support for the SC8280XP-based Microsoft Surface Pro 9 5G.

Applied, thanks!

[1/5] dt-bindings: arm: qcom: Document Microsoft Surface Pro 9 5G

      commit: e221af165910b8967f7c2788c34826f332f2cc7e
[4/5] arm64: dts: qcom: sc8280xp: Add uart18
      commit: 1e70551123d014b3a1c4b85da54d247243750e7c
[5/5] arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G
      commit: f6231a2eefd430b8b8798911f023891ea51d1d09

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
#20 lore raw

Re: (subset) [PATCH v2 0/5] Microsoft Surface Pro 9 5G support

Quoted 7 lines · Bjorn Andersson
Quoted 3 lines · Jérôme de Bretagne

This series brings support for the SC8280XP-based Microsoft Surface Pro 9 5G.

Applied, thanks!

Thanks, Bjorn!

Quoted 10 lines

[1/5] dt-bindings: arm: qcom: Document Microsoft Surface Pro 9 5G

      commit: e221af165910b8967f7c2788c34826f332f2cc7e
[4/5] arm64: dts: qcom: sc8280xp: Add uart18
      commit: 1e70551123d014b3a1c4b85da54d247243750e7c
[5/5] arm64: dts: qcom: sc8280xp: Add Microsoft Surface Pro 9 5G
      commit: f6231a2eefd430b8b8798911f023891ea51d1d09

Best regards,
--
Bjorn Andersson <[email protected]>