summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>2017-06-21 12:40:13 +0530
committerVijayavardhan Vennapusa <vvreddy@codeaurora.org>2017-06-21 12:40:13 +0530
commit1b358a8e1b7c4f52415a9e33df1d13889be47ab3 (patch)
treec64678dbd1c88e7a0a9c5592e171918442ff59ef
parent85baaeb2e2d0e7c67bf4e5cc22d15e173d01b209 (diff)
USB: phy-msm-qusb: Enable autoresume only when device is connected
Currently driver is enabling autoresume feature even if no device is connected which is not required. Hence enable auto resume only when any HS/FS/LS devices are connected during bus suspend. Change-Id: I8150a571e11ccc128298fe75acef21ffe9b08a9a Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
-rw-r--r--drivers/usb/phy/phy-msm-qusb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/phy/phy-msm-qusb.c b/drivers/usb/phy/phy-msm-qusb.c
index 6a2529ec1511..bd2722e8fc48 100644
--- a/drivers/usb/phy/phy-msm-qusb.c
+++ b/drivers/usb/phy/phy-msm-qusb.c
@@ -730,13 +730,15 @@ 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,
+ if (linestate & (LINESTATE_DP | LINESTATE_DM)) {
+ /* 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);
+ /* 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",