Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/vibes.c
Show First 20 Lines • Show All 809 Lines • ▼ Show 20 Lines | sv_attach(device_t dev) { | ||||
} | } | ||||
/* Check assumptions about space availability and | /* Check assumptions about space availability and | ||||
alignment. How driver loaded can determine whether | alignment. How driver loaded can determine whether | ||||
games_start > midi_start or vice versa */ | games_start > midi_start or vice versa */ | ||||
if ((mu - ml >= 0x800) || | if ((mu - ml >= 0x800) || | ||||
((mu - ml) % 0x200)) { | ((mu - ml) % 0x200)) { | ||||
device_printf(dev, "sv_attach: resource assumptions not met " | device_printf(dev, "sv_attach: resource assumptions not met " | ||||
"(midi 0x%08lx, games 0x%08lx)\n", | "(midi 0x%08lx, games 0x%08lx)\n", | ||||
midi_start, games_start); | (u_long)midi_start, (u_long)games_start); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
sdmaa = ml + 0x40; | sdmaa = ml + 0x40; | ||||
sdmac = sdmaa + 0x40; | sdmac = sdmaa + 0x40; | ||||
/* Add resources to list of pci resources for this device - from here on | /* Add resources to list of pci resources for this device - from here on | ||||
* they look like normal pci resources. */ | * they look like normal pci resources. */ | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | printf("Sonicvibes: revision %d.\n", sc->rev); | ||||
if (pcm_register(dev, sc, 1, 1)) { | if (pcm_register(dev, sc, 1, 1)) { | ||||
device_printf(dev, "sv_attach: pcm_register fail\n"); | device_printf(dev, "sv_attach: pcm_register fail\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); | pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); | ||||
pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); | pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); | ||||
snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s", | snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", | ||||
rman_get_start(sc->enh_reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_vibes)); | rman_get_start(sc->enh_reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_vibes)); | ||||
pcm_setstatus(dev, status); | pcm_setstatus(dev, status); | ||||
DEB(printf("sv_attach: succeeded\n")); | DEB(printf("sv_attach: succeeded\n")); | ||||
return 0; | return 0; | ||||
fail: | fail: | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |