diff options
author | Martin Chi <mchi@nvidia.com> | 2014-01-23 12:31:46 +0800 |
---|---|---|
committer | Martin Chi <mchi@nvidia.com> | 2014-01-25 09:21:38 -0800 |
commit | 8e6094489afa0ff9637824e956cf92f6a267e8d6 (patch) | |
tree | 9dbd2b7531248a5843e1f826e1e2fb535731078d /drivers | |
parent | ba08c8974073367f89b898ec0176dcd002454774 (diff) |
usb: ehci: Tegra: add echi wake lock
For now, only apply it in tegra_ehci_irq when it's
triggered by remote wake-up irq, since, without
wake lock hold here, device may continue the
suspend if remote wake-up comes in suspending.
bug 1431546
Change-Id: I44ea268ca168a1a3a9098ad9f5f6f7b1270a0fa5
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/359090
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 335f255dbd06..c8d60b1448f1 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -28,6 +28,7 @@ #include <mach/usb_phy.h> #include <mach/iomap.h> #include <linux/pm_qos.h> +#include <linux/wakelock.h> #if 0 #define EHCI_DBG(stuff...) pr_info("ehci-tegra: " stuff) @@ -53,6 +54,7 @@ struct tegra_ehci_hcd { struct usb_phy *transceiver; #endif struct mutex sync_lock; + struct wake_lock ehci_wake_lock; bool port_resuming; unsigned int irq; bool bus_suspended_fail; @@ -191,6 +193,7 @@ static irqreturn_t tegra_ehci_irq(struct usb_hcd *hcd) } if (tegra_usb_phy_pmc_wakeup(tegra->phy)) { ehci_dbg(ehci, "pmc wakeup detected\n"); + wake_lock_timeout(&tegra->ehci_wake_lock, HZ); usb_hcd_resume_root_hub(hcd); spin_unlock(&ehci->lock); return irq_status; @@ -686,6 +689,9 @@ static int tegra_ehci_probe(struct platform_device *pdev) tegra->cpu_boost_in_work = true; #endif + wake_lock_init(&tegra->ehci_wake_lock, + WAKE_LOCK_SUSPEND, dev_name(&pdev->dev)); + return err; fail_phy: @@ -752,6 +758,8 @@ static int tegra_ehci_remove(struct platform_device *pdev) if (hcd == NULL) return -EINVAL; + wake_lock_destroy(&tegra->ehci_wake_lock); + #ifdef CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ cancel_delayed_work_sync(&tegra->boost_cpu_freq_work); tegra->cpu_boost_in_work = false; |