2021-05-23 13:47:06

by Maximilian Luz

[permalink] [raw]
Subject: [PATCH 0/3] platform/surface: aggregator_registry: Support for Surface Laptop 4 and cleanup

Hi,

this series adds support for the 13" Intel and 15" AMD versions of the
Surface Laptop 4 and does some small cleanup regarding duplicate node
groups in the registry.

Unfortunately I haven't heard anything of the 15" Intel version and 13"
AMD version yet.

Hans, can you apply patches 1 and 2 as fixes for v5.13? That way we'd
have decent support for the SL4 (at least the aforementioned versions)
in v5.13.

Thanks,
Max

Maximilian Luz (3):
platform/surface: aggregator_registry: Update comments for 15" AMD
Surface Laptop 4
platform/surface: aggregator_registry: Add support for 13" Intel
Surface Laptop 4
platform/surface: aggregator_registry: Consolidate node groups for
5th- and 6th-gen devices

.../surface/surface_aggregator_registry.c | 54 ++++++-------------
1 file changed, 17 insertions(+), 37 deletions(-)

--
2.31.1


2021-05-23 13:47:19

by Maximilian Luz

[permalink] [raw]
Subject: [PATCH 2/3] platform/surface: aggregator_registry: Add support for 13" Intel Surface Laptop 4

Add support for the 13" Intel version of the Surface Laptop 4.

Use the existing node group for the Surface Laptop 3 since the 15" AMD
version already shares its WSID HID with its predecessor and there don't
seem to be any significant differences with regards to SAM.

