Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57d04eb1 authored by Vikas Sajjan's avatar Vikas Sajjan Committed by Sarah Sharp
Browse files

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: default avatarAbhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: default avatarVikas C Sajjan <vikas.sajjan@linaro.org>
CC: Doug Anderson <dianders@chromium.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 3b2f64d0
Loading
Loading
Loading
Loading
+26 −0
Original line number Original line Diff line number Diff line
@@ -186,11 +186,37 @@ static int xhci_plat_remove(struct platform_device *dev)
	return 0;
	return 0;
}
}


#ifdef CONFIG_PM
static int xhci_plat_suspend(struct device *dev)
{
	struct usb_hcd	*hcd = dev_get_drvdata(dev);
	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);

	return xhci_suspend(xhci);
}

static int xhci_plat_resume(struct device *dev)
{
	struct usb_hcd	*hcd = dev_get_drvdata(dev);
	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);

	return xhci_resume(xhci, 0);
}

static const struct dev_pm_ops xhci_plat_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
};
#define DEV_PM_OPS	(&xhci_plat_pm_ops)
#else
#define DEV_PM_OPS	NULL
#endif /* CONFIG_PM */

static struct platform_driver usb_xhci_driver = {
static struct platform_driver usb_xhci_driver = {
	.probe	= xhci_plat_probe,
	.probe	= xhci_plat_probe,
	.remove	= xhci_plat_remove,
	.remove	= xhci_plat_remove,
	.driver	= {
	.driver	= {
		.name = "xhci-hcd",
		.name = "xhci-hcd",
		.pm = DEV_PM_OPS,
	},
	},
};
};
MODULE_ALIAS("platform:xhci-hcd");
MODULE_ALIAS("platform:xhci-hcd");