Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc6bc333 authored by Jack Pham's avatar Jack Pham
Browse files

usb: ehci-msm2: Don't always enable hcd->irq for wakeup



Support for enabling the core hcd->irq as a wakeup interrupt
may vary depending on board configuration. In particular, if
the platform has a dedicated IRQ available to wake up the
system, such as async interrupt or D+ GPIO, then they should
obviate needing to enable the core IRQ for wakeup. This change
adds a check on whether the other forms of wakeup are enabled
to decide whether to call enable_irq_wake(hcd->irq).

Change-Id: I53e4e2fb4c70fb26555625bed2ebb2b315a59c1e
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 199db36d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1730,7 +1730,8 @@ static int ehci_msm2_pm_suspend(struct device *dev)

	dev_dbg(dev, "ehci-msm2 PM suspend\n");

	if (device_may_wakeup(dev))
	if (device_may_wakeup(dev) && !mhcd->async_irq_enabled &&
		!mhcd->wakeup_irq_enabled && !mhcd->pmic_gpio_dp_irq_enabled)
		enable_irq_wake(hcd->irq);

	return msm_ehci_suspend(mhcd);
@@ -1745,7 +1746,8 @@ static int ehci_msm2_pm_resume(struct device *dev)

	dev_dbg(dev, "ehci-msm2 PM resume\n");

	if (device_may_wakeup(dev))
	if (device_may_wakeup(dev) && !mhcd->async_irq_enabled &&
		!mhcd->wakeup_irq_enabled && !mhcd->pmic_gpio_dp_irq_enabled)
		disable_irq_wake(hcd->irq);

	ret = msm_ehci_resume(mhcd);