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/musb_otg_atmelarm.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/musb_otg_atmelarm.c')
-rw-r--r-- | sys/dev/usb/controller/musb_otg_atmelarm.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sys/dev/usb/controller/musb_otg_atmelarm.c b/sys/dev/usb/controller/musb_otg_atmelarm.c index b301e09..bb3e60a 100644 --- a/sys/dev/usb/controller/musb_otg_atmelarm.c +++ b/sys/dev/usb/controller/musb_otg_atmelarm.c @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); static device_probe_t musbotg_probe; static device_attach_t musbotg_attach; static device_detach_t musbotg_detach; -static device_shutdown_t musbotg_shutdown; struct musbotg_super_softc { struct musbotg_softc sc_otg; /* must be first */ @@ -218,35 +217,22 @@ musbotg_detach(device_t dev) return (0); } -static int -musbotg_shutdown(device_t dev) -{ - struct musbotg_super_softc *sc = device_get_softc(dev); - int err; - - err = bus_generic_shutdown(dev); - if (err) - return (err); - - musbotg_uninit(&sc->sc_otg); - - return (0); -} - static device_method_t musbotg_methods[] = { /* Device interface */ DEVMETHOD(device_probe, musbotg_probe), DEVMETHOD(device_attach, musbotg_attach), DEVMETHOD(device_detach, musbotg_detach), - DEVMETHOD(device_shutdown, musbotg_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD_END }; static driver_t musbotg_driver = { - "musbotg", - musbotg_methods, - sizeof(struct musbotg_super_softc), + .name = "musbotg", + .methods = musbotg_methods, + .size = sizeof(struct musbotg_super_softc), }; static devclass_t musbotg_devclass; |