diff options
author | Manjunath Goudar <manjunath.goudar@linaro.org> | 2013-10-04 00:28:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 20:56:41 -0400 |
commit | 36a8758736238c9354f46b39ca506e9acabe82d0 (patch) | |
tree | 97c8997977efdd6aecd4ce464d5e6b16f7ff732c /drivers/usb/host | |
parent | f3c60599d6e19351bd1a39d1c5c016c7aa5f4438 (diff) |
USB: OHCI: Properly handle ohci-spear suspend
Suspend scenario in case of ohci-spear glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly handle
ohci-spear suspend scenario.
Calling explicitly the ohci_suspend() routine in
spear_ohci_hcd_drv_suspend() will ensure proper
handling of suspend scenario.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ohci-spear.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc4e26f..41148f8895a4 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c | |||
@@ -130,20 +130,26 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) | |||
130 | } | 130 | } |
131 | 131 | ||
132 | #if defined(CONFIG_PM) | 132 | #if defined(CONFIG_PM) |
133 | static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, | 133 | static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev, |
134 | pm_message_t message) | 134 | pm_message_t message) |
135 | { | 135 | { |
136 | struct usb_hcd *hcd = platform_get_drvdata(dev); | 136 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
137 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 137 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
138 | struct spear_ohci *sohci_p = to_spear_ohci(hcd); | 138 | struct spear_ohci *sohci_p = to_spear_ohci(hcd); |
139 | bool do_wakeup = device_may_wakeup(&pdev->dev); | ||
140 | int ret; | ||
139 | 141 | ||
140 | if (time_before(jiffies, ohci->next_statechange)) | 142 | if (time_before(jiffies, ohci->next_statechange)) |
141 | msleep(5); | 143 | msleep(5); |
142 | ohci->next_statechange = jiffies; | 144 | ohci->next_statechange = jiffies; |
143 | 145 | ||
146 | ret = ohci_suspend(hcd, do_wakeup); | ||
147 | if (ret) | ||
148 | return ret; | ||
149 | |||
144 | clk_disable_unprepare(sohci_p->clk); | 150 | clk_disable_unprepare(sohci_p->clk); |
145 | 151 | ||
146 | return 0; | 152 | return ret; |
147 | } | 153 | } |
148 | 154 | ||
149 | static int spear_ohci_hcd_drv_resume(struct platform_device *dev) | 155 | static int spear_ohci_hcd_drv_resume(struct platform_device *dev) |