提交 ca5ce825 编写于 作者: A Azhar Shaikh 提交者: Greg Kroah-Hartman

usb: typec: intel_pmc_mux: Update IOM port status offset for AlderLake

Intel AlderLake(ADL) IOM has a different IOM port status offset than
Intel TigerLake.
Add a new ACPI ID for ADL and use the IOM port status offset as per
the platform.
Acked-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NAzhar Shaikh <azhar.shaikh@intel.com>
Link: https://lore.kernel.org/r/20210601035843.71150-1-azhar.shaikh@intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a8534cb0
...@@ -83,8 +83,6 @@ enum { ...@@ -83,8 +83,6 @@ enum {
/* /*
* Input Output Manager (IOM) PORT STATUS * Input Output Manager (IOM) PORT STATUS
*/ */
#define IOM_PORT_STATUS_OFFSET 0x560
#define IOM_PORT_STATUS_ACTIVITY_TYPE_MASK GENMASK(9, 6) #define IOM_PORT_STATUS_ACTIVITY_TYPE_MASK GENMASK(9, 6)
#define IOM_PORT_STATUS_ACTIVITY_TYPE_SHIFT 6 #define IOM_PORT_STATUS_ACTIVITY_TYPE_SHIFT 6
#define IOM_PORT_STATUS_ACTIVITY_TYPE_USB 0x03 #define IOM_PORT_STATUS_ACTIVITY_TYPE_USB 0x03
...@@ -144,6 +142,7 @@ struct pmc_usb { ...@@ -144,6 +142,7 @@ struct pmc_usb {
struct pmc_usb_port *port; struct pmc_usb_port *port;
struct acpi_device *iom_adev; struct acpi_device *iom_adev;
void __iomem *iom_base; void __iomem *iom_base;
u32 iom_port_status_offset;
}; };
static void update_port_status(struct pmc_usb_port *port) static void update_port_status(struct pmc_usb_port *port)
...@@ -153,7 +152,8 @@ static void update_port_status(struct pmc_usb_port *port) ...@@ -153,7 +152,8 @@ static void update_port_status(struct pmc_usb_port *port)
/* SoC expects the USB Type-C port numbers to start with 0 */ /* SoC expects the USB Type-C port numbers to start with 0 */
port_num = port->usb3_port - 1; port_num = port->usb3_port - 1;
port->iom_status = readl(port->pmc->iom_base + IOM_PORT_STATUS_OFFSET + port->iom_status = readl(port->pmc->iom_base +
port->pmc->iom_port_status_offset +
port_num * sizeof(u32)); port_num * sizeof(u32));
} }
...@@ -559,14 +559,32 @@ static int is_memory(struct acpi_resource *res, void *data) ...@@ -559,14 +559,32 @@ static int is_memory(struct acpi_resource *res, void *data)
return !acpi_dev_resource_memory(res, &r); return !acpi_dev_resource_memory(res, &r);
} }
/* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
static const struct acpi_device_id iom_acpi_ids[] = {
/* TigerLake */
{ "INTC1072", 0x560, },
/* AlderLake */
{ "INTC1079", 0x160, },
{}
};
static int pmc_usb_probe_iom(struct pmc_usb *pmc) static int pmc_usb_probe_iom(struct pmc_usb *pmc)
{ {
struct list_head resource_list; struct list_head resource_list;
struct resource_entry *rentry; struct resource_entry *rentry;
struct acpi_device *adev; static const struct acpi_device_id *dev_id;
struct acpi_device *adev = NULL;
int ret; int ret;
adev = acpi_dev_get_first_match_dev("INTC1072", NULL, -1); for (dev_id = &iom_acpi_ids[0]; dev_id->id[0]; dev_id++) {
if (acpi_dev_present(dev_id->id, NULL, -1)) {
pmc->iom_port_status_offset = (u32)dev_id->driver_data;
adev = acpi_dev_get_first_match_dev(dev_id->id, NULL, -1);
break;
}
}
if (!adev) if (!adev)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册