From eb5b9d0b873ccd8c373f81d49be21e3ea36bd5a0 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Wed, 21 Nov 2001 04:26:04 +0000 Subject: Correct extmode initialization. MFC after: 3 --- sys/dev/sound/pci/ich.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 3d7b21faa8644..ddbd6b9ff0f73 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -473,6 +473,7 @@ static int ich_pci_attach(device_t dev) { u_int32_t data; + u_int16_t extcaps; struct sc_info *sc; char status[SND_STATUSLEN]; @@ -522,10 +523,11 @@ ich_pci_attach(device_t dev) mixer_init(dev, ac97_getmixerclass(), sc->codec); /* check and set VRA function */ - if (ac97_setextmode(sc->codec, AC97_EXTCAP_VRA) == 0) - sc->hasvra = 1; - if (ac97_setextmode(sc->codec, AC97_EXTCAP_VRM) == 0) - sc->hasvrm = 1; + extcaps = ac97_getcaps(sc->codec); + sc->hasvra = extcaps & AC97_EXTCAP_VRA; + sc->hasvrm = extcaps & AC97_EXTCAP_VRM; + ac97_setextmode(sc->codec, + extcaps & (AC97_EXTCAP_VRA | AC97_EXTCAP_VRM)); if (ac97_getcaps(sc->codec) & AC97_CAP_MICCHANNEL) sc->hasmic = 1; -- cgit v1.3