2 * ALSA card-level driver for Turtle Beach Wavefront cards
3 * (Maui,Tropez,Tropez+)
5 * Copyright (c) 1997-1999 by Paul Barton-Davis <pbd@op.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <sound/driver.h>
23 #include <linux/init.h>
24 #include <linux/interrupt.h>
25 #include <linux/slab.h>
26 #include <linux/pnp.h>
27 #include <sound/core.h>
29 #include <sound/initval.h>
30 #include <sound/opl3.h>
31 #include <sound/snd_wavefront.h>
33 #define chip_t cs4231_t
35 MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
36 MODULE_DESCRIPTION("Turtle Beach Wavefront");
37 MODULE_LICENSE("GPL");
38 MODULE_CLASSES("{sound}");
39 MODULE_DEVICES("{{Turtle Beach,Maui/Tropez/Tropez+}}");
41 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
42 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
43 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
44 static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
45 static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
46 static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
47 static long cs4232_mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
48 static int cs4232_mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 9,11,12,15 */
49 static long ics2115_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
50 static int ics2115_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,9,11,12,15 */
51 static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
52 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
53 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
54 static int use_cs4232_midi[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
56 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
57 MODULE_PARM_DESC(index, "Index value for WaveFront soundcard.");
58 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
59 MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
60 MODULE_PARM_DESC(id, "ID string for WaveFront soundcard.");
61 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
62 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
63 MODULE_PARM_DESC(enable, "Enable WaveFront soundcard.");
64 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
66 MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
67 MODULE_PARM_DESC(isapnp, "ISA PnP detection for WaveFront soundcards.");
68 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
70 MODULE_PARM(cs4232_pcm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
71 MODULE_PARM_DESC(cs4232_pcm_port, "Port # for CS4232 PCM interface.");
72 MODULE_PARM_SYNTAX(cs4232_pcm_port, SNDRV_PORT12_DESC);
73 MODULE_PARM(cs4232_pcm_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
74 MODULE_PARM_DESC(cs4232_pcm_irq, "IRQ # for CS4232 PCM interface.");
75 MODULE_PARM_SYNTAX(cs4232_pcm_irq, SNDRV_ENABLED ",allows:{{5},{7},{9},{11},{12},{15}},dialog:list");
76 MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
77 MODULE_PARM_DESC(dma1, "DMA1 # for CS4232 PCM interface.");
78 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
79 MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
80 MODULE_PARM_DESC(dma2, "DMA2 # for CS4232 PCM interface.");
81 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
82 MODULE_PARM(cs4232_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
83 MODULE_PARM_DESC(cs4232_mpu_port, "port # for CS4232 MPU-401 interface.");
84 MODULE_PARM_SYNTAX(cs4232_mpu_port, SNDRV_PORT12_DESC);
85 MODULE_PARM(cs4232_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
86 MODULE_PARM_DESC(cs4232_mpu_irq, "IRQ # for CS4232 MPU-401 interface.");
87 MODULE_PARM_SYNTAX(cs4232_mpu_irq, SNDRV_ENABLED ",allows:{{9},{11},{12},{15}},dialog:list");
88 MODULE_PARM(ics2115_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
89 MODULE_PARM_DESC(ics2115_irq, "IRQ # for ICS2115.");
90 MODULE_PARM_SYNTAX(ics2115_irq, SNDRV_ENABLED ",allows:{{9},{11},{12},{15}},dialog:list");
91 MODULE_PARM(ics2115_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
92 MODULE_PARM_DESC(ics2115_port, "Port # for ICS2115.");
93 MODULE_PARM_SYNTAX(ics2115_port, SNDRV_PORT12_DESC);
94 MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
95 MODULE_PARM_DESC(fm_port, "FM port #.");
96 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
97 MODULE_PARM(use_cs4232_midi, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
98 MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
99 MODULE_PARM_SYNTAX(use_cs4232_midi, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
101 static snd_card_t *snd_wavefront_legacy[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
105 static struct pnp_card_device_id snd_wavefront_pnpids[] = {
107 { .id = "CSC7532", .devs = { { "CSC0000" }, { "CSC0010" }, { "PnPb006" }, { "CSC0004" } } },
109 { .id = "CSC7632", .devs = { { "CSC0000" }, { "CSC0010" }, { "PnPb006" }, { "CSC0004" } } },
113 MODULE_DEVICE_TABLE(pnp_card, snd_wavefront_pnpids);
116 snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *card,
117 const struct pnp_card_device_id *id)
119 struct pnp_dev *pdev;
120 struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
126 /* Check for each logical device. */
128 /* CS4232 chip (aka "windows sound system") is logical device 0 */
130 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL);
131 if (acard->wss == NULL) {
136 /* there is a game port at logical device 1, but we ignore it completely */
138 /* the control interface is logical device 2, but we ignore it
139 completely. in fact, nobody even seems to know what it
143 /* Only configure the CS4232 MIDI interface if its been
144 specifically requested. It is logical device 3.
147 if (use_cs4232_midi[dev]) {
148 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
149 if (acard->mpu == NULL) {
155 /* The ICS2115 synth is logical device 4 */
157 acard->synth = pnp_request_card_device(card, id->devs[3].id, NULL);
158 if (acard->synth == NULL) {
163 /* PCM/FM initialization */
167 pnp_init_resource_table(cfg);
169 /* An interesting note from the Tropez+ FAQ:
171 Q. [Ports] Why is the base address of the WSS I/O ports off by 4?
173 A. WSS I/O requires a block of 8 I/O addresses ("ports"). Of these, the first
174 4 are used to identify and configure the board. With the advent of PnP,
175 these first 4 addresses have become obsolete, and software applications
176 only use the last 4 addresses to control the codec chip. Therefore, the
177 base address setting "skips past" the 4 unused addresses.
181 if (cs4232_pcm_port[dev] != SNDRV_AUTO_PORT)
182 pnp_resource_change(&cfg->port_resource[0], cs4232_pcm_port[dev], 4);
183 if (fm_port[dev] != SNDRV_AUTO_PORT)
184 pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
185 if (dma1[dev] != SNDRV_AUTO_DMA)
186 pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1);
187 if (dma2[dev] != SNDRV_AUTO_DMA)
188 pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1);
189 if (cs4232_pcm_irq[dev] != SNDRV_AUTO_IRQ)
190 pnp_resource_change(&cfg->irq_resource[0], cs4232_pcm_irq[dev], 1);
192 if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
193 snd_printk(KERN_ERR "PnP WSS the requested resources are invalid, using auto config\n");
194 err = pnp_activate_dev(pdev);
196 snd_printk(KERN_ERR "PnP WSS pnp configure failure\n");
201 cs4232_pcm_port[dev] = pnp_port_start(pdev, 0);
202 fm_port[dev] = pnp_port_start(pdev, 1);
203 dma1[dev] = pnp_dma(pdev, 0);
204 dma2[dev] = pnp_dma(pdev, 1);
205 cs4232_pcm_irq[dev] = pnp_irq(pdev, 0);
207 /* Synth initialization */
211 pnp_init_resource_table(cfg);
213 if (ics2115_port[dev] != SNDRV_AUTO_PORT) {
214 pnp_resource_change(&cfg->port_resource[0], ics2115_port[dev], 16);
217 if (ics2115_port[dev] != SNDRV_AUTO_IRQ) {
218 pnp_resource_change(&cfg->irq_resource[0], ics2115_irq[dev], 1);
221 if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
222 snd_printk(KERN_ERR "PnP ICS2115 the requested resources are invalid, using auto config\n");
223 err = pnp_activate_dev(pdev);
225 snd_printk(KERN_ERR "PnP ICS2115 pnp configure failure\n");
230 ics2115_port[dev] = pnp_port_start(pdev, 0);
231 ics2115_irq[dev] = pnp_irq(pdev, 0);
233 /* CS4232 MPU initialization. Configure this only if
234 explicitly requested, since its physically inaccessible and
235 consumes another IRQ.
238 if (use_cs4232_midi[dev]) {
242 pnp_init_resource_table(cfg);
244 if (cs4232_mpu_port[dev] != SNDRV_AUTO_PORT)
245 pnp_resource_change(&cfg->port_resource[0], cs4232_mpu_port[dev], 2);
246 if (cs4232_mpu_irq[dev] != SNDRV_AUTO_IRQ)
247 pnp_resource_change(&cfg->port_resource[0], cs4232_mpu_irq[dev], 1);
249 if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
250 snd_printk(KERN_ERR "PnP MPU401 the requested resources are invalid, using auto config\n");
251 err = pnp_activate_dev(pdev);
253 snd_printk(KERN_ERR "PnP MPU401 pnp configure failure\n");
254 cs4232_mpu_port[dev] = SNDRV_AUTO_PORT;
256 cs4232_mpu_port[dev] = pnp_port_start(pdev, 0);
257 cs4232_mpu_irq[dev] = pnp_irq(pdev, 0);
260 snd_printk ("CS4232 MPU: port=0x%lx, irq=%i\n",
261 cs4232_mpu_port[dev],
262 cs4232_mpu_irq[dev]);
265 snd_printdd ("CS4232: pcm port=0x%lx, fm port=0x%lx, dma1=%i, dma2=%i, irq=%i\nICS2115: port=0x%lx, irq=%i\n",
266 cs4232_pcm_port[dev],
278 #endif /* CONFIG_PNP */
280 static irqreturn_t snd_wavefront_ics2115_interrupt(int irq,
282 struct pt_regs *regs)
284 snd_wavefront_card_t *acard;
286 acard = (snd_wavefront_card_t *) dev_id;
291 if (acard->wavefront.interrupts_are_midi) {
292 snd_wavefront_midi_interrupt (acard);
294 snd_wavefront_internal_interrupt (acard);
299 snd_hwdep_t * __devinit
300 snd_wavefront_new_synth (snd_card_t *card,
302 snd_wavefront_card_t *acard)
304 snd_hwdep_t *wavefront_synth;
306 if (snd_wavefront_detect (acard) < 0) {
310 if (snd_wavefront_start (&acard->wavefront) < 0) {
314 if (snd_hwdep_new(card, "WaveFront", hw_dev, &wavefront_synth) < 0)
316 strcpy (wavefront_synth->name,
317 "WaveFront (ICS2115) wavetable synthesizer");
318 wavefront_synth->ops.open = snd_wavefront_synth_open;
319 wavefront_synth->ops.release = snd_wavefront_synth_release;
320 wavefront_synth->ops.ioctl = snd_wavefront_synth_ioctl;
322 return wavefront_synth;
325 snd_hwdep_t * __devinit
326 snd_wavefront_new_fx (snd_card_t *card,
328 snd_wavefront_card_t *acard,
332 snd_hwdep_t *fx_processor;
334 if (snd_wavefront_fx_start (&acard->wavefront)) {
335 snd_printk ("cannot initialize YSS225 FX processor");
339 if (snd_hwdep_new (card, "YSS225", hw_dev, &fx_processor) < 0)
341 sprintf (fx_processor->name, "YSS225 FX Processor at 0x%lx", port);
342 fx_processor->ops.open = snd_wavefront_fx_open;
343 fx_processor->ops.release = snd_wavefront_fx_release;
344 fx_processor->ops.ioctl = snd_wavefront_fx_ioctl;
349 static snd_wavefront_mpu_id internal_id = internal_mpu;
350 static snd_wavefront_mpu_id external_id = external_mpu;
352 snd_rawmidi_t * __devinit
353 snd_wavefront_new_midi (snd_card_t *card,
355 snd_wavefront_card_t *acard,
357 snd_wavefront_mpu_id mpu)
360 snd_rawmidi_t *rmidi;
361 static int first = 1;
365 acard->wavefront.midi.base = port;
366 if (snd_wavefront_midi_start (acard)) {
367 snd_printk ("cannot initialize MIDI interface\n");
372 if (snd_rawmidi_new (card, "WaveFront MIDI", midi_dev, 1, 1, &rmidi) < 0)
375 if (mpu == internal_mpu) {
376 strcpy(rmidi->name, "WaveFront MIDI (Internal)");
377 rmidi->private_data = &internal_id;
379 strcpy(rmidi->name, "WaveFront MIDI (External)");
380 rmidi->private_data = &external_id;
383 snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_wavefront_midi_output);
384 snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_wavefront_midi_input);
386 rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT |
387 SNDRV_RAWMIDI_INFO_INPUT |
388 SNDRV_RAWMIDI_INFO_DUPLEX;
394 snd_wavefront_free(snd_card_t *card)
396 snd_wavefront_card_t *acard = (snd_wavefront_card_t *)card->private_data;
399 if (acard->wavefront.res_base != NULL) {
400 release_resource(acard->wavefront.res_base);
401 kfree_nocheck(acard->wavefront.res_base);
403 if (acard->wavefront.irq > 0)
404 free_irq(acard->wavefront.irq, (void *)acard);
409 snd_wavefront_probe (int dev, struct pnp_card_link *pcard,
410 const struct pnp_card_device_id *pid)
413 snd_wavefront_card_t *acard;
415 snd_hwdep_t *wavefront_synth;
416 snd_rawmidi_t *ics2115_internal_rmidi = NULL;
417 snd_rawmidi_t *ics2115_external_rmidi = NULL;
418 snd_hwdep_t *fx_processor;
419 int hw_dev = 0, midi_dev = 0, err;
424 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
425 snd_printk("specify CS4232 port\n");
428 if (ics2115_port[dev] == SNDRV_AUTO_PORT) {
429 snd_printk("specify ICS2115 port\n");
435 card = snd_card_new (index[dev],
438 sizeof(snd_wavefront_card_t));
443 acard = (snd_wavefront_card_t *)card->private_data;
444 acard->wavefront.irq = -1;
445 spin_lock_init(&acard->wavefront.irq_lock);
446 init_waitqueue_head(&acard->wavefront.interrupt_sleeper);
447 spin_lock_init(&acard->wavefront.midi.open);
448 spin_lock_init(&acard->wavefront.midi.virtual);
449 card->private_free = snd_wavefront_free;
453 if (snd_wavefront_pnp (dev, acard, pcard, pid) < 0) {
454 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
455 snd_printk ("isapnp detection failed\n");
456 snd_card_free (card);
460 snd_card_set_dev(card, &pcard->card->dev);
462 #endif /* CONFIG_PNP */
464 /* --------- PCM --------------- */
466 if ((err = snd_cs4231_create (card,
467 cs4232_pcm_port[dev],
472 CS4231_HW_DETECT, 0, &chip)) < 0) {
474 snd_printk ("can't allocate CS4231 device\n");
478 if ((err = snd_cs4231_pcm (chip, 0, NULL)) < 0) {
482 if ((err = snd_cs4231_timer (chip, 0, NULL)) < 0) {
487 /* ---------- OPL3 synth --------- */
489 if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
492 if ((err = snd_opl3_create(card,
497 snd_printk ("can't allocate or detect OPL3 synth\n");
502 if ((err = snd_opl3_hwdep_new(opl3, hw_dev, 1, NULL)) < 0) {
509 /* ------- ICS2115 Wavetable synth ------- */
511 if ((acard->wavefront.res_base = request_region(ics2115_port[dev], 16, "ICS2115")) == NULL) {
512 snd_printk("unable to grab ICS2115 i/o region 0x%lx-0x%lx\n", ics2115_port[dev], ics2115_port[dev] + 16 - 1);
516 if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt, SA_INTERRUPT, "ICS2115", (void *)acard)) {
517 snd_printk("unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]);
522 acard->wavefront.irq = ics2115_irq[dev];
523 acard->wavefront.base = ics2115_port[dev];
525 if ((wavefront_synth = snd_wavefront_new_synth (card, hw_dev, acard)) == NULL) {
526 snd_printk ("can't create WaveFront synth device\n");
531 strcpy (wavefront_synth->name, "ICS2115 Wavetable MIDI Synthesizer");
532 wavefront_synth->iface = SNDRV_HWDEP_IFACE_ICS2115;
535 /* --------- Mixer ------------ */
537 if ((err = snd_cs4231_mixer(chip)) < 0) {
538 snd_printk ("can't allocate mixer device\n");
543 /* -------- CS4232 MPU-401 interface -------- */
545 if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
546 if ((err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232,
547 cs4232_mpu_port[dev], 0,
551 snd_printk ("can't allocate CS4232 MPU-401 device\n");
558 /* ------ ICS2115 internal MIDI ------------ */
560 if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
561 ics2115_internal_rmidi =
562 snd_wavefront_new_midi (card,
567 if (ics2115_internal_rmidi == NULL) {
568 snd_printk ("can't setup ICS2115 internal MIDI device\n");
575 /* ------ ICS2115 external MIDI ------------ */
577 if (ics2115_port[dev] > 0 && ics2115_port[dev] != SNDRV_AUTO_PORT) {
578 ics2115_external_rmidi =
579 snd_wavefront_new_midi (card,
584 if (ics2115_external_rmidi == NULL) {
585 snd_printk ("can't setup ICS2115 external MIDI device\n");
592 /* FX processor for Tropez+ */
594 if (acard->wavefront.has_fx) {
595 fx_processor = snd_wavefront_new_fx (card,
599 if (fx_processor == NULL) {
600 snd_printk ("can't setup FX device\n");
607 strcpy(card->driver, "Tropez+");
608 strcpy(card->shortname, "Turtle Beach Tropez+");
610 /* Need a way to distinguish between Maui and Tropez */
611 strcpy(card->driver, "WaveFront");
612 strcpy(card->shortname, "Turtle Beach WaveFront");
615 /* ----- Register the card --------- */
617 /* Not safe to include "Turtle Beach" in longname, due to
621 sprintf(card->longname, "%s PCM 0x%lx irq %d dma %d",
627 if (dma2[dev] >= 0 && dma2[dev] < 8)
628 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
630 if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
631 sprintf (card->longname + strlen (card->longname),
632 " MPU-401 0x%lx irq %d",
633 cs4232_mpu_port[dev],
634 cs4232_mpu_irq[dev]);
637 sprintf (card->longname + strlen (card->longname),
638 " SYNTH 0x%lx irq %d",
642 if ((err = snd_card_register(card)) < 0) {
647 pnp_set_card_drvdata(pcard, card);
649 snd_wavefront_legacy[dev] = card;
655 static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *card,
656 const struct pnp_card_device_id *id)
661 for ( ; dev < SNDRV_CARDS; dev++) {
662 if (!enable[dev] || !isapnp[dev])
664 res = snd_wavefront_probe(dev, card, id);
674 static void __devexit snd_wavefront_pnp_remove(struct pnp_card_link * pcard)
676 snd_card_t *card = (snd_card_t *) pnp_get_card_drvdata(pcard);
678 snd_card_disconnect(card);
679 snd_card_free_in_thread(card);
682 static struct pnp_card_driver wavefront_pnpc_driver = {
683 .flags = PNP_DRIVER_RES_DISABLE,
685 .id_table = snd_wavefront_pnpids,
686 .probe = snd_wavefront_pnp_detect,
687 .remove = __devexit_p(snd_wavefront_pnp_remove),
690 #endif /* CONFIG_PNP */
692 static int __init alsa_card_wavefront_init(void)
696 for (dev = 0; dev < SNDRV_CARDS; dev++) {
703 if (snd_wavefront_probe(dev, NULL, NULL) >= 0)
707 cards += pnp_register_card_driver(&wavefront_pnpc_driver);
711 pnp_unregister_card_driver(&wavefront_pnpc_driver);
714 printk (KERN_ERR "No WaveFront cards found or devices busy\n");
721 static void __exit alsa_card_wavefront_exit(void)
726 pnp_unregister_card_driver(&wavefront_pnpc_driver);
728 for (idx = 0; idx < SNDRV_CARDS; idx++)
729 snd_card_free(snd_wavefront_legacy[idx]);
732 module_init(alsa_card_wavefront_init)
733 module_exit(alsa_card_wavefront_exit)
737 /* format is: snd-wavefront=enable,index,id,isapnp,
738 cs4232_pcm_port,cs4232_pcm_irq,
739 cs4232_mpu_port,cs4232_mpu_irq,
740 ics2115_port,ics2115_irq,
745 static int __init alsa_card_wavefront_setup(char *str)
747 static unsigned __initdata nr_dev = 0;
749 if (nr_dev >= SNDRV_CARDS)
751 (void)(get_option(&str,&enable[nr_dev]) == 2 &&
752 get_option(&str,&index[nr_dev]) == 2 &&
753 get_id(&str,&id[nr_dev]) == 2 &&
754 get_option(&str,&isapnp[nr_dev]) == 2 &&
755 get_option_long(&str,&cs4232_pcm_port[nr_dev]) == 2 &&
756 get_option(&str,&cs4232_pcm_irq[nr_dev]) == 2 &&
757 get_option_long(&str,&cs4232_mpu_port[nr_dev]) == 2 &&
758 get_option(&str,&cs4232_mpu_irq[nr_dev]) == 2 &&
759 get_option_long(&str,&ics2115_port[nr_dev]) == 2 &&
760 get_option(&str,&ics2115_irq[nr_dev]) == 2 &&
761 get_option_long(&str,&fm_port[nr_dev]) == 2 &&
762 get_option(&str,&dma1[nr_dev]) == 2 &&
763 get_option(&str,&dma2[nr_dev]) == 2 &&
764 get_option(&str,&use_cs4232_midi[nr_dev]) == 2);
769 __setup("snd-wavefront=", alsa_card_wavefront_setup);
771 #endif /* ifndef MODULE */