aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/controller/xhci.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2011-12-31 13:34:42 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2011-12-31 13:34:42 +0000
commitc2d0465a9bae40d3ad0cec69903deb8ed98fd090 (patch)
tree2acc8b4b2c03477f553a1ca2f5ed86f1a36c2a92 /sys/dev/usb/controller/xhci.c
parentc1cbd9ab538823bece4f3ad7f7b1b829aa582b09 (diff)
downloadsrc-c2d0465a9bae40d3ad0cec69903deb8ed98fd090.tar.gz
src-c2d0465a9bae40d3ad0cec69903deb8ed98fd090.zip
Add missing change to XHCI driver similar to changes in r228483.
MFC after: 0 days
Notes
Notes: svn path=/head/; revision=229086
Diffstat (limited to 'sys/dev/usb/controller/xhci.c')
-rw-r--r--sys/dev/usb/controller/xhci.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 9bc7d2145f46..c20e3bd5d309 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -550,24 +550,27 @@ xhci_uninit(struct xhci_softc *sc)
sx_destroy(&sc->sc_cmd_sx);
}
-void
-xhci_suspend(struct xhci_softc *sc)
-{
- /* XXX TODO */
-}
-
-void
-xhci_resume(struct xhci_softc *sc)
-{
- /* XXX TODO */
-}
-
-void
-xhci_shutdown(struct xhci_softc *sc)
+static void
+xhci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state)
{
- DPRINTF("Stopping the XHCI\n");
+ struct xhci_softc *sc = XHCI_BUS2SC(bus);
- xhci_halt_controller(sc);
+ switch (state) {
+ case USB_HW_POWER_SUSPEND:
+ DPRINTF("Stopping the XHCI\n");
+ xhci_halt_controller(sc);
+ break;
+ case USB_HW_POWER_SHUTDOWN:
+ DPRINTF("Stopping the XHCI\n");
+ xhci_halt_controller(sc);
+ break;
+ case USB_HW_POWER_RESUME:
+ DPRINTF("Starting the XHCI\n");
+ xhci_start_controller(sc);
+ break;
+ default:
+ break;
+ }
}
static usb_error_t
@@ -3928,4 +3931,5 @@ struct usb_bus_methods xhci_bus_methods = {
.set_address = xhci_set_address,
.clear_stall = xhci_ep_clear_stall,
.device_state_change = xhci_device_state_change,
+ .set_hw_power_sleep = xhci_set_hw_power_sleep,
};