From 9f5b3e1ea4fb9ebf37476f29ffab1b4df5424e61 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Wed, 22 Mar 2017 12:03:53 -0700 Subject: [PATCH] usb: phy: qmp: Select usb3 phy mode during PHY reset commit a3e98f0134da ("usb: phy: qmp: Select usb3 phy mode before initializing PHY") moved the USB/DP mode selection to just prior to performing PHY initialization. This resolved initialization failure however it still may fail to result in SuperSpeed enumeration on when first switching from DP back to USB3 mode. According to HW documentation the correct place to perform the mode switch is while the PHY is under reset, so move this step to msm_ssphy_qmp_reset(). Change-Id: Ia540b3793440e1d203b79cf129a9e80ad2b0e3e9 Signed-off-by: Jack Pham --- drivers/usb/phy/phy-msm-ssusb-qmp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-msm-ssusb-qmp.c b/drivers/usb/phy/phy-msm-ssusb-qmp.c index 64916f5566b5..00c9a6883125 100644 --- a/drivers/usb/phy/phy-msm-ssusb-qmp.c +++ b/drivers/usb/phy/phy-msm-ssusb-qmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -307,10 +307,6 @@ static int msm_ssphy_qmp_init(struct usb_phy *uphy) phy->clk_enabled = true; } - /* select usb3 phy mode */ - if (phy->tcsr_usb3_dp_phymode) - writel_relaxed(0x0, phy->tcsr_usb3_dp_phymode); - writel_relaxed(0x01, phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]); @@ -386,6 +382,10 @@ static int msm_ssphy_qmp_reset(struct usb_phy *uphy) goto deassert_phy_phy_reset; } + /* select usb3 phy mode */ + if (phy->tcsr_usb3_dp_phymode) + writel_relaxed(0x0, phy->tcsr_usb3_dp_phymode); + /* Deassert USB3 PHY CSR reset */ ret = reset_control_deassert(phy->phy_reset); if (ret) {