diff options
author | Martin Chi <mchi@nvidia.com> | 2014-01-23 10:54:56 +0800 |
---|---|---|
committer | Martin Chi <mchi@nvidia.com> | 2014-01-25 09:19:50 -0800 |
commit | ba08c8974073367f89b898ec0176dcd002454774 (patch) | |
tree | 17fa5b35c284be1cfae9866b26f7589d115265f9 | |
parent | 3ab0d8dc099dc3429af1025b684131120078b873 (diff) |
usb: ehci: Tegra: change to noirq suspend/resume
Chnage ehci suspend/resume to noirq suspend/resume
to enable it get more chances to handle the remote
wake-up which may come after normal suspend/resume
bug 1430974
Change-Id: I0e27435c729b515c968990507a1d6ab53c4ce37a
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/359052
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 544b359a87b8..335f255dbd06 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -2,7 +2,7 @@ * EHCI-compliant USB host controller driver for NVIDIA Tegra SoCs * * Copyright (c) 2010 Google, Inc. - * Copyright (c) 2009-2013 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2009-2014 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -704,17 +704,20 @@ fail_sysfs: #ifdef CONFIG_PM -static int tegra_ehci_resume(struct platform_device *pdev) +static int tegra_ehci_resume(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev); struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); + if (pdata->u_data.host.turn_off_vbus_on_lp0) tegra_usb_enable_vbus(tegra->phy, true); return tegra_usb_phy_power_on(tegra->phy); } -static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state) +static int tegra_ehci_suspend(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev); struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); int err; @@ -806,6 +809,17 @@ static void tegra_ehci_hcd_shutdown(struct platform_device *pdev) } } +#ifdef CONFIG_PM +static const struct dev_pm_ops tegra_ehci_pm_ops = { + .suspend_noirq = tegra_ehci_suspend, + .resume_noirq = tegra_ehci_resume, +}; + +#define TEGRA_EHCI_PM_OPS (&tegra_ehci_pm_ops) +#else +#define TEGRA_EHCI_PM_OPS NULL +#endif + static struct of_device_id tegra_ehci_of_match[] __devinitdata = { { .compatible = "nvidia,tegra20-ehci", }, { }, @@ -815,12 +829,9 @@ static struct platform_driver tegra_ehci_driver = { .probe = tegra_ehci_probe, .remove = tegra_ehci_remove, .shutdown = tegra_ehci_hcd_shutdown, -#ifdef CONFIG_PM - .suspend = tegra_ehci_suspend, - .resume = tegra_ehci_resume, -#endif .driver = { .name = driver_name, .of_match_table = tegra_ehci_of_match, + .pm = TEGRA_EHCI_PM_OPS, } }; |