summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/atmegadci_atmelarm.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-12-14 00:28:54 +0000
committerhselasky <hselasky@FreeBSD.org>2011-12-14 00:28:54 +0000
commit7076389cec83009f9046b6c6e2695fe340a63802 (patch)
tree56520f5d0635d8db6259b372fff280b4e6288da5 /sys/dev/usb/controller/atmegadci_atmelarm.c
parent145914e3e7153161b6dd67fdcd58c7a8201845bc (diff)
downloadFreeBSD-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/atmegadci_atmelarm.c')
-rw-r--r--sys/dev/usb/controller/atmegadci_atmelarm.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sys/dev/usb/controller/atmegadci_atmelarm.c b/sys/dev/usb/controller/atmegadci_atmelarm.c
index c68101c..6c380b6 100644
--- a/sys/dev/usb/controller/atmegadci_atmelarm.c
+++ b/sys/dev/usb/controller/atmegadci_atmelarm.c
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
static device_probe_t atmegadci_probe;
static device_attach_t atmegadci_attach;
static device_detach_t atmegadci_detach;
-static device_shutdown_t atmegadci_shutdown;
struct atmegadci_super_softc {
struct atmegadci_softc sc_otg; /* must be first */
@@ -193,35 +192,22 @@ atmegadci_detach(device_t dev)
return (0);
}
-static int
-atmegadci_shutdown(device_t dev)
-{
- struct atmegadci_super_softc *sc = device_get_softc(dev);
- int err;
-
- err = bus_generic_shutdown(dev);
- if (err)
- return (err);
-
- atmegadci_uninit(&sc->sc_otg);
-
- return (0);
-}
-
static device_method_t atmegadci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, atmegadci_probe),
DEVMETHOD(device_attach, atmegadci_attach),
DEVMETHOD(device_detach, atmegadci_detach),
- DEVMETHOD(device_shutdown, atmegadci_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
};
static driver_t atmegadci_driver = {
- "atmegadci",
- atmegadci_methods,
- sizeof(struct atmegadci_super_softc),
+ .name = "atmegadci",
+ .methods = atmegadci_methods,
+ .size = sizeof(struct atmegadci_super_softc),
};
static devclass_t atmegadci_devclass;
OpenPOWER on IntegriCloud