summaryrefslogtreecommitdiffstats
path: root/sys/arm/econa
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/arm/econa
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/arm/econa')
-rw-r--r--sys/arm/econa/ehci_ebus.c55
-rw-r--r--sys/arm/econa/ohci_ec.c8
2 files changed, 11 insertions, 52 deletions
diff --git a/sys/arm/econa/ehci_ebus.c b/sys/arm/econa/ehci_ebus.c
index ee20148..4b72b7f 100644
--- a/sys/arm/econa/ehci_ebus.c
+++ b/sys/arm/econa/ehci_ebus.c
@@ -75,10 +75,6 @@ __FBSDID("$FreeBSD$");
static device_attach_t ehci_ebus_attach;
static device_detach_t ehci_ebus_detach;
-static device_shutdown_t ehci_ebus_shutdown;
-static device_suspend_t ehci_ebus_suspend;
-static device_resume_t ehci_ebus_resume;
-
static void *ih_err;
@@ -86,45 +82,6 @@ static void *ih_err;
#define USB_BRIDGE_INTR_MASK 0x214
static int
-ehci_ebus_suspend(device_t self)
-{
- ehci_softc_t *sc = device_get_softc(self);
- int err;
-
- err = bus_generic_suspend(self);
- if (err)
- return (err);
- ehci_suspend(sc);
- return (0);
-}
-
-static int
-ehci_ebus_resume(device_t self)
-{
- ehci_softc_t *sc = device_get_softc(self);
-
- ehci_resume(sc);
-
- bus_generic_resume(self);
-
- return (0);
-}
-
-static int
-ehci_ebus_shutdown(device_t self)
-{
- ehci_softc_t *sc = device_get_softc(self);
- int err;
-
- err = bus_generic_shutdown(self);
- if (err)
- return (err);
- ehci_shutdown(sc);
-
- return (0);
-}
-
-static int
ehci_ebus_probe(device_t self)
{
@@ -277,17 +234,17 @@ static device_method_t ehci_methods[] = {
DEVMETHOD(device_probe, ehci_ebus_probe),
DEVMETHOD(device_attach, ehci_ebus_attach),
DEVMETHOD(device_detach, ehci_ebus_detach),
- DEVMETHOD(device_suspend, ehci_ebus_suspend),
- DEVMETHOD(device_resume, ehci_ebus_resume),
- DEVMETHOD(device_shutdown, ehci_ebus_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
};
static driver_t ehci_driver = {
- "ehci",
- ehci_methods,
- sizeof(ehci_softc_t),
+ .name = "ehci",
+ .methods = ehci_methods,
+ .size = sizeof(ehci_softc_t),
};
static devclass_t ehci_devclass;
diff --git a/sys/arm/econa/ohci_ec.c b/sys/arm/econa/ohci_ec.c
index ee44960..543aae1 100644
--- a/sys/arm/econa/ohci_ec.c
+++ b/sys/arm/econa/ohci_ec.c
@@ -220,15 +220,17 @@ static device_method_t ohci_methods[] = {
DEVMETHOD(device_probe, ohci_ec_probe),
DEVMETHOD(device_attach, ohci_ec_attach),
DEVMETHOD(device_detach, ohci_ec_detach),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
};
static driver_t ohci_driver = {
- "ohci",
- ohci_methods,
- sizeof(struct ec_ohci_softc),
+ .name = "ohci",
+ .methods = ohci_methods,
+ .size = sizeof(struct ec_ohci_softc),
};
static devclass_t ohci_devclass;
OpenPOWER on IntegriCloud