aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-10-17 12:20:26 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-10-17 12:20:26 -0400
commit651dab4264e4ba0e563f5ff56f748127246e9065 (patch)
tree016630974bdcb00fe529b673f96d389e0fd6dc94 /sound/isa/wavefront
parent40b8606253552109815786e5d4b0de98782d31f5 (diff)
parent2e532d68a2b3e2aa6b19731501222069735c741c (diff)
Merge commit 'linus/master' into merge-linus
Conflicts: arch/x86/kvm/i8254.c
Diffstat (limited to 'sound/isa/wavefront')
-rw-r--r--sound/isa/wavefront/wavefront.c62
-rw-r--r--sound/isa/wavefront/wavefront_fx.c8
-rw-r--r--sound/isa/wavefront/wavefront_midi.c24
-rw-r--r--sound/isa/wavefront/wavefront_synth.c7
4 files changed, 56 insertions, 45 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
34MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>"); 35MODULE_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
363snd_wavefront_probe (struct snd_card *card, int dev) 364snd_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
603static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, 605static 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;
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 2efaa7f205aa..dfc449a2194e 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -180,11 +180,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
180 unsigned short *pd; 180 unsigned short *pd;
181 int err = 0; 181 int err = 0;
182 182
183 snd_assert(sdev->card != NULL, return -ENODEV);
184
185 card = sdev->card; 183 card = sdev->card;
186 184 if (snd_BUG_ON(!card))
187 snd_assert(card->private_data != NULL, return -ENODEV); 185 return -ENODEV;
186 if (snd_BUG_ON(!card->private_data))
187 return -ENODEV;
188 188
189 acard = card->private_data; 189 acard = card->private_data;
190 dev = &acard->wavefront; 190 dev = &acard->wavefront;
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c
index a33384a55b0f..f14a7c0b6998 100644
--- a/sound/isa/wavefront/wavefront_midi.c
+++ b/sound/isa/wavefront/wavefront_midi.c
@@ -235,8 +235,10 @@ static int snd_wavefront_midi_input_open(struct snd_rawmidi_substream *substream
235 snd_wavefront_midi_t *midi; 235 snd_wavefront_midi_t *midi;
236 snd_wavefront_mpu_id mpu; 236 snd_wavefront_mpu_id mpu;
237 237
238 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 238 if (snd_BUG_ON(!substream || !substream->rmidi))
239 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 239 return -ENXIO;
240 if (snd_BUG_ON(!substream->rmidi->private_data))
241 return -ENXIO;
240 242
241 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 243 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
242 244
@@ -257,8 +259,10 @@ static int snd_wavefront_midi_output_open(struct snd_rawmidi_substream *substrea
257 snd_wavefront_midi_t *midi; 259 snd_wavefront_midi_t *midi;
258 snd_wavefront_mpu_id mpu; 260 snd_wavefront_mpu_id mpu;
259 261
260 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 262 if (snd_BUG_ON(!substream || !substream->rmidi))
261 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 263 return -ENXIO;
264 if (snd_BUG_ON(!substream->rmidi->private_data))
265 return -ENXIO;
262 266
263 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 267 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
264 268
@@ -279,8 +283,10 @@ static int snd_wavefront_midi_input_close(struct snd_rawmidi_substream *substrea
279 snd_wavefront_midi_t *midi; 283 snd_wavefront_midi_t *midi;
280 snd_wavefront_mpu_id mpu; 284 snd_wavefront_mpu_id mpu;
281 285
282 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 286 if (snd_BUG_ON(!substream || !substream->rmidi))
283 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 287 return -ENXIO;
288 if (snd_BUG_ON(!substream->rmidi->private_data))
289 return -ENXIO;
284 290
285 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 291 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
286 292
@@ -300,8 +306,10 @@ static int snd_wavefront_midi_output_close(struct snd_rawmidi_substream *substre
300 snd_wavefront_midi_t *midi; 306 snd_wavefront_midi_t *midi;
301 snd_wavefront_mpu_id mpu; 307 snd_wavefront_mpu_id mpu;
302 308
303 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 309 if (snd_BUG_ON(!substream || !substream->rmidi))
304 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 310 return -ENXIO;
311 if (snd_BUG_ON(!substream->rmidi->private_data))
312 return -ENXIO;
305 313
306 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 314 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
307 315
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 0bb9b9256601..4c410820a994 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -1648,9 +1648,10 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file,
1648 1648
1649 card = (struct snd_card *) hw->card; 1649 card = (struct snd_card *) hw->card;
1650 1650
1651 snd_assert(card != NULL, return -ENODEV); 1651 if (snd_BUG_ON(!card))
1652 1652 return -ENODEV;
1653 snd_assert(card->private_data != NULL, return -ENODEV); 1653 if (snd_BUG_ON(!card->private_data))
1654 return -ENODEV;
1654 1655
1655 acard = card->private_data; 1656 acard = card->private_data;
1656 dev = &acard->wavefront; 1657 dev = &acard->wavefront;