aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:50 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:50 -0400
commite0d2054fd3cf167395390dc1758644486c782707 (patch)
tree108fd3138f0246f5fa17454680d6d04a670ed6d8 /sound/pci/mixart
parentd807500a2472445d05ce641bf09438e3d72eeb4f (diff)
parentc468ac29e63b9927275a94379d00b367f0f97c43 (diff)
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/pci/mixart')
-rw-r--r--sound/pci/mixart/mixart_hwdep.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index fa4de985fc4c..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