summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorAzhar Shaikh <azhar.shaikh@intel.com>2020-09-16 12:11:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-16 12:42:36 +0200
commit8dba20101aaf67462934e40cb5e6c3641f87d460 (patch)
tree3732210408c7b5a980f9ee1fa92cfa263d9ff5d3 /drivers/usb/typec
parentfca3d66982f08c436bff8f037142ad664ef376a8 (diff)
downloadlinux-8dba20101aaf67462934e40cb5e6c3641f87d460.tar.gz
linux-8dba20101aaf67462934e40cb5e6c3641f87d460.tar.bz2
linux-8dba20101aaf67462934e40cb5e6c3641f87d460.zip
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: 43d596e32276 ("usb: typec: intel_pmc_mux: Check the port status before connect") Suggested-by: Utkarsh Patel <utkarsh.h.patel@intel.com> Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20200916091102.27118-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r--drivers/usb/typec/mux/intel_pmc_mux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 307830b374ec..109c1a796e84 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -148,8 +148,13 @@ struct pmc_usb {
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->usb3_port * sizeof(u32));
+ port_num * sizeof(u32));
}
static int sbu_orientation(struct pmc_usb_port *port)