- Locking fixes. Release lock while chn_intr().

- Mark MPSAFE since most of the locking procedures already implemented.
- Turn on inverted external amplifier sense flag for selected boards.

Tested by:	bland
MFC after:	1 week
This commit is contained in:
Ariff Abdullah 2006-01-11 08:02:15 +00:00
parent 07a263153e
commit 40c012dd6d

View File

@ -743,13 +743,17 @@ ds_intr(void *p)
for (i = 0; i < DS1_CHANS; i++) {
if (sc->pch[i].run) {
x = 1;
snd_mtxunlock(sc->lock);
chn_intr(sc->pch[i].channel);
snd_mtxlock(sc->lock);
}
}
for (i = 0; i < 2; i++) {
if (sc->rch[i].run) {
x = 1;
snd_mtxunlock(sc->lock);
chn_intr(sc->rch[i].channel);
snd_mtxlock(sc->lock);
}
}
i = ds_rd(sc, YDSXGR_MODE, 4);
@ -986,12 +990,23 @@ ds_pci_attach(device_t dev)
codec = AC97_CREATE(dev, sc, ds_ac97);
if (codec == NULL)
goto bad;
/*
* Turn on inverted external amplifier sense flags for few
* 'special' boards.
*/
switch (subdev) {
case 0x81171033: /* NEC ValueStar (VT550/0) */
ac97_setflags(codec, ac97_getflags(codec) | AC97_F_EAPD_INV);
break;
default:
break;
}
mixer_init(dev, ac97_getmixerclass(), codec);
sc->irqid = 0;
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, ds_intr, sc, &sc->ih)) {
if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ds_intr, sc, &sc->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
}