summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>2017-01-03 12:25:36 +0530
committerVijayavardhan Vennapusa <vvreddy@codeaurora.org>2017-01-03 17:01:57 +0530
commit4ff07c149c23776d7c62a04b0d02271cf929cdc9 (patch)
tree019bcac43ec0b9ed1da6a049a306a5f0487a29e7 /drivers/usb
parent2f817b68f06ed866aa2c4cc35b2e4293aeb1ef99 (diff)
usb: phy: qusb2: Enable phy auto-resume
phy auto-resume allows phy to automatically drive bus resume right after device driving bus resume for at least 1ms due to remote wake up, before host XHCI driver gets a chance to drive bus resume. Change-Id: Ifbd2d8212fe5ed1bdad32418300ac615091f0226 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/phy/phy-msm-qusb.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy-msm-qusb.c b/drivers/usb/phy/phy-msm-qusb.c
index 09a61acceb81..170cbf0a853f 100644
--- a/drivers/usb/phy/phy-msm-qusb.c
+++ b/drivers/usb/phy/phy-msm-qusb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-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
@@ -47,6 +47,8 @@
#define FREEZIO_N BIT(1)
#define POWER_DOWN BIT(0)
+#define QUSB2PHY_PORT_TEST_CTRL 0xB8
+
#define QUSB2PHY_PWR_CTRL1 0x210
#define PWR_CTRL1_CLAMP_N_EN BIT(1)
#define PWR_CTRL1_POWR_DOWN BIT(0)
@@ -688,6 +690,21 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend)
writel_relaxed(intr_mask,
qphy->base + QUSB2PHY_PORT_INTR_CTRL);
+ /* enable phy auto-resume */
+ writel_relaxed(0x0C,
+ qphy->base + QUSB2PHY_PORT_TEST_CTRL);
+ /* flush the previous write before next write */
+ wmb();
+ writel_relaxed(0x04,
+ qphy->base + QUSB2PHY_PORT_TEST_CTRL);
+
+
+ dev_dbg(phy->dev, "%s: intr_mask = %x\n",
+ __func__, intr_mask);
+
+ /* Makes sure that above write goes through */
+ wmb();
+
qusb_phy_enable_clocks(qphy, false);
} else { /* Disconnect case */
/* Disable all interrupts */