diff options
Diffstat (limited to 'sound/isa/wavefront/wavefront.c')
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 3a6c6fe1ec4d..4c095bc7c729 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ALSA card-level driver for Turtle Beach Wavefront cards | 2 | * ALSA card-level driver for Turtle Beach Wavefront cards |
3 | * (Maui,Tropez,Tropez+) | 3 | * (Maui,Tropez,Tropez+) |
4 | * | 4 | * |
5 | * Copyright (c) 1997-1999 by Paul Barton-Davis <pbd@op.net> | 5 | * Copyright (c) 1997-1999 by Paul Barton-Davis <pbd@op.net> |
6 | * | 6 | * |
@@ -29,6 +29,7 @@ | |||
29 | #include <sound/core.h> | 29 | #include <sound/core.h> |
30 | #include <sound/initval.h> | 30 | #include <sound/initval.h> |
31 | #include <sound/opl3.h> | 31 | #include <sound/opl3.h> |
32 | #include <sound/wss.h> | ||
32 | #include <sound/snd_wavefront.h> | 33 | #include <sound/snd_wavefront.h> |
33 | 34 | ||
34 | MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>"); | 35 | MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>"); |
@@ -319,8 +320,8 @@ snd_wavefront_new_midi (struct snd_card *card, | |||
319 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_wavefront_midi_input); | 320 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_wavefront_midi_input); |
320 | 321 | ||
321 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | | 322 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | |
322 | SNDRV_RAWMIDI_INFO_INPUT | | 323 | SNDRV_RAWMIDI_INFO_INPUT | |
323 | SNDRV_RAWMIDI_INFO_DUPLEX; | 324 | SNDRV_RAWMIDI_INFO_DUPLEX; |
324 | 325 | ||
325 | return rmidi; | 326 | return rmidi; |
326 | } | 327 | } |
@@ -363,7 +364,7 @@ static int __devinit | |||
363 | snd_wavefront_probe (struct snd_card *card, int dev) | 364 | snd_wavefront_probe (struct snd_card *card, int dev) |
364 | { | 365 | { |
365 | snd_wavefront_card_t *acard = card->private_data; | 366 | snd_wavefront_card_t *acard = card->private_data; |
366 | struct snd_cs4231 *chip; | 367 | struct snd_wss *chip; |
367 | struct snd_hwdep *wavefront_synth; | 368 | struct snd_hwdep *wavefront_synth; |
368 | struct snd_rawmidi *ics2115_internal_rmidi = NULL; | 369 | struct snd_rawmidi *ics2115_internal_rmidi = NULL; |
369 | struct snd_rawmidi *ics2115_external_rmidi = NULL; | 370 | struct snd_rawmidi *ics2115_external_rmidi = NULL; |
@@ -372,21 +373,20 @@ snd_wavefront_probe (struct snd_card *card, int dev) | |||
372 | 373 | ||
373 | /* --------- PCM --------------- */ | 374 | /* --------- PCM --------------- */ |
374 | 375 | ||
375 | if ((err = snd_cs4231_create (card, | 376 | err = snd_wss_create(card, cs4232_pcm_port[dev], -1, |
376 | cs4232_pcm_port[dev], | 377 | cs4232_pcm_irq[dev], dma1[dev], dma2[dev], |
377 | -1, | 378 | WSS_HW_DETECT, 0, &chip); |
378 | cs4232_pcm_irq[dev], | 379 | if (err < 0) { |
379 | dma1[dev], | 380 | snd_printk(KERN_ERR "can't allocate WSS device\n"); |
380 | dma2[dev], | ||
381 | CS4231_HW_DETECT, 0, &chip)) < 0) { | ||
382 | snd_printk (KERN_ERR "can't allocate CS4231 device\n"); | ||
383 | return err; | 381 | return err; |
384 | } | 382 | } |
385 | 383 | ||
386 | if ((err = snd_cs4231_pcm (chip, 0, NULL)) < 0) | 384 | err = snd_wss_pcm(chip, 0, NULL); |
385 | if (err < 0) | ||
387 | return err; | 386 | return err; |
388 | 387 | ||
389 | if ((err = snd_cs4231_timer (chip, 0, NULL)) < 0) | 388 | err = snd_wss_timer(chip, 0, NULL); |
389 | if (err < 0) | ||
390 | return err; | 390 | return err; |
391 | 391 | ||
392 | /* ---------- OPL3 synth --------- */ | 392 | /* ---------- OPL3 synth --------- */ |
@@ -394,24 +394,24 @@ snd_wavefront_probe (struct snd_card *card, int dev) | |||
394 | if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) { | 394 | if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) { |
395 | struct snd_opl3 *opl3; | 395 | struct snd_opl3 *opl3; |
396 | 396 | ||
397 | if ((err = snd_opl3_create(card, | 397 | err = snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2, |
398 | fm_port[dev], | 398 | OPL3_HW_OPL3_CS, 0, &opl3); |
399 | fm_port[dev] + 2, | 399 | if (err < 0) { |
400 | OPL3_HW_OPL3_CS, | ||
401 | 0, &opl3)) < 0) { | ||
402 | snd_printk (KERN_ERR "can't allocate or detect OPL3 synth\n"); | 400 | snd_printk (KERN_ERR "can't allocate or detect OPL3 synth\n"); |
403 | return err; | 401 | return err; |
404 | } | 402 | } |
405 | 403 | ||
406 | if ((err = snd_opl3_hwdep_new(opl3, hw_dev, 1, NULL)) < 0) | 404 | err = snd_opl3_hwdep_new(opl3, hw_dev, 1, NULL); |
405 | if (err < 0) | ||
407 | return err; | 406 | return err; |
408 | hw_dev++; | 407 | hw_dev++; |
409 | } | 408 | } |
410 | 409 | ||
411 | /* ------- ICS2115 Wavetable synth ------- */ | 410 | /* ------- ICS2115 Wavetable synth ------- */ |
412 | 411 | ||
413 | if ((acard->wavefront.res_base = request_region(ics2115_port[dev], 16, | 412 | acard->wavefront.res_base = request_region(ics2115_port[dev], 16, |
414 | "ICS2115")) == NULL) { | 413 | "ICS2115"); |
414 | if (acard->wavefront.res_base == NULL) { | ||
415 | snd_printk(KERN_ERR "unable to grab ICS2115 i/o region 0x%lx-0x%lx\n", | 415 | snd_printk(KERN_ERR "unable to grab ICS2115 i/o region 0x%lx-0x%lx\n", |
416 | ics2115_port[dev], ics2115_port[dev] + 16 - 1); | 416 | ics2115_port[dev], ics2115_port[dev] + 16 - 1); |
417 | return -EBUSY; | 417 | return -EBUSY; |
@@ -425,7 +425,8 @@ snd_wavefront_probe (struct snd_card *card, int dev) | |||
425 | acard->wavefront.irq = ics2115_irq[dev]; | 425 | acard->wavefront.irq = ics2115_irq[dev]; |
426 | acard->wavefront.base = ics2115_port[dev]; | 426 | acard->wavefront.base = ics2115_port[dev]; |
427 | 427 | ||
428 | if ((wavefront_synth = snd_wavefront_new_synth (card, hw_dev, acard)) == NULL) { | 428 | wavefront_synth = snd_wavefront_new_synth(card, hw_dev, acard); |
429 | if (wavefront_synth == NULL) { | ||
429 | snd_printk (KERN_ERR "can't create WaveFront synth device\n"); | 430 | snd_printk (KERN_ERR "can't create WaveFront synth device\n"); |
430 | return -ENOMEM; | 431 | return -ENOMEM; |
431 | } | 432 | } |
@@ -436,7 +437,8 @@ snd_wavefront_probe (struct snd_card *card, int dev) | |||
436 | 437 | ||
437 | /* --------- Mixer ------------ */ | 438 | /* --------- Mixer ------------ */ |
438 | 439 | ||
439 | if ((err = snd_cs4231_mixer(chip)) < 0) { | 440 | err = snd_wss_mixer(chip); |
441 | if (err < 0) { | ||
440 | snd_printk (KERN_ERR "can't allocate mixer device\n"); | 442 | snd_printk (KERN_ERR "can't allocate mixer device\n"); |
441 | return err; | 443 | return err; |
442 | } | 444 | } |
@@ -444,11 +446,11 @@ snd_wavefront_probe (struct snd_card *card, int dev) | |||
444 | /* -------- CS4232 MPU-401 interface -------- */ | 446 | /* -------- CS4232 MPU-401 interface -------- */ |
445 | 447 | ||
446 | if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) { | 448 | if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) { |
447 | if ((err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232, | 449 | err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232, |
448 | cs4232_mpu_port[dev], 0, | 450 | cs4232_mpu_port[dev], 0, |
449 | cs4232_mpu_irq[dev], | 451 | cs4232_mpu_irq[dev], IRQF_DISABLED, |
450 | IRQF_DISABLED, | 452 | NULL); |
451 | NULL)) < 0) { | 453 | if (err < 0) { |
452 | snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n"); | 454 | snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n"); |
453 | return err; | 455 | return err; |
454 | } | 456 | } |
@@ -601,7 +603,7 @@ static struct isa_driver snd_wavefront_driver = { | |||
601 | 603 | ||
602 | #ifdef CONFIG_PNP | 604 | #ifdef CONFIG_PNP |
603 | static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, | 605 | static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, |
604 | const struct pnp_card_device_id *pid) | 606 | const struct pnp_card_device_id *pid) |
605 | { | 607 | { |
606 | static int dev; | 608 | static int dev; |
607 | struct snd_card *card; | 609 | struct snd_card *card; |