diff options
author | Preetham Chandru R <pchandru@nvidia.com> | 2012-11-29 17:08:50 +0530 |
---|---|---|
committer | Matthew Pedro <mapedro@nvidia.com> | 2012-12-07 10:17:51 -0800 |
commit | 3c3574a139f9093d6841b2483c0015060f88ee55 (patch) | |
tree | 5dcf8197a80a5aa599c0801126c0b494e9c10645 /drivers | |
parent | 7da5cecd4eb9a7771a75e754c87e21cad2d4e26d (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')
-rw-r--r-- | drivers/usb/gadget/tegra_udc.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 20 | ||||
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 14 |
3 files changed, 30 insertions, 20 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c index ddf9c602dc89..9af22ebe8b58 100644 --- a/drivers/usb/gadget/tegra_udc.c +++ b/drivers/usb/gadget/tegra_udc.c @@ -38,6 +38,7 @@ #include <linux/err.h> #include <linux/io.h> #include <linux/pm_qos_params.h> +#include <linux/platform_data/tegra_usb.h> #include <asm/byteorder.h> #include <asm/io.h> @@ -2565,6 +2566,7 @@ static int __init tegra_udc_probe(struct platform_device *pdev) { struct tegra_udc *udc; struct resource *res; + struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); int err = -ENODEV; DBG("%s(%d) BEGIN\n", __func__, __LINE__); @@ -2615,12 +2617,14 @@ static int __init tegra_udc_probe(struct platform_device *pdev) goto err_iounmap; } - err = enable_irq_wake(udc->irq); - if (err < 0) { - dev_warn(&pdev->dev, - "Couldn't enable USB udc mode wakeup, irq=%d, error=%d\n", - udc->irq, err); - err = 0; + if (pdata->u_data.dev.remote_wakeup_supported) { + err = enable_irq_wake(udc->irq); + if (err < 0) { + dev_warn(&pdev->dev, + "Couldn't enable USB udc mode wakeup, irq=%d," + " error=%d\n", udc->irq, err); + err = 0; + } } udc->phy = tegra_usb_phy_open(pdev); 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 */ diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index 22e303ede24e..ce19f77433fc 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -472,12 +472,14 @@ static int tegra_otg_probe(struct platform_device *pdev) goto err_irq; } - err = enable_irq_wake(tegra->irq); - if (err < 0) { - dev_warn(&pdev->dev, - "Couldn't enable USB otg mode wakeup, irq=%d, error=%d\n", - tegra->irq, err); - err = 0; + if (pdata->ehci_pdata->u_data.host.remote_wakeup_supported) { + err = enable_irq_wake(tegra->irq); + if (err < 0) { + dev_warn(&pdev->dev, + "Couldn't enable USB otg mode wakeup," + " irq=%d, error=%d\n", tegra->irq, err); + err = 0; + } } INIT_WORK(&tegra->work, irq_work); |