summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-tegra-usb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-10-24 13:17:20 +0200
committerIngo Molnar <mingo@kernel.org>2017-10-24 13:17:20 +0200
commit9babb091e0ec84f7503fde0a2d9a2a16a0f48e3c (patch)
tree9b6f07288b9ca9d8444414cd7da291d7c4731da7 /drivers/usb/phy/phy-tegra-usb.c
parent5cdda5117e125e0dbb020425cc55a4c143c6febc (diff)
parentbb176f67090ca54869fc1262c913aa69d2ede070 (diff)
downloadop-kernel-dev-9babb091e0ec84f7503fde0a2d9a2a16a0f48e3c.zip
op-kernel-dev-9babb091e0ec84f7503fde0a2d9a2a16a0f48e3c.tar.gz
Merge tag 'v4.14-rc6' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/phy/phy-tegra-usb.c')
-rw-r--r--drivers/usb/phy/phy-tegra-usb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 5fe4a57..ccc2bf5 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -329,6 +329,14 @@ static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)
unsigned long val;
void __iomem *base = phy->regs;
+ /*
+ * The USB driver may have already initiated the phy clock
+ * disable so wait to see if the clock turns off and if not
+ * then proceed with gating the clock.
+ */
+ if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID, 0) == 0)
+ return;
+
if (phy->is_legacy_phy) {
val = readl(base + USB_SUSP_CTRL);
val |= USB_SUSP_SET;
@@ -351,6 +359,15 @@ static void utmi_phy_clk_enable(struct tegra_usb_phy *phy)
unsigned long val;
void __iomem *base = phy->regs;
+ /*
+ * The USB driver may have already initiated the phy clock
+ * enable so wait to see if the clock turns on and if not
+ * then proceed with ungating the clock.
+ */
+ if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID,
+ USB_PHY_CLK_VALID) == 0)
+ return;
+
if (phy->is_legacy_phy) {
val = readl(base + USB_SUSP_CTRL);
val |= USB_SUSP_CLR;
OpenPOWER on IntegriCloud