diff options
Diffstat (limited to 'sound/pci/mixart')
-rw-r--r-- | sound/pci/mixart/mixart.c | 6 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_hwdep.c | 58 |
2 files changed, 29 insertions, 35 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index bb162507fe6c..c1eb84a14c42 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -1366,12 +1366,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci, | |||
1366 | else | 1366 | else |
1367 | idx = index[dev] + i; | 1367 | idx = index[dev] + i; |
1368 | snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i); | 1368 | snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i); |
1369 | card = snd_card_new(idx, tmpid, THIS_MODULE, 0); | 1369 | err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card); |
1370 | 1370 | ||
1371 | if (! card) { | 1371 | if (err < 0) { |
1372 | snd_printk(KERN_ERR "cannot allocate the card %d\n", i); | 1372 | snd_printk(KERN_ERR "cannot allocate the card %d\n", i); |
1373 | snd_mixart_free(mgr); | 1373 | snd_mixart_free(mgr); |
1374 | return -ENOMEM; | 1374 | return err; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | strcpy(card->driver, CARD_NAME); | 1377 | strcpy(card->driver, CARD_NAME); |
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index 3782b52bc0e8..4cf4cd8c939c 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c | |||
@@ -345,8 +345,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
345 | status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); | 345 | status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); |
346 | 346 | ||
347 | /* motherboard xilinx status 5 will say that the board is performing a reset */ | 347 | /* motherboard xilinx status 5 will say that the board is performing a reset */ |
348 | if( status_xilinx == 5 ) { | 348 | if (status_xilinx == 5) { |
349 | snd_printk( KERN_ERR "miXart is resetting !\n"); | 349 | snd_printk(KERN_ERR "miXart is resetting !\n"); |
350 | return -EAGAIN; /* try again later */ | 350 | return -EAGAIN; /* try again later */ |
351 | } | 351 | } |
352 | 352 | ||
@@ -354,13 +354,14 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
354 | case MIXART_MOTHERBOARD_XLX_INDEX: | 354 | case MIXART_MOTHERBOARD_XLX_INDEX: |
355 | 355 | ||
356 | /* xilinx already loaded ? */ | 356 | /* xilinx already loaded ? */ |
357 | if( status_xilinx == 4 ) { | 357 | if (status_xilinx == 4) { |
358 | snd_printk( KERN_DEBUG "xilinx is already loaded !\n"); | 358 | snd_printk(KERN_DEBUG "xilinx is already loaded !\n"); |
359 | return 0; | 359 | return 0; |
360 | } | 360 | } |
361 | /* the status should be 0 == "idle" */ | 361 | /* the status should be 0 == "idle" */ |
362 | if( status_xilinx != 0 ) { | 362 | if (status_xilinx != 0) { |
363 | snd_printk( KERN_ERR "xilinx load error ! status = %d\n", status_xilinx); | 363 | snd_printk(KERN_ERR "xilinx load error ! status = %d\n", |
364 | status_xilinx); | ||
364 | return -EIO; /* modprob -r may help ? */ | 365 | return -EIO; /* modprob -r may help ? */ |
365 | } | 366 | } |
366 | 367 | ||
@@ -389,21 +390,23 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
389 | 390 | ||
390 | case MIXART_MOTHERBOARD_ELF_INDEX: | 391 | case MIXART_MOTHERBOARD_ELF_INDEX: |
391 | 392 | ||
392 | if( status_elf == 4 ) { | 393 | if (status_elf == 4) { |
393 | snd_printk( KERN_DEBUG "elf file already loaded !\n"); | 394 | snd_printk(KERN_DEBUG "elf file already loaded !\n"); |
394 | return 0; | 395 | return 0; |
395 | } | 396 | } |
396 | 397 | ||
397 | /* the status should be 0 == "idle" */ | 398 | /* the status should be 0 == "idle" */ |
398 | if( status_elf != 0 ) { | 399 | if (status_elf != 0) { |
399 | snd_printk( KERN_ERR "elf load error ! status = %d\n", status_elf); | 400 | snd_printk(KERN_ERR "elf load error ! status = %d\n", |
401 | status_elf); | ||
400 | return -EIO; /* modprob -r may help ? */ | 402 | return -EIO; /* modprob -r may help ? */ |
401 | } | 403 | } |
402 | 404 | ||
403 | /* wait for xilinx status == 4 */ | 405 | /* wait for xilinx status == 4 */ |
404 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ | 406 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ |
405 | if (err < 0) { | 407 | if (err < 0) { |
406 | snd_printk( KERN_ERR "xilinx was not loaded or could not be started\n"); | 408 | snd_printk(KERN_ERR "xilinx was not loaded or " |
409 | "could not be started\n"); | ||
407 | return err; | 410 | return err; |
408 | } | 411 | } |
409 | 412 | ||
@@ -424,7 +427,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
424 | /* wait for elf status == 4 */ | 427 | /* wait for elf status == 4 */ |
425 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ | 428 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ |
426 | if (err < 0) { | 429 | if (err < 0) { |
427 | snd_printk( KERN_ERR "elf could not be started\n"); | 430 | snd_printk(KERN_ERR "elf could not be started\n"); |
428 | return err; | 431 | return err; |
429 | } | 432 | } |
430 | 433 | ||
@@ -437,15 +440,16 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
437 | default: | 440 | default: |
438 | 441 | ||
439 | /* elf and xilinx should be loaded */ | 442 | /* elf and xilinx should be loaded */ |
440 | if( (status_elf != 4) || (status_xilinx != 4) ) { | 443 | if (status_elf != 4 || status_xilinx != 4) { |
441 | printk( KERN_ERR "xilinx or elf not successfully loaded\n"); | 444 | printk(KERN_ERR "xilinx or elf not " |
445 | "successfully loaded\n"); | ||
442 | return -EIO; /* modprob -r may help ? */ | 446 | return -EIO; /* modprob -r may help ? */ |
443 | } | 447 | } |
444 | 448 | ||
445 | /* wait for daughter detection != 0 */ | 449 | /* wait for daughter detection != 0 */ |
446 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ | 450 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ |
447 | if (err < 0) { | 451 | if (err < 0) { |
448 | snd_printk( KERN_ERR "error starting elf file\n"); | 452 | snd_printk(KERN_ERR "error starting elf file\n"); |
449 | return err; | 453 | return err; |
450 | } | 454 | } |
451 | 455 | ||
@@ -460,8 +464,9 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
460 | return -EINVAL; | 464 | return -EINVAL; |
461 | 465 | ||
462 | /* daughter should be idle */ | 466 | /* daughter should be idle */ |
463 | if( status_daught != 0 ) { | 467 | if (status_daught != 0) { |
464 | printk( KERN_ERR "daughter load error ! status = %d\n", status_daught); | 468 | printk(KERN_ERR "daughter load error ! status = %d\n", |
469 | status_daught); | ||
465 | return -EIO; /* modprob -r may help ? */ | 470 | return -EIO; /* modprob -r may help ? */ |
466 | } | 471 | } |
467 | 472 | ||
@@ -480,7 +485,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
480 | /* wait for status == 2 */ | 485 | /* wait for status == 2 */ |
481 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ | 486 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ |
482 | if (err < 0) { | 487 | if (err < 0) { |
483 | snd_printk( KERN_ERR "daughter board load error\n"); | 488 | snd_printk(KERN_ERR "daughter board load error\n"); |
484 | return err; | 489 | return err; |
485 | } | 490 | } |
486 | 491 | ||
@@ -502,7 +507,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
502 | /* wait for daughter status == 3 */ | 507 | /* wait for daughter status == 3 */ |
503 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ | 508 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ |
504 | if (err < 0) { | 509 | if (err < 0) { |
505 | snd_printk( KERN_ERR "daughter board could not be initialised\n"); | 510 | snd_printk(KERN_ERR |
511 | "daughter board could not be initialised\n"); | ||
506 | return err; | 512 | return err; |
507 | } | 513 | } |
508 | 514 | ||
@@ -512,7 +518,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
512 | /* first communication with embedded */ | 518 | /* first communication with embedded */ |
513 | err = mixart_first_init(mgr); | 519 | err = mixart_first_init(mgr); |
514 | if (err < 0) { | 520 | if (err < 0) { |
515 | snd_printk( KERN_ERR "miXart could not be set up\n"); | 521 | snd_printk(KERN_ERR "miXart could not be set up\n"); |
516 | return err; | 522 | return err; |
517 | } | 523 | } |
518 | 524 | ||
@@ -581,16 +587,6 @@ MODULE_FIRMWARE("mixart/miXart8AES.xlx"); | |||
581 | /* miXart hwdep interface id string */ | 587 | /* miXart hwdep interface id string */ |
582 | #define SND_MIXART_HWDEP_ID "miXart Loader" | 588 | #define SND_MIXART_HWDEP_ID "miXart Loader" |
583 | 589 | ||
584 | static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file) | ||
585 | { | ||
586 | return 0; | ||
587 | } | ||
588 | |||
589 | static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file) | ||
590 | { | ||
591 | return 0; | ||
592 | } | ||
593 | |||
594 | static int mixart_hwdep_dsp_status(struct snd_hwdep *hw, | 590 | static int mixart_hwdep_dsp_status(struct snd_hwdep *hw, |
595 | struct snd_hwdep_dsp_status *info) | 591 | struct snd_hwdep_dsp_status *info) |
596 | { | 592 | { |
@@ -643,8 +639,6 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr) | |||
643 | 639 | ||
644 | hw->iface = SNDRV_HWDEP_IFACE_MIXART; | 640 | hw->iface = SNDRV_HWDEP_IFACE_MIXART; |
645 | hw->private_data = mgr; | 641 | hw->private_data = mgr; |
646 | hw->ops.open = mixart_hwdep_open; | ||
647 | hw->ops.release = mixart_hwdep_release; | ||
648 | hw->ops.dsp_status = mixart_hwdep_dsp_status; | 642 | hw->ops.dsp_status = mixart_hwdep_dsp_status; |
649 | hw->ops.dsp_load = mixart_hwdep_dsp_load; | 643 | hw->ops.dsp_load = mixart_hwdep_dsp_load; |
650 | hw->exclusive = 1; | 644 | hw->exclusive = 1; |