summaryrefslogtreecommitdiff
path: root/sys/dev/pci/auich.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-12-18 23:02:40 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-12-18 23:02:40 +0000
commit677a46ff40f24aa47416aecca23911457f78b2ca (patch)
treede1b3c77cf527b6f2e13a862c0c5dcb230a9759c /sys/dev/pci/auich.c
parent9c10b55a24b4b10fb51572c8b5382b6b019abea2 (diff)
correctly deal w/ ext_ctrl in powerhook
Diffstat (limited to 'sys/dev/pci/auich.c')
-rw-r--r--sys/dev/pci/auich.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
index 7194587b6e5..53c0a834666 100644
--- a/sys/dev/pci/auich.c
+++ b/sys/dev/pci/auich.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auich.c,v 1.18 2001/12/18 22:55:25 provos Exp $ */
+/* $OpenBSD: auich.c,v 1.19 2001/12/18 23:02:39 mickey Exp $ */
/*
* Copyright (c) 2000,2001 Michael Shalayeff
@@ -172,6 +172,7 @@ struct auich_softc {
void *powerhook;
int suspend;
+ u_int16_t ext_ctrl;
};
#ifdef AUICH_DEBUG
@@ -1045,10 +1046,9 @@ auich_powerhook(why, self)
/* Power down */
DPRINTF(1, ("auich: power down\n"));
sc->suspend = why;
+ auich_read_codec(sc, AC97_REG_EXT_AUDIO_CTRL, &sc->ext_ctrl);
} else {
- u_int16_t id, ext_id;
-
/* Wake up */
DPRINTF(1, ("auich: power resume\n"));
if (sc->suspend == PWR_RESUME) {
@@ -1059,15 +1059,7 @@ auich_powerhook(why, self)
}
sc->suspend = why;
auich_reset_codec(sc);
-
- auich_read_codec(sc, AC97_REG_EXT_AUDIO_ID, &ext_id);
- auich_read_codec(sc, AC97_REG_EXT_AUDIO_ID, &id);
- if (ext_id & AC97_EXT_AUDIO_VRA)
- id |= AC97_EXT_AUDIO_VRA;
- if (ext_id & AC97_EXT_AUDIO_VRM)
- id |= AC97_EXT_AUDIO_VRM;
- auich_write_codec(sc, AC97_REG_EXT_AUDIO_CTRL, id);
-
+ auich_write_codec(sc, AC97_REG_EXT_AUDIO_CTRL, sc->ext_ctrl);
(sc->codec_if->vtbl->restore_ports)(sc->codec_if);
}
}