Merge "USB: phy-msm: Enable core/async irq only for host/device bus suspend"
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 43e558b..c0c8a88 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1638,12 +1638,14 @@
atomic_set(&motg->in_lpm, 1);
- /* Enable ASYNC IRQ during LPM */
- enable_irq(motg->async_irq);
+ if (host_bus_suspend || device_bus_suspend) {
+ /* Enable ASYNC IRQ during LPM */
+ enable_irq(motg->async_irq);
+ enable_irq(motg->irq);
+ }
if (motg->phy_irq)
enable_irq(motg->phy_irq);
- enable_irq(motg->irq);
pm_relax(&motg->pdev->dev);
dev_dbg(phy->dev, "LPM caps = %lu flags = %lu\n",
@@ -1688,10 +1690,12 @@
return 0;
}
- disable_irq(motg->irq);
+ pm_stay_awake(&motg->pdev->dev);
if (motg->phy_irq)
disable_irq(motg->phy_irq);
- pm_stay_awake(&motg->pdev->dev);
+
+ if (motg->host_bus_suspend || motg->device_bus_suspend)
+ disable_irq(motg->irq);
/*
* If we are resuming from the device bus suspend, restore
@@ -1814,7 +1818,8 @@
enable_irq(motg->irq);
/* Enable ASYNC_IRQ only during LPM */
- disable_irq(motg->async_irq);
+ if (motg->host_bus_suspend || motg->device_bus_suspend)
+ disable_irq(motg->async_irq);
if (motg->phy_irq_pending) {
motg->phy_irq_pending = false;