Commit 8dba2010 authored by Azhar Shaikh's avatar Azhar Shaikh Committed by Greg Kroah-Hartman

usb: typec: intel_pmc_mux: Pass correct USB Type-C port number to SoC

The SoC expects the USB Type-C ports numbers to be starting with 0.
If the port number is passed as it is, the IOM status will not be
updated. The IOM port status check fails which will eventually
lead to PMC IPC communication failure.

Fixes: 43d596e3 ("usb: typec: intel_pmc_mux: Check the port status before connect")
Suggested-by: default avatarUtkarsh Patel <utkarsh.h.patel@intel.com>
Signed-off-by: default avatarAzhar Shaikh <azhar.shaikh@intel.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200916091102.27118-3-heikki.krogerus@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fca3d669
...@@ -148,8 +148,13 @@ struct pmc_usb { ...@@ -148,8 +148,13 @@ struct pmc_usb {
static void update_port_status(struct pmc_usb_port *port) static void update_port_status(struct pmc_usb_port *port)
{ {
u8 port_num;
/* SoC expects the USB Type-C port numbers to start with 0 */
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 + IOM_PORT_STATUS_OFFSET +
port->usb3_port * sizeof(u32)); port_num * sizeof(u32));
} }
static int sbu_orientation(struct pmc_usb_port *port) static int sbu_orientation(struct pmc_usb_port *port)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment