summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMartin Chi <mchi@nvidia.com>2014-01-28 12:51:24 +0800
committerTony Ly <tly@nvidia.com>2014-06-05 11:59:03 -0700
commit2e643f189bdc428908ba43cce0d7569d670982f0 (patch)
tree5247a13627b9d4ca2665fe131d57dc50dbeff393 /drivers/usb/host
parent7519c68b93787d70b56572103f219956ac6beeba (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 1402295 Change-Id: I49223c0fb80fd793e8886688a96e66101405fdd6 Signed-off-by: Martin Chi <mchi@nvidia.com> Reviewed-on: http://git-master/r/359426 Reviewed-on: http://git-master/r/385478 (cherry picked from commit a06d6d9eb47428e8a7be09c988fe83cff260acd0) Reviewed-on: http://git-master/r/419225 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-tegra.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 56ea68ec4861..f79026de333f 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -32,6 +32,7 @@
#include <linux/tegra_pm_domains.h>
#include <linux/pm_qos.h>
+#include <linux/wakelock.h>
/* HACK! This needs to come from DT */
#include "../../../arch/arm/mach-tegra/iomap.h"
@@ -58,6 +59,7 @@ struct tegra_ehci_hcd {
struct tegra_usb_phy *phy;
struct usb_phy *transceiver;
struct mutex sync_lock;
+ struct wake_lock ehci_wake_lock;
bool port_resuming;
unsigned int irq;
bool bus_suspended_fail;
@@ -226,6 +228,7 @@ static irqreturn_t tegra_ehci_irq(struct usb_hcd *hcd)
}
if (tegra_usb_phy_pmc_wakeup(tegra->phy)) {
ehci_dbg(ehci, "pmc interrupt detected\n");
+ wake_lock_timeout(&tegra->ehci_wake_lock, 3 * HZ);
usb_hcd_resume_root_hub(hcd);
spin_unlock(&ehci->lock);
return irq_status;
@@ -671,6 +674,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:
@@ -743,6 +749,8 @@ static int tegra_ehci_remove(struct platform_device *pdev)
struct tegra_usb_platform_data *pdata;
unsigned long timeout = 0;
+ 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;