27 |
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
28 |
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
29 |
|
|
|
#define CARD_NAME "Aureal Vortex 3D Sound Processor" |
|
|
|
|
30 |
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); |
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); |
31 |
MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
32 |
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC); |
MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC); |
55 |
nr_dev++; |
nr_dev++; |
56 |
return 1; |
return 1; |
57 |
} |
} |
58 |
__setup("snd-mychip=", alsa_card_vortex_setup); |
__setup("snd-au88x0=", alsa_card_vortex_setup); |
59 |
#endif /* ifndef MODULE */ |
#endif /* ifndef MODULE */ |
60 |
|
|
61 |
// PCI IDs |
|
|
/* |
|
|
static struct pci_device_id snd_vortex_ids[] __devinitdata = { |
|
|
{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX, |
|
|
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, |
|
|
{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX2, |
|
|
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, |
|
|
{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, |
|
|
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, |
|
|
{0,} |
|
|
}; |
|
|
*/ |
|
62 |
MODULE_DEVICE_TABLE(pci, snd_vortex_ids); |
MODULE_DEVICE_TABLE(pci, snd_vortex_ids); |
63 |
|
|
64 |
// chip-specific destructor |
// chip-specific destructor |
89 |
// (see "Management of Cards and Components") |
// (see "Management of Cards and Components") |
90 |
static int __devinit |
static int __devinit |
91 |
snd_vortex_create(snd_card_t * card, struct pci_dev *pci, vortex_t ** rchip) { |
snd_vortex_create(snd_card_t * card, struct pci_dev *pci, vortex_t ** rchip) { |
92 |
vortex_t *chip; // vortex |
vortex_t *chip; |
93 |
int err; |
int err; |
94 |
static snd_device_ops_t ops = { |
static snd_device_ops_t ops = { |
95 |
.dev_free = snd_vortex_dev_free, |
.dev_free = snd_vortex_dev_free, |
126 |
// (1) PCI resource allocation |
// (1) PCI resource allocation |
127 |
// Get MMIO area. |
// Get MMIO area. |
128 |
if (!request_mem_region(pci_resource_start(pci, 0), |
if (!request_mem_region(pci_resource_start(pci, 0), |
129 |
pci_resource_len(pci, 0), "vortex")) { |
pci_resource_len(pci, 0), CARD_NAME_SHORT)) { |
130 |
snd_vortex_free(chip); |
snd_vortex_free(chip); |
131 |
printk(KERN_ERR "cannot allocate mmio area.\n"); |
printk(KERN_ERR "cannot allocate mmio area.\n"); |
132 |
return -EBUSY; |
return -EBUSY; |
144 |
printk(KERN_ERR "cannot allocate I/O port0.\n"); |
printk(KERN_ERR "cannot allocate I/O port0.\n"); |
145 |
return -EBUSY; |
return -EBUSY; |
146 |
} |
} |
147 |
chip->port0 = request_region(pci_resource_start(pci, 1), 8, "vortex"); |
chip->port0 = request_region(pci_resource_start(pci, 1), 8, CARD_NAME_SHORT); |
148 |
|
|
149 |
if (check_region(pci_resource_start(pci, 2), 8)) { |
if (check_region(pci_resource_start(pci, 2), 8)) { |
150 |
snd_vortex_free(chip); |
snd_vortex_free(chip); |
151 |
printk(KERN_ERR "cannot allocate the I/O port1.\n"); |
printk(KERN_ERR "cannot allocate the I/O port1.\n"); |
152 |
return -EBUSY; |
return -EBUSY; |
153 |
} |
} |
154 |
chip->port1 = request_region(pci_resource_start(pci, 2), 8, "vortex"); |
chip->port1 = request_region(pci_resource_start(pci, 2), 8, CARD_NAME_SHORT); |
155 |
|
|
156 |
if (request_irq(pci->irq, vortex_interrupt, SA_INTERRUPT | SA_SHIRQ, |
if (request_irq(pci->irq, vortex_interrupt, SA_INTERRUPT | SA_SHIRQ, |
157 |
"vortex", (void *) chip)) { |
CARD_NAME_SHORT, (void *) chip)) { |
158 |
snd_vortex_free(chip); |
snd_vortex_free(chip); |
159 |
printk(KERN_ERR "cannot grab irq\n"); |
printk(KERN_ERR "cannot grab irq\n"); |
160 |
return -EBUSY; |
return -EBUSY; |
229 |
if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_VORTEX_SYNTH, |
if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_VORTEX_SYNTH, |
230 |
sizeof(snd_vortex_synth_arg_t), &wave) < 0 |
sizeof(snd_vortex_synth_arg_t), &wave) < 0 |
231 |
|| wave == NULL) { |
|| wave == NULL) { |
232 |
snd_printk("can't initialize Vortex wavetable synth\n"); |
snd_printk("Can't initialize Aureal wavetable synth\n"); |
233 |
} else { |
} else { |
234 |
snd_vortex_synth_arg_t *arg; |
snd_vortex_synth_arg_t *arg; |
235 |
|
|
236 |
arg = SNDRV_SEQ_DEVICE_ARGPTR(wave); |
arg = SNDRV_SEQ_DEVICE_ARGPTR(wave); |
237 |
strcpy(wave->name, "Vortex Synth"); |
strcpy(wave->name, "Aureal Synth"); |
238 |
arg->hwptr = vortex; |
arg->hwptr = vortex; |
239 |
arg->index = 1; |
arg->index = 1; |
240 |
arg->seq_ports = seq_ports[dev]; |
arg->seq_ports = seq_ports[dev]; |
243 |
#endif |
#endif |
244 |
|
|
245 |
// (5) |
// (5) |
246 |
strcpy(card->driver, "vortex Vortex"); |
strcpy(card->driver, "Aureal Vortex"); |
247 |
strcpy(card->shortname, "vortex"); |
strcpy(card->shortname, CARD_NAME_SHORT); |
248 |
sprintf(card->longname, "%s at 0x%lx irq %i", |
sprintf(card->longname, "%s at 0x%lx irq %i", |
249 |
card->shortname, chip->io, chip->irq); |
card->shortname, chip->io, chip->irq); |
250 |
|
|
275 |
|
|
276 |
// pci_driver definition |
// pci_driver definition |
277 |
static struct pci_driver driver = { |
static struct pci_driver driver = { |
278 |
.name = "Aureal Vortex", |
.name = CARD_NAME_SHORT, |
279 |
.id_table = snd_vortex_ids, |
.id_table = snd_vortex_ids, |
280 |
.probe = snd_vortex_probe, |
.probe = snd_vortex_probe, |
281 |
.remove = __devexit_p(snd_vortex_remove), |
.remove = __devexit_p(snd_vortex_remove), |
287 |
|
|
288 |
if ((err = pci_module_init(&driver)) < 0) { |
if ((err = pci_module_init(&driver)) < 0) { |
289 |
#ifdef MODULE |
#ifdef MODULE |
290 |
printk(KERN_ERR "vortex soundcard not found " "or device busy\n"); |
printk(KERN_ERR "Aureal soundcard not found " "or device busy\n"); |
291 |
#endif |
#endif |
292 |
return err; |
return err; |
293 |
} |
} |