diff options
author | Venkat Moganty <vmoganty@nvidia.com> | 2010-07-22 19:31:33 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-07-22 15:02:28 -0700 |
commit | 63bbee7802033bbefee0a3a0ce5125818c55b0be (patch) | |
tree | bf09b2c16c5916e2cdc997fb15df080692c2addd | |
parent | 8a119f6aae334856f5e517726cc833465af988a4 (diff) |
[tegra-otg] Fix usb cable notification after LP0 resume.
After resume from LP0 VBUS and ID interrupt enable bits are cleared and are not
enabled. So cable connect/disconnect is not functional after resume from LP0.
This is fixed by enabling the interrupts during the resume functionality.
Bug 712862
Change-Id: I67fd63f4daefbb811757c675538071371242c428
Reviewed-on: http://git-master.nvidia.com/r/4266
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
Tested-by: Narendra Damahe <ndamahe@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index 42b292c90fd5..e3df9954a792 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -257,12 +257,32 @@ static int __exit tegra_otg_remove(struct platform_device *pdev) return 0; } +#if defined(CONFIG_PM) +static int tegra_otg_resume(struct platform_device * pdev) +{ + struct tegra_otg_data *tegra_otg = platform_get_drvdata(pdev); + unsigned int temp; + + /* enable the cable ID and VBUS interrupts */ + temp = readl(tegra_otg->regs + TEGRA_USB_WAKEUP_REG_OFFSET); + temp |= (TEGRA_USB_ID_INT_ENABLE | TEGRA_USB_ID_PIN_WAKEUP_ENABLE); + temp |= (TEGRA_USB_VBUS_INT_ENABLE | TEGRA_USB_VBUS_WAKEUP_ENABLE); + temp &= ~TEGRA_USB_VBUS_INT_STATUS; + writel(temp, (tegra_otg->regs + TEGRA_USB_WAKEUP_REG_OFFSET)); + + return 0; +} +#endif + static struct platform_driver tegra_otg_driver = { .driver = { .name = driver_name, }, .remove = __exit_p(tegra_otg_remove), .probe = tegra_otg_probe, +#if defined(CONFIG_PM) + .resume = tegra_otg_resume, +#endif }; static int __init tegra_otg_init(void) |