aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/pcxhr/pcxhr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/pcxhr/pcxhr.c')
-rw-r--r--sound/pci/pcxhr/pcxhr.c54
1 files changed, 28 insertions, 26 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 3880f6da9a87..8d09444ff88b 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -284,7 +284,7 @@ static int pcxhr_get_clock_reg(struct pcxhr_mgr *mgr, unsigned int rate,
284 rmh.cmd_len = 3; 284 rmh.cmd_len = 3;
285 err = pcxhr_send_msg(mgr, &rmh); 285 err = pcxhr_send_msg(mgr, &rmh);
286 if (err < 0) { 286 if (err < 0) {
287 snd_printk(KERN_ERR 287 dev_err(&mgr->pci->dev,
288 "error CMD_ACCESS_IO_WRITE " 288 "error CMD_ACCESS_IO_WRITE "
289 "for PLL register : %x!\n", err); 289 "for PLL register : %x!\n", err);
290 return err; 290 return err;
@@ -357,7 +357,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
357 return err; 357 return err;
358 } 358 }
359 /* set the new frequency */ 359 /* set the new frequency */
360 snd_printdd("clock register : set %x\n", val); 360 dev_dbg(&mgr->pci->dev, "clock register : set %x\n", val);
361 err = pcxhr_write_io_num_reg_cont(mgr, PCXHR_FREQ_REG_MASK, 361 err = pcxhr_write_io_num_reg_cont(mgr, PCXHR_FREQ_REG_MASK,
362 val, changed); 362 val, changed);
363 if (err) 363 if (err)
@@ -380,7 +380,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
380 mgr->codec_speed = speed; /* save new codec speed */ 380 mgr->codec_speed = speed; /* save new codec speed */
381 } 381 }
382 382
383 snd_printdd("pcxhr_sub_set_clock to %dHz (realfreq=%d)\n", 383 dev_dbg(&mgr->pci->dev, "pcxhr_sub_set_clock to %dHz (realfreq=%d)\n",
384 rate, realfreq); 384 rate, realfreq);
385 return 0; 385 return 0;
386} 386}
@@ -480,7 +480,7 @@ static int pcxhr_sub_get_external_clock(struct pcxhr_mgr *mgr,
480 case REG_STATUS_SYNC_192000 : rate = 192000; break; 480 case REG_STATUS_SYNC_192000 : rate = 192000; break;
481 default: rate = 0; 481 default: rate = 0;
482 } 482 }
483 snd_printdd("External clock is at %d Hz\n", rate); 483 dev_dbg(&mgr->pci->dev, "External clock is at %d Hz\n", rate);
484 *sample_rate = rate; 484 *sample_rate = rate;
485 return 0; 485 return 0;
486} 486}
@@ -537,8 +537,8 @@ static int pcxhr_set_stream_state(struct pcxhr_stream *stream)
537 537
538 err = pcxhr_send_msg(chip->mgr, &rmh); 538 err = pcxhr_send_msg(chip->mgr, &rmh);
539 if (err) 539 if (err)
540 snd_printk(KERN_ERR "ERROR pcxhr_set_stream_state err=%x;\n", 540 dev_err(chip->card->dev,
541 err); 541 "ERROR pcxhr_set_stream_state err=%x;\n", err);
542 stream->status = 542 stream->status =
543 start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED; 543 start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED;
544 return err; 544 return err;
@@ -628,7 +628,8 @@ static int pcxhr_set_format(struct pcxhr_stream *stream)
628 rmh.cmd[rmh.cmd_len++] = (header & 0xff) << 16; 628 rmh.cmd[rmh.cmd_len++] = (header & 0xff) << 16;
629 err = pcxhr_send_msg(chip->mgr, &rmh); 629 err = pcxhr_send_msg(chip->mgr, &rmh);
630 if (err) 630 if (err)
631 snd_printk(KERN_ERR "ERROR pcxhr_set_format err=%x;\n", err); 631 dev_err(chip->card->dev,
632 "ERROR pcxhr_set_format err=%x;\n", err);
632 return err; 633 return err;
633} 634}
634 635
@@ -665,7 +666,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream)
665 rmh.cmd_len = 4; 666 rmh.cmd_len = 4;
666 err = pcxhr_send_msg(chip->mgr, &rmh); 667 err = pcxhr_send_msg(chip->mgr, &rmh);
667 if (err) 668 if (err)
668 snd_printk(KERN_ERR 669 dev_err(chip->card->dev,
669 "ERROR CMD_UPDATE_R_BUFFERS err=%x;\n", err); 670 "ERROR CMD_UPDATE_R_BUFFERS err=%x;\n", err);
670 return err; 671 return err;
671} 672}
@@ -735,11 +736,11 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
735 } 736 }
736 if (capture_mask == 0 && playback_mask == 0) { 737 if (capture_mask == 0 && playback_mask == 0) {
737 mutex_unlock(&mgr->setup_mutex); 738 mutex_unlock(&mgr->setup_mutex);
738 snd_printk(KERN_ERR "pcxhr_trigger_tasklet : no pipes\n"); 739 dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : no pipes\n");
739 return; 740 return;
740 } 741 }
741 742
742 snd_printdd("pcxhr_trigger_tasklet : " 743 dev_dbg(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
743 "playback_mask=%x capture_mask=%x\n", 744 "playback_mask=%x capture_mask=%x\n",
744 playback_mask, capture_mask); 745 playback_mask, capture_mask);
745 746
@@ -747,7 +748,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
747 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0); 748 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
748 if (err) { 749 if (err) {
749 mutex_unlock(&mgr->setup_mutex); 750 mutex_unlock(&mgr->setup_mutex);
750 snd_printk(KERN_ERR "pcxhr_trigger_tasklet : " 751 dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
751 "error stop pipes (P%x C%x)\n", 752 "error stop pipes (P%x C%x)\n",
752 playback_mask, capture_mask); 753 playback_mask, capture_mask);
753 return; 754 return;
@@ -792,7 +793,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
792 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1); 793 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
793 if (err) { 794 if (err) {
794 mutex_unlock(&mgr->setup_mutex); 795 mutex_unlock(&mgr->setup_mutex);
795 snd_printk(KERN_ERR "pcxhr_trigger_tasklet : " 796 dev_err(&mgr->pci->dev, "pcxhr_trigger_tasklet : "
796 "error start pipes (P%x C%x)\n", 797 "error start pipes (P%x C%x)\n",
797 playback_mask, capture_mask); 798 playback_mask, capture_mask);
798 return; 799 return;
@@ -825,7 +826,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
825 826
826#ifdef CONFIG_SND_DEBUG_VERBOSE 827#ifdef CONFIG_SND_DEBUG_VERBOSE
827 do_gettimeofday(&my_tv2); 828 do_gettimeofday(&my_tv2);
828 snd_printdd("***TRIGGER TASKLET*** TIME = %ld (err = %x)\n", 829 dev_dbg(&mgr->pci->dev, "***TRIGGER TASKLET*** TIME = %ld (err = %x)\n",
829 (long)(my_tv2.tv_usec - my_tv1.tv_usec), err); 830 (long)(my_tv2.tv_usec - my_tv1.tv_usec), err);
830#endif 831#endif
831} 832}
@@ -902,7 +903,7 @@ static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start)
902 } 903 }
903 err = pcxhr_send_msg(mgr, &rmh); 904 err = pcxhr_send_msg(mgr, &rmh);
904 if (err < 0) 905 if (err < 0)
905 snd_printk(KERN_ERR "error pcxhr_hardware_timer err(%x)\n", 906 dev_err(&mgr->pci->dev, "error pcxhr_hardware_timer err(%x)\n",
906 err); 907 err);
907 return err; 908 return err;
908} 909}
@@ -916,7 +917,8 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
916 struct pcxhr_mgr *mgr = chip->mgr; 917 struct pcxhr_mgr *mgr = chip->mgr;
917 int err = 0; 918 int err = 0;
918 919
919 snd_printdd("pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n", 920 dev_dbg(chip->card->dev,
921 "pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n",
920 subs->runtime->period_size, subs->runtime->periods, 922 subs->runtime->period_size, subs->runtime->periods,
921 subs->runtime->buffer_size); 923 subs->runtime->buffer_size);
922 924
@@ -1025,11 +1027,11 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
1025 runtime->hw = pcxhr_caps; 1027 runtime->hw = pcxhr_caps;
1026 1028
1027 if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { 1029 if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
1028 snd_printdd("pcxhr_open playback chip%d subs%d\n", 1030 dev_dbg(chip->card->dev, "pcxhr_open playback chip%d subs%d\n",
1029 chip->chip_idx, subs->number); 1031 chip->chip_idx, subs->number);
1030 stream = &chip->playback_stream[subs->number]; 1032 stream = &chip->playback_stream[subs->number];
1031 } else { 1033 } else {
1032 snd_printdd("pcxhr_open capture chip%d subs%d\n", 1034 dev_dbg(chip->card->dev, "pcxhr_open capture chip%d subs%d\n",
1033 chip->chip_idx, subs->number); 1035 chip->chip_idx, subs->number);
1034 if (mgr->mono_capture) 1036 if (mgr->mono_capture)
1035 runtime->hw.channels_max = 1; 1037 runtime->hw.channels_max = 1;
@@ -1039,7 +1041,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
1039 } 1041 }
1040 if (stream->status != PCXHR_STREAM_STATUS_FREE){ 1042 if (stream->status != PCXHR_STREAM_STATUS_FREE){
1041 /* streams in use */ 1043 /* streams in use */
1042 snd_printk(KERN_ERR "pcxhr_open chip%d subs%d in use\n", 1044 dev_err(chip->card->dev, "pcxhr_open chip%d subs%d in use\n",
1043 chip->chip_idx, subs->number); 1045 chip->chip_idx, subs->number);
1044 mutex_unlock(&mgr->setup_mutex); 1046 mutex_unlock(&mgr->setup_mutex);
1045 return -EBUSY; 1047 return -EBUSY;
@@ -1105,7 +1107,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs)
1105 1107
1106 mutex_lock(&mgr->setup_mutex); 1108 mutex_lock(&mgr->setup_mutex);
1107 1109
1108 snd_printdd("pcxhr_close chip%d subs%d\n", 1110 dev_dbg(chip->card->dev, "pcxhr_close chip%d subs%d\n",
1109 chip->chip_idx, subs->number); 1111 chip->chip_idx, subs->number);
1110 1112
1111 /* sample rate released */ 1113 /* sample rate released */
@@ -1168,7 +1170,7 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip)
1168 if ((err = snd_pcm_new(chip->card, name, 0, 1170 if ((err = snd_pcm_new(chip->card, name, 0,
1169 chip->nb_streams_play, 1171 chip->nb_streams_play,
1170 chip->nb_streams_capt, &pcm)) < 0) { 1172 chip->nb_streams_capt, &pcm)) < 0) {
1171 snd_printk(KERN_ERR "cannot create pcm %s\n", name); 1173 dev_err(chip->card->dev, "cannot create pcm %s\n", name);
1172 return err; 1174 return err;
1173 } 1175 }
1174 pcm->private_data = chip; 1176 pcm->private_data = chip;
@@ -1214,7 +1216,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr,
1214 1216
1215 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1217 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
1216 if (! chip) { 1218 if (! chip) {
1217 snd_printk(KERN_ERR "cannot allocate chip\n"); 1219 dev_err(card->dev, "cannot allocate chip\n");
1218 return -ENOMEM; 1220 return -ENOMEM;
1219 } 1221 }
1220 1222
@@ -1487,7 +1489,7 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
1487 /* reset board if some firmware was loaded */ 1489 /* reset board if some firmware was loaded */
1488 if(mgr->dsp_loaded) { 1490 if(mgr->dsp_loaded) {
1489 pcxhr_reset_board(mgr); 1491 pcxhr_reset_board(mgr);
1490 snd_printdd("reset pcxhr !\n"); 1492 dev_dbg(&mgr->pci->dev, "reset pcxhr !\n");
1491 } 1493 }
1492 1494
1493 /* release irq */ 1495 /* release irq */
@@ -1536,8 +1538,8 @@ static int pcxhr_probe(struct pci_dev *pci,
1536 1538
1537 /* check if we can restrict PCI DMA transfers to 32 bits */ 1539 /* check if we can restrict PCI DMA transfers to 32 bits */
1538 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { 1540 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
1539 snd_printk(KERN_ERR "architecture does not support " 1541 dev_err(&pci->dev,
1540 "32bit PCI busmaster DMA\n"); 1542 "architecture does not support 32bit PCI busmaster DMA\n");
1541 pci_disable_device(pci); 1543 pci_disable_device(pci);
1542 return -ENXIO; 1544 return -ENXIO;
1543 } 1545 }
@@ -1588,7 +1590,7 @@ static int pcxhr_probe(struct pci_dev *pci,
1588 1590
1589 if (request_irq(pci->irq, pcxhr_interrupt, IRQF_SHARED, 1591 if (request_irq(pci->irq, pcxhr_interrupt, IRQF_SHARED,
1590 KBUILD_MODNAME, mgr)) { 1592 KBUILD_MODNAME, mgr)) {
1591 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 1593 dev_err(&pci->dev, "unable to grab IRQ %d\n", pci->irq);
1592 pcxhr_free(mgr); 1594 pcxhr_free(mgr);
1593 return -EBUSY; 1595 return -EBUSY;
1594 } 1596 }
@@ -1641,7 +1643,7 @@ static int pcxhr_probe(struct pci_dev *pci,
1641 0, &card); 1643 0, &card);
1642 1644
1643 if (err < 0) { 1645 if (err < 0) {
1644 snd_printk(KERN_ERR "cannot allocate the card %d\n", i); 1646 dev_err(card->dev, "cannot allocate the card %d\n", i);
1645 pcxhr_free(mgr); 1647 pcxhr_free(mgr);
1646 return err; 1648 return err;
1647 } 1649 }