diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 21:35:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 21:35:58 +0000 |
commit | b0fc800de7e8d3eaae874bc61f1b5cb7abcdf6c6 (patch) | |
tree | adeaa6f7b9f7a832bcfe1e4d7b13bdf7cca95974 /sys/arch/arm/xscale/pxa27x_udc.c | |
parent | 6bb6daa43666dc1ad3b2689ee1024066e424018d (diff) |
Convert all powerhooks to activate functions, and provide powerhook stubs.
Of note: lcd stubs get pulled up to the parent; zts has to keep track of
whether it is in use or not
testing by myself and jakemsr; proof reading by oga
Diffstat (limited to 'sys/arch/arm/xscale/pxa27x_udc.c')
-rw-r--r-- | sys/arch/arm/xscale/pxa27x_udc.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/arch/arm/xscale/pxa27x_udc.c b/sys/arch/arm/xscale/pxa27x_udc.c index ab417857403..9f2d4a014eb 100644 --- a/sys/arch/arm/xscale/pxa27x_udc.c +++ b/sys/arch/arm/xscale/pxa27x_udc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa27x_udc.c,v 1.25 2010/08/27 05:04:06 deraadt Exp $ */ +/* $OpenBSD: pxa27x_udc.c,v 1.26 2010/08/30 21:35:55 deraadt Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> @@ -52,7 +52,7 @@ struct pxaudc_pipe { // LIST_ENTRY(pxaudc_pipe) list; }; -void pxaudc_power(int, void *); +void pxaudc_powerhook(int, void *); void pxaudc_enable(struct pxaudc_softc *); void pxaudc_disable(struct pxaudc_softc *); @@ -200,7 +200,7 @@ pxaudc_attach(struct pxaudc_softc *sc, void *aux) return; } - sc->sc_powerhook = powerhook_establish(pxaudc_power, sc); + sc->sc_powerhook = powerhook_establish(pxaudc_powerhook, sc); /* Set up the bus struct. */ sc->sc_bus.methods = &pxaudc_bus_methods; @@ -245,20 +245,26 @@ pxaudc_detach(struct pxaudc_softc *sc, int flags) return (0); } -void -pxaudc_power(int why, void *arg) +int +pxaudc_activate(struct pxaudc_softc *self, int act) { - struct pxaudc_softc *sc = (struct pxaudc_softc *)arg; + struct pxaudc_softc *sc = (struct pxaudc_softc *)self; - switch (why) { - case PWR_SUSPEND: + switch (act) { + case DVACT_SUSPEND: pxaudc_disable(sc); break; - - case PWR_RESUME: + case DVACT_RESUME: pxaudc_enable(sc); break; } + return 0; +} + +void +pxaudc_powerhook(int why, void *arg) +{ + pxaudc_activate(arg, why); } /* |