diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-12-14 00:28:54 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-12-14 00:28:54 +0000 |
commit | 7076389cec83009f9046b6c6e2695fe340a63802 (patch) | |
tree | 56520f5d0635d8db6259b372fff280b4e6288da5 /sys/dev/usb/controller/at91dci.c | |
parent | 145914e3e7153161b6dd67fdcd58c7a8201845bc (diff) | |
download | FreeBSD-src-7076389cec83009f9046b6c6e2695fe340a63802.zip FreeBSD-src-7076389cec83009f9046b6c6e2695fe340a63802.tar.gz |
Implement better support for USB controller suspend and resume.
This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.
This patch also fixes some build issues in avr32dci.c
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/usb/controller/at91dci.c')
-rw-r--r-- | sys/dev/usb/controller/at91dci.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/sys/dev/usb/controller/at91dci.c b/sys/dev/usb/controller/at91dci.c index f831115..d325812 100644 --- a/sys/dev/usb/controller/at91dci.c +++ b/sys/dev/usb/controller/at91dci.c @@ -1461,16 +1461,16 @@ at91dci_uninit(struct at91dci_softc *sc) USB_BUS_UNLOCK(&sc->sc_bus); } -void +static void at91dci_suspend(struct at91dci_softc *sc) { - return; + /* TODO */ } -void +static void at91dci_resume(struct at91dci_softc *sc) { - return; + /* TODO */ } static void @@ -2306,6 +2306,26 @@ at91dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, } } +static void +at91dci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state) +{ + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); + + switch (state) { + case USB_HW_POWER_SUSPEND: + at91dci_suspend(sc); + break; + case USB_HW_POWER_SHUTDOWN: + at91dci_uninit(sc); + break; + case USB_HW_POWER_RESUME: + at91dci_resume(sc); + break; + default: + break; + } +} + struct usb_bus_methods at91dci_bus_methods = { .endpoint_init = &at91dci_ep_init, @@ -2316,4 +2336,5 @@ struct usb_bus_methods at91dci_bus_methods = .clear_stall = &at91dci_clear_stall, .roothub_exec = &at91dci_roothub_exec, .xfer_poll = &at91dci_do_poll, + .set_hw_power_sleep = &at91dci_set_hw_power_sleep, }; |