aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-plat.c
diff options
context:
space:
mode:
authorVikas Sajjan <vikas.sajjan@linaro.org>2013-02-11 05:58:00 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-07-23 17:19:18 -0400
commit57d04eb131ec9df067028aef278867b4920177c3 (patch)
tree408908558ad0156ff5375bfff1b5245c1c64fef7 /drivers/usb/host/xhci-plat.c
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
usb: xhci: add the suspend/resume functionality
Adds power management support to xHCI platform driver. This patch facilitates the transition of xHCI host controller between S0 and S3/S4 power states, during suspend/resume cycles. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Vikas C Sajjan <vikas.sajjan@linaro.org> CC: Doug Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-plat.c')
-rw-r--r--drivers/usb/host/xhci-plat.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 51e22bf89505..412fe8d167cf 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -186,11 +186,37 @@ static int xhci_plat_remove(struct platform_device *dev)
186 return 0; 186 return 0;
187} 187}
188 188
189#ifdef CONFIG_PM
190static int xhci_plat_suspend(struct device *dev)
191{
192 struct usb_hcd *hcd = dev_get_drvdata(dev);
193 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
194
195 return xhci_suspend(xhci);
196}
197
198static int xhci_plat_resume(struct device *dev)
199{
200 struct usb_hcd *hcd = dev_get_drvdata(dev);
201 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
202
203 return xhci_resume(xhci, 0);
204}
205
206static const struct dev_pm_ops xhci_plat_pm_ops = {
207 SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
208};
209#define DEV_PM_OPS (&xhci_plat_pm_ops)
210#else
211#define DEV_PM_OPS NULL
212#endif /* CONFIG_PM */
213
189static struct platform_driver usb_xhci_driver = { 214static struct platform_driver usb_xhci_driver = {
190 .probe = xhci_plat_probe, 215 .probe = xhci_plat_probe,
191 .remove = xhci_plat_remove, 216 .remove = xhci_plat_remove,
192 .driver = { 217 .driver = {
193 .name = "xhci-hcd", 218 .name = "xhci-hcd",
219 .pm = DEV_PM_OPS,
194 }, 220 },
195}; 221};
196MODULE_ALIAS("platform:xhci-hcd"); 222MODULE_ALIAS("platform:xhci-hcd");