// SPDX-License-Identifier: GPL-2.0-or-later /* * Driver for SoundBlaster 1.0/2.0/Pro soundcards and compatible * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*/
/* * Block the 0x388 port to avoid PnP conflicts. * No need to check this value after request_region, * as we never do anything with it.
*/
acard->fm_res = devm_request_region(card->dev, 0x388, 4, "SoundBlaster FM");
if (port[dev] != SNDRV_AUTO_PORT) {
err = snd_sbdsp_create(card, port[dev], irq[dev],
snd_sb8_interrupt, dma8[dev],
-1, SB_HW_AUTO, &chip); if (err < 0) return err;
} else { /* auto-probe legacy ports */ staticconstunsignedlong possible_ports[] = {
0x220, 0x240, 0x260,
}; int i; for (i = 0; i < ARRAY_SIZE(possible_ports); i++) {
err = snd_sbdsp_create(card, possible_ports[i],
irq[dev],
snd_sb8_interrupt,
dma8[dev],
-1,
SB_HW_AUTO,
&chip); if (err >= 0) {
port[dev] = possible_ports[i]; break;
}
} if (i >= ARRAY_SIZE(possible_ports)) return -EINVAL;
}
acard->chip = chip;
if (chip->hardware >= SB_HW_16) { if (chip->hardware == SB_HW_ALS100)
dev_warn(pdev, "ALS100 chip detected at 0x%lx, try snd-als100 module\n",
port[dev]); else
dev_warn(pdev, "SB 16 chip detected at 0x%lx, try snd-sb16 module\n",
port[dev]); return -ENODEV;
}
err = snd_sb8dsp_pcm(chip, 0); if (err < 0) return err;
err = snd_sbmixer_new(chip); if (err < 0) return err;
if (chip->hardware == SB_HW_10 || chip->hardware == SB_HW_20) {
err = snd_opl3_create(card, chip->port + 8, 0,
OPL3_HW_AUTO, 1, &opl3); if (err < 0)
dev_warn(pdev, "sb8: no OPL device at 0x%lx\n", chip->port + 8);
} else {
err = snd_opl3_create(card, chip->port, chip->port + 2,
OPL3_HW_AUTO, 1, &opl3); if (err < 0) {
dev_warn(pdev, "sb8: no OPL device at 0x%lx-0x%lx\n",
chip->port, chip->port + 2);
}
} if (err >= 0) {
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); if (err < 0) return err;
}
err = snd_sb8dsp_midi(chip, 0); if (err < 0) return err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.