summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-tegra.c
diff options
context:
space:
mode:
authorPreetham Chandru R <pchandru@nvidia.com>2012-11-29 17:08:50 +0530
committerMatthew Pedro <mapedro@nvidia.com>2012-12-07 10:17:51 -0800
commit3c3574a139f9093d6841b2483c0015060f88ee55 (patch)
tree5dcf8197a80a5aa599c0801126c0b494e9c10645 /drivers/usb/host/ehci-tegra.c
parent7da5cecd4eb9a7771a75e754c87e21cad2d4e26d (diff)
usb: tegra: conditionally set wake enable
Set wake enable only if remote wakeup is supported by the platform Bug 1039143 Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Change-Id: I805dd773cdbb5639f59b2f5ba4bcb2e14be74d5b Reviewed-on: http://git-master/r/147462 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'drivers/usb/host/ehci-tegra.c')
-rw-r--r--drivers/usb/host/ehci-tegra.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index af6fa87fb645..4ddb279cfb35 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -407,6 +407,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
struct resource *res;
struct usb_hcd *hcd;
struct tegra_ehci_hcd *tegra;
+ struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
int err = 0;
int irq;
@@ -477,13 +478,15 @@ static int tegra_ehci_probe(struct platform_device *pdev)
goto fail_phy;
}
- err = enable_irq_wake(tegra->irq);
- if (err < 0) {
- dev_warn(&pdev->dev,
- "Couldn't enable USB host mode wakeup, irq=%d, "
- "error=%d\n", irq, err);
- err = 0;
- tegra->irq = 0;
+ if (pdata->u_data.host.remote_wakeup_supported) {
+ err = enable_irq_wake(tegra->irq);
+ if (err < 0) {
+ dev_warn(&pdev->dev,
+ "Couldn't enable USB host mode wakeup,"
+ " irq=%d error=%d\n", irq, err);
+ err = 0;
+ tegra->irq = 0;
+ }
}
tegra->ehci = hcd_to_ehci(hcd);
@@ -531,6 +534,7 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
static int tegra_ehci_remove(struct platform_device *pdev)
{
struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
+ struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
if (tegra == NULL || hcd == NULL)
@@ -543,7 +547,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
}
#endif
- if (tegra->irq)
+ if (tegra->irq && pdata->u_data.host.remote_wakeup_supported)
disable_irq_wake(tegra->irq);
/* Make sure phy is powered ON to access USB register */