diff options
| author | 2010-08-27 18:50:56 +0000 | |
|---|---|---|
| committer | 2010-08-27 18:50:56 +0000 | |
| commit | fc8c68ae642f8090d898e94a3c8380ba82f3fcc3 (patch) | |
| tree | 461c347143f5f0109505bef671522bf1d84289bf /sys/dev/pci/autri.c | |
| parent | Mangle neo_power's contents into a neo_activate function, then make (diff) | |
| download | wireguard-openbsd-fc8c68ae642f8090d898e94a3c8380ba82f3fcc3.tar.xz wireguard-openbsd-fc8c68ae642f8090d898e94a3c8380ba82f3fcc3.zip | |
Since the changes in neo(4) work, it is very likely that the exact same
mechnical changes work in these drivers too. Testing can occur after
this commit.
Diffstat (limited to 'sys/dev/pci/autri.c')
| -rw-r--r-- | sys/dev/pci/autri.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index 5389362351a..f87cd11077e 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.25 2010/07/15 03:43:11 jakemsr Exp $ */ +/* $OpenBSD: autri.c,v 1.26 2010/08/27 18:50:56 deraadt Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -72,6 +72,7 @@ int autridebug = 0; int autri_match(struct device *, void *, void *); void autri_attach(struct device *, struct device *, void *); +int autri_activate(struct device *, int); int autri_intr(void *); #define DMAADDR(p) ((p)->map->dm_segs[0].ds_addr) @@ -117,7 +118,8 @@ struct cfdriver autri_cd = { }; struct cfattach autri_ca = { - sizeof(struct autri_softc), autri_match, autri_attach + sizeof(struct autri_softc), autri_match, autri_attach, NULL, + autri_activate }; int autri_open(void *, int); @@ -616,22 +618,30 @@ autri_attach(parent, self, aux) midi_attach_mi(&autri_midi_hw_if, sc, &sc->sc_dev); #endif - sc->sc_old_power = PWR_RESUME; powerhook_establish(autri_powerhook, sc); } -void -autri_powerhook(int why,void *addr) +int +autri_activate(struct device *self, int act) { - struct autri_softc *sc = addr; + struct autri_softc *sc = (struct autri_softc *)self; - if (why == PWR_RESUME && sc->sc_old_power == PWR_SUSPEND) { - DPRINTF(("PWR_RESUME\n")); + switch (act) { + case DVACT_SUSPEND: + break; + case DVACT_RESUME: autri_init(sc); /*autri_reset_codec(&sc->sc_codec);*/ (sc->sc_codec.codec_if->vtbl->restore_ports)(sc->sc_codec.codec_if); + break; } - sc->sc_old_power = why; + return 0; +} + +void +autri_powerhook(int why,void *addr) +{ + autri_activate(addr, why); } int |