Signed-off-by: Maximilian Luz <[email protected]>
---
drivers/platform/surface/surface_aggregator_registry.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
index bdc09305aab7..ef83461fa536 100644
--- a/drivers/platform/surface/surface_aggregator_registry.c
+++ b/drivers/platform/surface/surface_aggregator_registry.c
@@ -524,6 +524,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {
/* Surface Laptop 3 (15", AMD) and 4 (15", AMD) */
{ "MSHW0110", (unsigned long)ssam_node_group_sl3 },

+ /* Surface Laptop 4 (13", Intel) */
+ { "MSHW0250", (unsigned long)ssam_node_group_sl3 },
+
/* Surface Laptop Go 1 */
{ "MSHW0118", (unsigned long)ssam_node_group_slg1 },

--
2.31.1

2021-05-23 13:48:29

by Maximilian Luz

[permalink] [raw]
Subject: [PATCH 3/3] platform/surface: aggregator_registry: Consolidate node groups for 5th- and 6th-gen devices

5th- and 6th-generation Surface devices have all SAM clients defined in
ACPI, except for the platform profile/performance mode which his handled
via the WSID (Windows Surface Integration Device). Thus, the node groups
for those devices are the same and we can just use a single one instead
of re-defining the same one over and over again.

Signed-off-by: Maximilian Luz <[email protected]>
---
.../surface/surface_aggregator_registry.c | 47 +++++--------------
1 file changed, 12 insertions(+), 35 deletions(-)

diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
index ef83461fa536..4428c4330229 100644
--- a/drivers/platform/surface/surface_aggregator_registry.c
+++ b/drivers/platform/surface/surface_aggregator_registry.c
@@ -119,8 +119,13 @@ static const struct software_node ssam_node_hid_base_iid6 = {
.parent = &ssam_node_hub_base,
};

-/* Devices for Surface Book 2. */
-static const struct software_node *ssam_node_group_sb2[] = {
+/*
+ * Devices for 5th- and 6th-generations models:
+ * - Surface Book 2,
+ * - Surface Laptop 1 and 2,
+ * - Surface Pro 5 and 6.
+ */
+static const struct software_node *ssam_node_group_gen5[] = {
&ssam_node_root,
&ssam_node_tmp_pprof,
NULL,
@@ -142,20 +147,6 @@ static const struct software_node *ssam_node_group_sb3[] = {
NULL,
};

-/* Devices for Surface Laptop 1. */
-static const struct software_node *ssam_node_group_sl1[] = {
- &ssam_node_root,
- &ssam_node_tmp_pprof,
- NULL,
-};
-
-/* Devices for Surface Laptop 2. */
-static const struct software_node *ssam_node_group_sl2[] = {
- &ssam_node_root,
- &ssam_node_tmp_pprof,
- NULL,
-};
-
/* Devices for Surface Laptop 3 and 4. */
static const struct software_node *ssam_node_group_sl3[] = {
&ssam_node_root,
@@ -177,20 +168,6 @@ static const struct software_node *ssam_node_group_slg1[] = {
NULL,
};

-/* Devices for Surface Pro 5. */
-static const struct software_node *ssam_node_group_sp5[] = {
- &ssam_node_root,
- &ssam_node_tmp_pprof,
- NULL,
-};
-
-/* Devices for Surface Pro 6. */
-static const struct software_node *ssam_node_group_sp6[] = {
- &ssam_node_root,
- &ssam_node_tmp_pprof,
- NULL,
-};
-
/* Devices for Surface Pro 7 and Surface Pro 7+. */
static const struct software_node *ssam_node_group_sp7[] = {
&ssam_node_root,
@@ -495,10 +472,10 @@ static struct ssam_device_driver ssam_base_hub_driver = {

static const struct acpi_device_id ssam_platform_hub_match[] = {
/* Surface Pro 4, 5, and 6 (OMBR < 0x10) */
- { "MSHW0081", (unsigned long)ssam_node_group_sp5 },
+ { "MSHW0081", (unsigned long)ssam_node_group_gen5 },

/* Surface Pro 6 (OMBR >= 0x10) */
- { "MSHW0111", (unsigned long)ssam_node_group_sp6 },
+ { "MSHW0111", (unsigned long)ssam_node_group_gen5 },

/* Surface Pro 7 */
{ "MSHW0116", (unsigned long)ssam_node_group_sp7 },
@@ -507,16 +484,16 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {
{ "MSHW0119", (unsigned long)ssam_node_group_sp7 },

/* Surface Book 2 */
- { "MSHW0107", (unsigned long)ssam_node_group_sb2 },
+ { "MSHW0107", (unsigned long)ssam_node_group_gen5 },

/* Surface Book 3 */
{ "MSHW0117", (unsigned long)ssam_node_group_sb3 },

/* Surface Laptop 1 */
- { "MSHW0086", (unsigned long)ssam_node_group_sl1 },
+ { "MSHW0086", (unsigned long)ssam_node_group_gen5 },

/* Surface Laptop 2 */
- { "MSHW0112", (unsigned long)ssam_node_group_sl2 },
+ { "MSHW0112", (unsigned long)ssam_node_group_gen5 },

/* Surface Laptop 3 (13", Intel) */
{ "MSHW0114", (unsigned long)ssam_node_group_sl3 },
--
2.31.1

2021-05-23 13:48:29

by Maximilian Luz

[permalink] [raw]
Subject: [PATCH 1/3] platform/surface: aggregator_registry: Update comments for 15" AMD Surface Laptop 4

The 15" AMD version of the Surface Laptop 4 shares its WSID HID with the
15" AMD version of the Surface Laptop 3. Update the comments
accordingly.

Signed-off-by: Maximilian Luz <[email protected]>
---
drivers/platform/surface/surface_aggregator_registry.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
index 685d37a7add1..bdc09305aab7 100644
--- a/drivers/platform/surface/surface_aggregator_registry.c
+++ b/drivers/platform/surface/surface_aggregator_registry.c
@@ -156,7 +156,7 @@ static const struct software_node *ssam_node_group_sl2[] = {
NULL,
};

-/* Devices for Surface Laptop 3. */
+/* Devices for Surface Laptop 3 and 4. */
static const struct software_node *ssam_node_group_sl3[] = {
&ssam_node_root,
&ssam_node_bat_ac,
@@ -521,7 +521,7 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {
/* Surface Laptop 3 (13", Intel) */
{ "MSHW0114", (unsigned long)ssam_node_group_sl3 },

- /* Surface Laptop 3 (15", AMD) */
+ /* Surface Laptop 3 (15", AMD) and 4 (15", AMD) */
{ "MSHW0110", (unsigned long)ssam_node_group_sl3 },

/* Surface Laptop Go 1 */
--
2.31.1

2021-05-25 12:46:11

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH 0/3] platform/surface: aggregator_registry: Support for Surface Laptop 4 and cleanup

Hi,

On 5/23/21 3:45 PM, Maximilian Luz wrote:
> Hi,
>
> this series adds support for the 13" Intel and 15" AMD versions of the
> Surface Laptop 4 and does some small cleanup regarding duplicate node
> groups in the registry.
>
> Unfortunately I haven't heard anything of the 15" Intel version and 13"
> AMD version yet.
>
> Hans, can you apply patches 1 and 2 as fixes for v5.13? That way we'd
> have decent support for the SL4 (at least the aforementioned versions)
> in v5.13.

Thank you for the patches, I've added these to my review-hans branch
now. I'll also cherry-pick 1 and 2 into the fixes branch as requested,

I plan to send out a second pdx86/fixes pull-req to Linus the week that
5.13-rc5 is released.

Regards,

Hans