From d44af743d055b3904231f690ffe156245c35a902 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Tue, 21 Sep 2010 02:53:15 +0000 Subject: audio(4) and ac97(4) style suspend/resume --- sys/dev/pci/autri.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index fce8bc7208b..860bf8aeab5 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.27 2010/09/07 16:21:44 deraadt Exp $ */ +/* $OpenBSD: autri.c,v 1.28 2010/09/21 02:53:14 jakemsr Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -622,17 +622,25 @@ int autri_activate(struct device *self, int act) { struct autri_softc *sc = (struct autri_softc *)self; + int rv = 0; switch (act) { + case DVACT_ACTIVATE: + break; + case DVACT_QUIESCE: + rv = config_activate_children(self, act); + break; 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); + ac97_resume(&sc->sc_codec.host_if, sc->sc_codec.codec_if); + rv = config_activate_children(self, act); + break; + case DVACT_DEACTIVATE: break; } - return 0; + return (rv); } int -- cgit v1.2.3