Takashi Iwai 15fc0b
From 1b1b672cc1d4fb3065dac79efb8901bd6244ef69 Mon Sep 17 00:00:00 2001
Takashi Iwai 15fc0b
From: Utkarsh Patel <utkarsh.h.patel@intel.com>
Takashi Iwai 15fc0b
Date: Tue, 16 Aug 2022 13:16:24 +0300
Takashi Iwai 15fc0b
Subject: [PATCH] usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device
Takashi Iwai 15fc0b
Git-commit: 1b1b672cc1d4fb3065dac79efb8901bd6244ef69
Takashi Iwai 15fc0b
Patch-mainline: v6.0-rc4
Oliver Neukum 5026c9
References: jsc#PED-1211
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
This adds the necessary ACPI ID for Intel Meteor Lake
Takashi Iwai 15fc0b
IOM devices.
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
The callback function is_memory() is modified so that it
Takashi Iwai 15fc0b
also checks if the resource descriptor passed to it is a
Takashi Iwai 15fc0b
memory type "Address Space Resource Descriptor".
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
On Intel Meteor Lake the ACPI memory resource is not
Takashi Iwai 15fc0b
described using the "32-bit Memory Range Descriptor" because
Takashi Iwai 15fc0b
the memory is outside of the 32-bit address space. The
Takashi Iwai 15fc0b
memory resource is described using the "Address Space
Takashi Iwai 15fc0b
Resource Descriptor" instead.
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
Intel Meteor Lake is the first platform to describe the
Takashi Iwai 15fc0b
memory resource for this device with Address Space Resource
Takashi Iwai 15fc0b
Descriptor, but it most likely will not be the last.
Takashi Iwai 15fc0b
Therefore the change to the is_memory() callback function
Takashi Iwai 15fc0b
is made generic.
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Takashi Iwai 15fc0b
Cc: stable@vger.kernel.org
Takashi Iwai 15fc0b
[ heikki: Rewrote the commit message. ]
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Takashi Iwai 15fc0b
Link: https://lore.kernel.org/r/20220816101629.69054-2-heikki.krogerus@linux.intel.com
Takashi Iwai 15fc0b
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Takashi Iwai 15fc0b
Acked-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
---
Takashi Iwai 15fc0b
 drivers/usb/typec/mux/intel_pmc_mux.c | 9 +++++++--
Takashi Iwai 15fc0b
 1 file changed, 7 insertions(+), 2 deletions(-)
Takashi Iwai 15fc0b
Takashi Iwai 15fc0b
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
Takashi Iwai 15fc0b
index 47b733f78fb0..a8e273fe204a 100644
Takashi Iwai 15fc0b
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
Takashi Iwai 15fc0b
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
Takashi Iwai 15fc0b
@@ -571,9 +571,11 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
Takashi Iwai 15fc0b
 
Takashi Iwai 15fc0b
 static int is_memory(struct acpi_resource *res, void *data)
Takashi Iwai 15fc0b
 {
Takashi Iwai 15fc0b
-	struct resource r;
Takashi Iwai 15fc0b
+	struct resource_win win = {};
Takashi Iwai 15fc0b
+	struct resource *r = &win.res;
Takashi Iwai 15fc0b
 
Takashi Iwai 15fc0b
-	return !acpi_dev_resource_memory(res, &r);
Takashi Iwai 15fc0b
+	return !(acpi_dev_resource_memory(res, r) ||
Takashi Iwai 15fc0b
+		 acpi_dev_resource_address_space(res, &win));
Takashi Iwai 15fc0b
 }
Takashi Iwai 15fc0b
 
Takashi Iwai 15fc0b
 /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
Takashi Iwai 15fc0b
@@ -583,6 +585,9 @@ static const struct acpi_device_id iom_acpi_ids[] = {
Takashi Iwai 15fc0b
 
Takashi Iwai 15fc0b
 	/* AlderLake */
Takashi Iwai 15fc0b
 	{ "INTC1079", 0x160, },
Takashi Iwai 15fc0b
+
Takashi Iwai 15fc0b
+	/* Meteor Lake */
Takashi Iwai 15fc0b
+	{ "INTC107A", 0x160, },
Takashi Iwai 15fc0b
 	{}
Takashi Iwai 15fc0b
 };
Takashi Iwai 15fc0b
 
Takashi Iwai 15fc0b
-- 
Takashi Iwai 15fc0b
2.35.3
Takashi Iwai 15fc0b