Commit b6c3c6ff authored by Maximilian Luz's avatar Maximilian Luz Committed by Hans de Goede
Browse files

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: default avatarMaximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210523134528.798887-4-luzmaximilian@gmail.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 460d7408
Loading
Loading
Loading
Loading
+12 −35
Original line number Diff line number Diff line
@@ -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 },