Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/ds1.c
Show First 20 Lines • Show All 1,004 Lines • ▼ Show 20 Lines | ds_pci_attach(device_t dev) | ||||
sc->irqid = 0; | sc->irqid = 0; | ||||
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, | sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, | ||||
RF_ACTIVE | RF_SHAREABLE); | RF_ACTIVE | RF_SHAREABLE); | ||||
if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, 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"); | device_printf(dev, "unable to map interrupt\n"); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld %s", | snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s", | ||||
rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_ds1)); | rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_ds1)); | ||||
if (pcm_register(dev, sc, DS1_CHANS, 2)) | if (pcm_register(dev, sc, DS1_CHANS, 2)) | ||||
goto bad; | goto bad; | ||||
for (i = 0; i < DS1_CHANS; i++) | for (i = 0; i < DS1_CHANS; i++) | ||||
pcm_addchan(dev, PCMDIR_PLAY, &ds1pchan_class, sc); | pcm_addchan(dev, PCMDIR_PLAY, &ds1pchan_class, sc); | ||||
for (i = 0; i < 2; i++) | for (i = 0; i < 2; i++) | ||||
pcm_addchan(dev, PCMDIR_REC, &ds1rchan_class, sc); | pcm_addchan(dev, PCMDIR_REC, &ds1rchan_class, sc); | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |