aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/phy/phy-msm-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/phy/phy-msm-usb.c')
-rw-r--r--drivers/usb/phy/phy-msm-usb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 37ed14d4b9c..84f74bbc4ba 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2013, Linux Foundation. All rights reserved.
+/* Copyright (c) 2009-2014, 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
@@ -31,6 +31,7 @@
#include <linux/dma-mapping.h>
#include <linux/clk/msm-clk.h>
#include <linux/irqchip/msm-mpm-irq.h>
+#include <soc/qcom/scm.h>
#include <linux/usb.h>
#include <linux/usb/otg.h>
@@ -46,7 +47,6 @@
#include <linux/mfd/pm8xxx/misc.h>
#include <linux/mhl_8334.h>
-#include <mach/scm.h>
#include <mach/msm_xo.h>
#include <mach/msm_bus.h>
#include <mach/rpm-regulator.h>
@@ -2659,6 +2659,8 @@ static void msm_otg_sm_work(struct work_struct *w)
bool work = 0, srp_reqd, dcp;
pm_runtime_resume(otg->phy->dev);
+ if (motg->pm_done)
+ pm_runtime_get_sync(otg->phy->dev);
pr_debug("%s work\n", usb_otg_state_string(otg->phy->state));
switch (otg->phy->state) {
case OTG_STATE_UNDEFINED:
@@ -2804,6 +2806,7 @@ static void msm_otg_sm_work(struct work_struct *w)
*/
pm_runtime_mark_last_busy(otg->phy->dev);
pm_runtime_autosuspend(otg->phy->dev);
+ motg->pm_done = 1;
}
break;
case OTG_STATE_B_SRP_INIT:
@@ -5031,6 +5034,7 @@ static int msm_otg_runtime_resume(struct device *dev)
dev_dbg(dev, "OTG runtime resume\n");
pm_runtime_get_noresume(dev);
+ motg->pm_done = 0;
return msm_otg_resume(motg);
}
#endif
@@ -5058,6 +5062,7 @@ static int msm_otg_pm_resume(struct device *dev)
dev_dbg(dev, "OTG PM resume\n");
+ motg->pm_done = 0;
atomic_set(&motg->pm_suspended, 0);
if (motg->async_int || motg->sm_work_pending ||
!pm_runtime_suspended(dev)) {