diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-25 11:51:46 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-26 10:45:29 -0500 |
commit | 6414e35deb59117ee0883c5acca7670a2a24ca98 (patch) | |
tree | f6d343ae64857a6348aac4d841a4af409d776ae2 /sound/pci/mixart | |
parent | be4e6d3c0fa03d3978234feb6a2eefd95b93fa87 (diff) |
ALSA: mixart: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/mixart')
-rw-r--r-- | sound/pci/mixart/mixart.c | 118 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_core.c | 49 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_hwdep.c | 65 | ||||
-rw-r--r-- | sound/pci/mixart/mixart_mixer.c | 16 |
4 files changed, 163 insertions, 85 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 9ab057bb9859..a93e7af51eed 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -87,7 +87,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr, | |||
87 | if(!start) return 0; /* already stopped */ | 87 | if(!start) return 0; /* already stopped */ |
88 | break; | 88 | break; |
89 | default: | 89 | default: |
90 | snd_printk(KERN_ERR "error mixart_set_pipe_state called with wrong pipe->status!\n"); | 90 | dev_err(&mgr->pci->dev, |
91 | "error mixart_set_pipe_state called with wrong pipe->status!\n"); | ||
91 | return -EINVAL; /* function called with wrong pipe status */ | 92 | return -EINVAL; /* function called with wrong pipe status */ |
92 | } | 93 | } |
93 | 94 | ||
@@ -102,7 +103,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr, | |||
102 | 103 | ||
103 | err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid); | 104 | err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid); |
104 | if(err) { | 105 | if(err) { |
105 | snd_printk(KERN_ERR "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n"); | 106 | dev_err(&mgr->pci->dev, |
107 | "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n"); | ||
106 | return err; | 108 | return err; |
107 | } | 109 | } |
108 | 110 | ||
@@ -123,7 +125,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr, | |||
123 | 125 | ||
124 | err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); | 126 | err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); |
125 | if (err < 0 || group_state_resp.txx_status != 0) { | 127 | if (err < 0 || group_state_resp.txx_status != 0) { |
126 | snd_printk(KERN_ERR "error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status); | 128 | dev_err(&mgr->pci->dev, |
129 | "error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n", | ||
130 | err, group_state_resp.txx_status); | ||
127 | return -EINVAL; | 131 | return -EINVAL; |
128 | } | 132 | } |
129 | 133 | ||
@@ -134,7 +138,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr, | |||
134 | 138 | ||
135 | err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); | 139 | err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); |
136 | if (err < 0 || group_state_resp.txx_status != 0) { | 140 | if (err < 0 || group_state_resp.txx_status != 0) { |
137 | snd_printk(KERN_ERR "error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status); | 141 | dev_err(&mgr->pci->dev, |
142 | "error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n", | ||
143 | err, group_state_resp.txx_status); | ||
138 | return -EINVAL; | 144 | return -EINVAL; |
139 | } | 145 | } |
140 | 146 | ||
@@ -147,7 +153,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr, | |||
147 | 153 | ||
148 | err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat); | 154 | err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat); |
149 | if (err < 0 || stat != 0) { | 155 | if (err < 0 || stat != 0) { |
150 | snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n", err, stat); | 156 | dev_err(&mgr->pci->dev, |
157 | "error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n", | ||
158 | err, stat); | ||
151 | return -EINVAL; | 159 | return -EINVAL; |
152 | } | 160 | } |
153 | 161 | ||
@@ -178,7 +186,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr, | |||
178 | if(rate == 0) | 186 | if(rate == 0) |
179 | return 0; /* nothing to do */ | 187 | return 0; /* nothing to do */ |
180 | else { | 188 | else { |
181 | snd_printk(KERN_ERR "error mixart_set_clock(%d) called with wrong pipe->status !\n", rate); | 189 | dev_err(&mgr->pci->dev, |
190 | "error mixart_set_clock(%d) called with wrong pipe->status !\n", | ||
191 | rate); | ||
182 | return -EINVAL; | 192 | return -EINVAL; |
183 | } | 193 | } |
184 | } | 194 | } |
@@ -190,7 +200,7 @@ static int mixart_set_clock(struct mixart_mgr *mgr, | |||
190 | clock_properties.nb_callers = 1; /* only one entry in uid_caller ! */ | 200 | clock_properties.nb_callers = 1; /* only one entry in uid_caller ! */ |
191 | clock_properties.uid_caller[0] = pipe->group_uid; | 201 | clock_properties.uid_caller[0] = pipe->group_uid; |
192 | 202 | ||
193 | snd_printdd("mixart_set_clock to %d kHz\n", rate); | 203 | dev_dbg(&mgr->pci->dev, "mixart_set_clock to %d kHz\n", rate); |
194 | 204 | ||
195 | request.message_id = MSG_CLOCK_SET_PROPERTIES; | 205 | request.message_id = MSG_CLOCK_SET_PROPERTIES; |
196 | request.uid = mgr->uid_console_manager; | 206 | request.uid = mgr->uid_console_manager; |
@@ -199,7 +209,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr, | |||
199 | 209 | ||
200 | err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp); | 210 | err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp); |
201 | if (err < 0 || clock_prop_resp.status != 0 || clock_prop_resp.clock_mode != CM_STANDALONE) { | 211 | if (err < 0 || clock_prop_resp.status != 0 || clock_prop_resp.clock_mode != CM_STANDALONE) { |
202 | snd_printk(KERN_ERR "error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n", err, clock_prop_resp.status, clock_prop_resp.clock_mode); | 212 | dev_err(&mgr->pci->dev, |
213 | "error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n", | ||
214 | err, clock_prop_resp.status, clock_prop_resp.clock_mode); | ||
203 | return -EINVAL; | 215 | return -EINVAL; |
204 | } | 216 | } |
205 | 217 | ||
@@ -252,7 +264,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, | |||
252 | struct mixart_streaming_group sgroup_resp; | 264 | struct mixart_streaming_group sgroup_resp; |
253 | } *buf; | 265 | } *buf; |
254 | 266 | ||
255 | snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); | 267 | dev_dbg(chip->card->dev, |
268 | "add_ref_pipe audio chip(%d) pcm(%d)\n", | ||
269 | chip->chip_idx, pcm_number); | ||
256 | 270 | ||
257 | buf = kmalloc(sizeof(*buf), GFP_KERNEL); | 271 | buf = kmalloc(sizeof(*buf), GFP_KERNEL); |
258 | if (!buf) | 272 | if (!buf) |
@@ -302,7 +316,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, | |||
302 | 316 | ||
303 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp); | 317 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp); |
304 | if((err < 0) || (buf->sgroup_resp.status != 0)) { | 318 | if((err < 0) || (buf->sgroup_resp.status != 0)) { |
305 | snd_printk(KERN_ERR "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", err, buf->sgroup_resp.status); | 319 | dev_err(chip->card->dev, |
320 | "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", | ||
321 | err, buf->sgroup_resp.status); | ||
306 | kfree(buf); | 322 | kfree(buf); |
307 | return NULL; | 323 | return NULL; |
308 | } | 324 | } |
@@ -343,13 +359,14 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, | |||
343 | /* release the clock */ | 359 | /* release the clock */ |
344 | err = mixart_set_clock( mgr, pipe, 0); | 360 | err = mixart_set_clock( mgr, pipe, 0); |
345 | if( err < 0 ) { | 361 | if( err < 0 ) { |
346 | snd_printk(KERN_ERR "mixart_set_clock(0) return error!\n"); | 362 | dev_err(&mgr->pci->dev, |
363 | "mixart_set_clock(0) return error!\n"); | ||
347 | } | 364 | } |
348 | 365 | ||
349 | /* stop the pipe */ | 366 | /* stop the pipe */ |
350 | err = mixart_set_pipe_state(mgr, pipe, 0); | 367 | err = mixart_set_pipe_state(mgr, pipe, 0); |
351 | if( err < 0 ) { | 368 | if( err < 0 ) { |
352 | snd_printk(KERN_ERR "error stopping pipe!\n"); | 369 | dev_err(&mgr->pci->dev, "error stopping pipe!\n"); |
353 | } | 370 | } |
354 | 371 | ||
355 | request.message_id = MSG_STREAM_DELETE_GROUP; | 372 | request.message_id = MSG_STREAM_DELETE_GROUP; |
@@ -360,7 +377,9 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, | |||
360 | /* delete the pipe */ | 377 | /* delete the pipe */ |
361 | err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp); | 378 | err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp); |
362 | if ((err < 0) || (delete_resp.status != 0)) { | 379 | if ((err < 0) || (delete_resp.status != 0)) { |
363 | snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status); | 380 | dev_err(&mgr->pci->dev, |
381 | "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", | ||
382 | err, delete_resp.status); | ||
364 | } | 383 | } |
365 | 384 | ||
366 | pipe->group_uid = (struct mixart_uid){0,0}; | 385 | pipe->group_uid = (struct mixart_uid){0,0}; |
@@ -414,7 +433,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd) | |||
414 | switch (cmd) { | 433 | switch (cmd) { |
415 | case SNDRV_PCM_TRIGGER_START: | 434 | case SNDRV_PCM_TRIGGER_START: |
416 | 435 | ||
417 | snd_printdd("SNDRV_PCM_TRIGGER_START\n"); | 436 | dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_START\n"); |
418 | 437 | ||
419 | /* START_STREAM */ | 438 | /* START_STREAM */ |
420 | if( mixart_set_stream_state(stream, 1) ) | 439 | if( mixart_set_stream_state(stream, 1) ) |
@@ -431,19 +450,19 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd) | |||
431 | 450 | ||
432 | stream->status = MIXART_STREAM_STATUS_OPEN; | 451 | stream->status = MIXART_STREAM_STATUS_OPEN; |
433 | 452 | ||
434 | snd_printdd("SNDRV_PCM_TRIGGER_STOP\n"); | 453 | dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_STOP\n"); |
435 | 454 | ||
436 | break; | 455 | break; |
437 | 456 | ||
438 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 457 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
439 | /* TODO */ | 458 | /* TODO */ |
440 | stream->status = MIXART_STREAM_STATUS_PAUSE; | 459 | stream->status = MIXART_STREAM_STATUS_PAUSE; |
441 | snd_printdd("SNDRV_PCM_PAUSE_PUSH\n"); | 460 | dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_PUSH\n"); |
442 | break; | 461 | break; |
443 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 462 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
444 | /* TODO */ | 463 | /* TODO */ |
445 | stream->status = MIXART_STREAM_STATUS_RUNNING; | 464 | stream->status = MIXART_STREAM_STATUS_RUNNING; |
446 | snd_printdd("SNDRV_PCM_PAUSE_RELEASE\n"); | 465 | dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_RELEASE\n"); |
447 | break; | 466 | break; |
448 | default: | 467 | default: |
449 | return -EINVAL; | 468 | return -EINVAL; |
@@ -456,7 +475,8 @@ static int mixart_sync_nonblock_events(struct mixart_mgr *mgr) | |||
456 | unsigned long timeout = jiffies + HZ; | 475 | unsigned long timeout = jiffies + HZ; |
457 | while (atomic_read(&mgr->msg_processed) > 0) { | 476 | while (atomic_read(&mgr->msg_processed) > 0) { |
458 | if (time_after(jiffies, timeout)) { | 477 | if (time_after(jiffies, timeout)) { |
459 | snd_printk(KERN_ERR "mixart: cannot process nonblock events!\n"); | 478 | dev_err(&mgr->pci->dev, |
479 | "mixart: cannot process nonblock events!\n"); | ||
460 | return -EBUSY; | 480 | return -EBUSY; |
461 | } | 481 | } |
462 | schedule_timeout_uninterruptible(1); | 482 | schedule_timeout_uninterruptible(1); |
@@ -474,7 +494,7 @@ static int snd_mixart_prepare(struct snd_pcm_substream *subs) | |||
474 | 494 | ||
475 | /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */ | 495 | /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */ |
476 | 496 | ||
477 | snd_printdd("snd_mixart_prepare\n"); | 497 | dev_dbg(chip->card->dev, "snd_mixart_prepare\n"); |
478 | 498 | ||
479 | mixart_sync_nonblock_events(chip->mgr); | 499 | mixart_sync_nonblock_events(chip->mgr); |
480 | 500 | ||
@@ -542,11 +562,13 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form | |||
542 | stream_param.sample_size = 32; | 562 | stream_param.sample_size = 32; |
543 | break; | 563 | break; |
544 | default: | 564 | default: |
545 | snd_printk(KERN_ERR "error mixart_set_format() : unknown format\n"); | 565 | dev_err(chip->card->dev, |
566 | "error mixart_set_format() : unknown format\n"); | ||
546 | return -EINVAL; | 567 | return -EINVAL; |
547 | } | 568 | } |
548 | 569 | ||
549 | snd_printdd("set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n", | 570 | dev_dbg(chip->card->dev, |
571 | "set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n", | ||
550 | stream_param.sample_type, stream_param.sample_size, stream_param.sampling_freq, stream->channels); | 572 | stream_param.sample_type, stream_param.sample_size, stream_param.sampling_freq, stream->channels); |
551 | 573 | ||
552 | /* TODO: what else to configure ? */ | 574 | /* TODO: what else to configure ? */ |
@@ -566,7 +588,9 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form | |||
566 | 588 | ||
567 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); | 589 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); |
568 | if((err < 0) || resp.error_code) { | 590 | if((err < 0) || resp.error_code) { |
569 | snd_printk(KERN_ERR "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", err, resp.error_code); | 591 | dev_err(chip->card->dev, |
592 | "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", | ||
593 | err, resp.error_code); | ||
570 | return -EINVAL; | 594 | return -EINVAL; |
571 | } | 595 | } |
572 | return 0; | 596 | return 0; |
@@ -627,8 +651,9 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs, | |||
627 | bufferinfo[i].available_length = subs->runtime->dma_bytes; | 651 | bufferinfo[i].available_length = subs->runtime->dma_bytes; |
628 | /* bufferinfo[i].buffer_id is already defined */ | 652 | /* bufferinfo[i].buffer_id is already defined */ |
629 | 653 | ||
630 | snd_printdd("snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n", i, | 654 | dev_dbg(chip->card->dev, |
631 | bufferinfo[i].buffer_address, | 655 | "snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n", |
656 | i, bufferinfo[i].buffer_address, | ||
632 | bufferinfo[i].available_length, | 657 | bufferinfo[i].available_length, |
633 | subs->number); | 658 | subs->number); |
634 | } | 659 | } |
@@ -714,14 +739,18 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs) | |||
714 | pcm_number = MIXART_PCM_DIGITAL; | 739 | pcm_number = MIXART_PCM_DIGITAL; |
715 | runtime->hw = snd_mixart_digital_caps; | 740 | runtime->hw = snd_mixart_digital_caps; |
716 | } | 741 | } |
717 | snd_printdd("snd_mixart_playback_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number); | 742 | dev_dbg(chip->card->dev, |
743 | "snd_mixart_playback_open C%d/P%d/Sub%d\n", | ||
744 | chip->chip_idx, pcm_number, subs->number); | ||
718 | 745 | ||
719 | /* get stream info */ | 746 | /* get stream info */ |
720 | stream = &(chip->playback_stream[pcm_number][subs->number]); | 747 | stream = &(chip->playback_stream[pcm_number][subs->number]); |
721 | 748 | ||
722 | if (stream->status != MIXART_STREAM_STATUS_FREE){ | 749 | if (stream->status != MIXART_STREAM_STATUS_FREE){ |
723 | /* streams in use */ | 750 | /* streams in use */ |
724 | snd_printk(KERN_ERR "snd_mixart_playback_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number); | 751 | dev_err(chip->card->dev, |
752 | "snd_mixart_playback_open C%d/P%d/Sub%d in use\n", | ||
753 | chip->chip_idx, pcm_number, subs->number); | ||
725 | err = -EBUSY; | 754 | err = -EBUSY; |
726 | goto _exit_open; | 755 | goto _exit_open; |
727 | } | 756 | } |
@@ -737,7 +766,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs) | |||
737 | /* start the pipe if necessary */ | 766 | /* start the pipe if necessary */ |
738 | err = mixart_set_pipe_state(chip->mgr, pipe, 1); | 767 | err = mixart_set_pipe_state(chip->mgr, pipe, 1); |
739 | if( err < 0 ) { | 768 | if( err < 0 ) { |
740 | snd_printk(KERN_ERR "error starting pipe!\n"); | 769 | dev_err(chip->card->dev, "error starting pipe!\n"); |
741 | snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); | 770 | snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); |
742 | err = -EINVAL; | 771 | err = -EINVAL; |
743 | goto _exit_open; | 772 | goto _exit_open; |
@@ -792,14 +821,17 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs) | |||
792 | 821 | ||
793 | runtime->hw.channels_min = 2; /* for instance, no mono */ | 822 | runtime->hw.channels_min = 2; /* for instance, no mono */ |
794 | 823 | ||
795 | snd_printdd("snd_mixart_capture_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number); | 824 | dev_dbg(chip->card->dev, "snd_mixart_capture_open C%d/P%d/Sub%d\n", |
825 | chip->chip_idx, pcm_number, subs->number); | ||
796 | 826 | ||
797 | /* get stream info */ | 827 | /* get stream info */ |
798 | stream = &(chip->capture_stream[pcm_number]); | 828 | stream = &(chip->capture_stream[pcm_number]); |
799 | 829 | ||
800 | if (stream->status != MIXART_STREAM_STATUS_FREE){ | 830 | if (stream->status != MIXART_STREAM_STATUS_FREE){ |
801 | /* streams in use */ | 831 | /* streams in use */ |
802 | snd_printk(KERN_ERR "snd_mixart_capture_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number); | 832 | dev_err(chip->card->dev, |
833 | "snd_mixart_capture_open C%d/P%d/Sub%d in use\n", | ||
834 | chip->chip_idx, pcm_number, subs->number); | ||
803 | err = -EBUSY; | 835 | err = -EBUSY; |
804 | goto _exit_open; | 836 | goto _exit_open; |
805 | } | 837 | } |
@@ -815,7 +847,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs) | |||
815 | /* start the pipe if necessary */ | 847 | /* start the pipe if necessary */ |
816 | err = mixart_set_pipe_state(chip->mgr, pipe, 1); | 848 | err = mixart_set_pipe_state(chip->mgr, pipe, 1); |
817 | if( err < 0 ) { | 849 | if( err < 0 ) { |
818 | snd_printk(KERN_ERR "error starting pipe!\n"); | 850 | dev_err(chip->card->dev, "error starting pipe!\n"); |
819 | snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); | 851 | snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); |
820 | err = -EINVAL; | 852 | err = -EINVAL; |
821 | goto _exit_open; | 853 | goto _exit_open; |
@@ -855,7 +887,8 @@ static int snd_mixart_close(struct snd_pcm_substream *subs) | |||
855 | 887 | ||
856 | mutex_lock(&mgr->setup_mutex); | 888 | mutex_lock(&mgr->setup_mutex); |
857 | 889 | ||
858 | snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number); | 890 | dev_dbg(chip->card->dev, "snd_mixart_close C%d/P%d/Sub%d\n", |
891 | chip->chip_idx, stream->pcm_number, subs->number); | ||
859 | 892 | ||
860 | /* sample rate released */ | 893 | /* sample rate released */ |
861 | if(--mgr->ref_count_rate == 0) { | 894 | if(--mgr->ref_count_rate == 0) { |
@@ -865,7 +898,9 @@ static int snd_mixart_close(struct snd_pcm_substream *subs) | |||
865 | /* delete pipe */ | 898 | /* delete pipe */ |
866 | if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) { | 899 | if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) { |
867 | 900 | ||
868 | snd_printk(KERN_ERR "error snd_mixart_kill_ref_pipe C%dP%d\n", chip->chip_idx, stream->pcm_number); | 901 | dev_err(chip->card->dev, |
902 | "error snd_mixart_kill_ref_pipe C%dP%d\n", | ||
903 | chip->chip_idx, stream->pcm_number); | ||
869 | } | 904 | } |
870 | 905 | ||
871 | stream->pipe = NULL; | 906 | stream->pipe = NULL; |
@@ -940,7 +975,8 @@ static int snd_mixart_pcm_analog(struct snd_mixart *chip) | |||
940 | if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_ANALOG, | 975 | if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_ANALOG, |
941 | MIXART_PLAYBACK_STREAMS, | 976 | MIXART_PLAYBACK_STREAMS, |
942 | MIXART_CAPTURE_STREAMS, &pcm)) < 0) { | 977 | MIXART_CAPTURE_STREAMS, &pcm)) < 0) { |
943 | snd_printk(KERN_ERR "cannot create the analog pcm %d\n", chip->chip_idx); | 978 | dev_err(chip->card->dev, |
979 | "cannot create the analog pcm %d\n", chip->chip_idx); | ||
944 | return err; | 980 | return err; |
945 | } | 981 | } |
946 | 982 | ||
@@ -971,7 +1007,8 @@ static int snd_mixart_pcm_digital(struct snd_mixart *chip) | |||
971 | if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL, | 1007 | if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL, |
972 | MIXART_PLAYBACK_STREAMS, | 1008 | MIXART_PLAYBACK_STREAMS, |
973 | MIXART_CAPTURE_STREAMS, &pcm)) < 0) { | 1009 | MIXART_CAPTURE_STREAMS, &pcm)) < 0) { |
974 | snd_printk(KERN_ERR "cannot create the digital pcm %d\n", chip->chip_idx); | 1010 | dev_err(chip->card->dev, |
1011 | "cannot create the digital pcm %d\n", chip->chip_idx); | ||
975 | return err; | 1012 | return err; |
976 | } | 1013 | } |
977 | 1014 | ||
@@ -1014,7 +1051,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int | |||
1014 | 1051 | ||
1015 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | 1052 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
1016 | if (! chip) { | 1053 | if (! chip) { |
1017 | snd_printk(KERN_ERR "cannot allocate chip\n"); | 1054 | dev_err(card->dev, "cannot allocate chip\n"); |
1018 | return -ENOMEM; | 1055 | return -ENOMEM; |
1019 | } | 1056 | } |
1020 | 1057 | ||
@@ -1071,7 +1108,7 @@ static int snd_mixart_free(struct mixart_mgr *mgr) | |||
1071 | /* reset board if some firmware was loaded */ | 1108 | /* reset board if some firmware was loaded */ |
1072 | if(mgr->dsp_loaded) { | 1109 | if(mgr->dsp_loaded) { |
1073 | snd_mixart_reset_board(mgr); | 1110 | snd_mixart_reset_board(mgr); |
1074 | snd_printdd("reset miXart !\n"); | 1111 | dev_dbg(&mgr->pci->dev, "reset miXart !\n"); |
1075 | } | 1112 | } |
1076 | 1113 | ||
1077 | /* release the i/o ports */ | 1114 | /* release the i/o ports */ |
@@ -1232,7 +1269,8 @@ static int snd_mixart_probe(struct pci_dev *pci, | |||
1232 | 1269 | ||
1233 | /* check if we can restrict PCI DMA transfers to 32 bits */ | 1270 | /* check if we can restrict PCI DMA transfers to 32 bits */ |
1234 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { | 1271 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { |
1235 | snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); | 1272 | dev_err(&pci->dev, |
1273 | "architecture does not support 32bit PCI busmaster DMA\n"); | ||
1236 | pci_disable_device(pci); | 1274 | pci_disable_device(pci); |
1237 | return -ENXIO; | 1275 | return -ENXIO; |
1238 | } | 1276 | } |
@@ -1258,7 +1296,7 @@ static int snd_mixart_probe(struct pci_dev *pci, | |||
1258 | mgr->mem[i].phys = pci_resource_start(pci, i); | 1296 | mgr->mem[i].phys = pci_resource_start(pci, i); |
1259 | mgr->mem[i].virt = pci_ioremap_bar(pci, i); | 1297 | mgr->mem[i].virt = pci_ioremap_bar(pci, i); |
1260 | if (!mgr->mem[i].virt) { | 1298 | if (!mgr->mem[i].virt) { |
1261 | printk(KERN_ERR "unable to remap resource 0x%lx\n", | 1299 | dev_err(&pci->dev, "unable to remap resource 0x%lx\n", |
1262 | mgr->mem[i].phys); | 1300 | mgr->mem[i].phys); |
1263 | snd_mixart_free(mgr); | 1301 | snd_mixart_free(mgr); |
1264 | return -EBUSY; | 1302 | return -EBUSY; |
@@ -1267,7 +1305,7 @@ static int snd_mixart_probe(struct pci_dev *pci, | |||
1267 | 1305 | ||
1268 | if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED, | 1306 | if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED, |
1269 | KBUILD_MODNAME, mgr)) { | 1307 | KBUILD_MODNAME, mgr)) { |
1270 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | 1308 | dev_err(&pci->dev, "unable to grab IRQ %d\n", pci->irq); |
1271 | snd_mixart_free(mgr); | 1309 | snd_mixart_free(mgr); |
1272 | return -EBUSY; | 1310 | return -EBUSY; |
1273 | } | 1311 | } |
@@ -1310,7 +1348,7 @@ static int snd_mixart_probe(struct pci_dev *pci, | |||
1310 | 0, &card); | 1348 | 0, &card); |
1311 | 1349 | ||
1312 | if (err < 0) { | 1350 | if (err < 0) { |
1313 | snd_printk(KERN_ERR "cannot allocate the card %d\n", i); | 1351 | dev_err(&pci->dev, "cannot allocate the card %d\n", i); |
1314 | snd_mixart_free(mgr); | 1352 | snd_mixart_free(mgr); |
1315 | return err; | 1353 | return err; |
1316 | } | 1354 | } |
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c index 3df0f530f67c..71f4bdcc4055 100644 --- a/sound/pci/mixart/mixart_core.c +++ b/sound/pci/mixart/mixart_core.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
25 | #include <linux/pci.h> | ||
25 | 26 | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <sound/core.h> | 28 | #include <sound/core.h> |
@@ -94,7 +95,8 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp, | |||
94 | 95 | ||
95 | if( (size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) { | 96 | if( (size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) { |
96 | err = -EINVAL; | 97 | err = -EINVAL; |
97 | snd_printk(KERN_ERR "problem with response size = %d\n", size); | 98 | dev_err(&mgr->pci->dev, |
99 | "problem with response size = %d\n", size); | ||
98 | goto _clean_exit; | 100 | goto _clean_exit; |
99 | } | 101 | } |
100 | size -= MSG_DESCRIPTOR_SIZE; | 102 | size -= MSG_DESCRIPTOR_SIZE; |
@@ -161,7 +163,7 @@ static int send_msg( struct mixart_mgr *mgr, | |||
161 | headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_HEAD)); | 163 | headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_HEAD)); |
162 | 164 | ||
163 | if (tailptr == headptr) { | 165 | if (tailptr == headptr) { |
164 | snd_printk(KERN_ERR "error: no message frame available\n"); | 166 | dev_err(&mgr->pci->dev, "error: no message frame available\n"); |
165 | return -EBUSY; | 167 | return -EBUSY; |
166 | } | 168 | } |
167 | 169 | ||
@@ -265,7 +267,8 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
265 | if (! timeout) { | 267 | if (! timeout) { |
266 | /* error - no ack */ | 268 | /* error - no ack */ |
267 | mutex_unlock(&mgr->msg_mutex); | 269 | mutex_unlock(&mgr->msg_mutex); |
268 | snd_printk(KERN_ERR "error: no response on msg %x\n", msg_frame); | 270 | dev_err(&mgr->pci->dev, |
271 | "error: no response on msg %x\n", msg_frame); | ||
269 | return -EIO; | 272 | return -EIO; |
270 | } | 273 | } |
271 | 274 | ||
@@ -278,7 +281,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int | |||
278 | err = get_msg(mgr, &resp, msg_frame); | 281 | err = get_msg(mgr, &resp, msg_frame); |
279 | 282 | ||
280 | if( request->message_id != resp.message_id ) | 283 | if( request->message_id != resp.message_id ) |
281 | snd_printk(KERN_ERR "RESPONSE ERROR!\n"); | 284 | dev_err(&mgr->pci->dev, "RESPONSE ERROR!\n"); |
282 | 285 | ||
283 | mutex_unlock(&mgr->msg_mutex); | 286 | mutex_unlock(&mgr->msg_mutex); |
284 | return err; | 287 | return err; |
@@ -321,7 +324,8 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, | |||
321 | if (! timeout) { | 324 | if (! timeout) { |
322 | /* error - no ack */ | 325 | /* error - no ack */ |
323 | mutex_unlock(&mgr->msg_mutex); | 326 | mutex_unlock(&mgr->msg_mutex); |
324 | snd_printk(KERN_ERR "error: notification %x not received\n", notif_event); | 327 | dev_err(&mgr->pci->dev, |
328 | "error: notification %x not received\n", notif_event); | ||
325 | return -EIO; | 329 | return -EIO; |
326 | } | 330 | } |
327 | 331 | ||
@@ -378,7 +382,9 @@ void snd_mixart_msg_tasklet(unsigned long arg) | |||
378 | resp.size = sizeof(mixart_msg_data); | 382 | resp.size = sizeof(mixart_msg_data); |
379 | err = get_msg(mgr, &resp, addr); | 383 | err = get_msg(mgr, &resp, addr); |
380 | if( err < 0 ) { | 384 | if( err < 0 ) { |
381 | snd_printk(KERN_ERR "tasklet: error(%d) reading mf %x\n", err, msg); | 385 | dev_err(&mgr->pci->dev, |
386 | "tasklet: error(%d) reading mf %x\n", | ||
387 | err, msg); | ||
382 | break; | 388 | break; |
383 | } | 389 | } |
384 | 390 | ||
@@ -388,10 +394,13 @@ void snd_mixart_msg_tasklet(unsigned long arg) | |||
388 | case MSG_STREAM_STOP_INPUT_STAGE_PACKET: | 394 | case MSG_STREAM_STOP_INPUT_STAGE_PACKET: |
389 | case MSG_STREAM_STOP_OUTPUT_STAGE_PACKET: | 395 | case MSG_STREAM_STOP_OUTPUT_STAGE_PACKET: |
390 | if(mixart_msg_data[0]) | 396 | if(mixart_msg_data[0]) |
391 | snd_printk(KERN_ERR "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", mixart_msg_data[0]); | 397 | dev_err(&mgr->pci->dev, |
398 | "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", | ||
399 | mixart_msg_data[0]); | ||
392 | break; | 400 | break; |
393 | default: | 401 | default: |
394 | snd_printdd("tasklet received mf(%x) : msg_id(%x) uid(%x, %x) size(%zd)\n", | 402 | dev_dbg(&mgr->pci->dev, |
403 | "tasklet received mf(%x) : msg_id(%x) uid(%x, %x) size(%zd)\n", | ||
395 | msg, resp.message_id, resp.uid.object_id, resp.uid.desc, resp.size); | 404 | msg, resp.message_id, resp.uid.object_id, resp.uid.desc, resp.size); |
396 | break; | 405 | break; |
397 | } | 406 | } |
@@ -401,7 +410,9 @@ void snd_mixart_msg_tasklet(unsigned long arg) | |||
401 | case MSG_TYPE_COMMAND: | 410 | case MSG_TYPE_COMMAND: |
402 | /* get_msg() necessary */ | 411 | /* get_msg() necessary */ |
403 | default: | 412 | default: |
404 | snd_printk(KERN_ERR "tasklet doesn't know what to do with message %x\n", msg); | 413 | dev_err(&mgr->pci->dev, |
414 | "tasklet doesn't know what to do with message %x\n", | ||
415 | msg); | ||
405 | } /* switch type */ | 416 | } /* switch type */ |
406 | 417 | ||
407 | /* decrement counter */ | 418 | /* decrement counter */ |
@@ -451,7 +462,9 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id) | |||
451 | resp.size = sizeof(mixart_msg_data); | 462 | resp.size = sizeof(mixart_msg_data); |
452 | err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK); | 463 | err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK); |
453 | if( err < 0 ) { | 464 | if( err < 0 ) { |
454 | snd_printk(KERN_ERR "interrupt: error(%d) reading mf %x\n", err, msg); | 465 | dev_err(&mgr->pci->dev, |
466 | "interrupt: error(%d) reading mf %x\n", | ||
467 | err, msg); | ||
455 | break; | 468 | break; |
456 | } | 469 | } |
457 | 470 | ||
@@ -472,7 +485,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id) | |||
472 | struct mixart_stream *stream; | 485 | struct mixart_stream *stream; |
473 | 486 | ||
474 | if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) { | 487 | if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) { |
475 | snd_printk(KERN_ERR "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n", | 488 | dev_err(&mgr->pci->dev, |
489 | "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n", | ||
476 | buffer_id, notify->streams[i].sample_pos_low_part); | 490 | buffer_id, notify->streams[i].sample_pos_low_part); |
477 | break; | 491 | break; |
478 | } | 492 | } |
@@ -524,18 +538,22 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id) | |||
524 | } | 538 | } |
525 | #endif | 539 | #endif |
526 | ((char*)mixart_msg_data)[resp.size - 1] = 0; | 540 | ((char*)mixart_msg_data)[resp.size - 1] = 0; |
527 | snd_printdd("MIXART TRACE : %s\n", (char*)mixart_msg_data); | 541 | dev_dbg(&mgr->pci->dev, |
542 | "MIXART TRACE : %s\n", | ||
543 | (char *)mixart_msg_data); | ||
528 | } | 544 | } |
529 | break; | 545 | break; |
530 | } | 546 | } |
531 | 547 | ||
532 | snd_printdd("command %x not handled\n", resp.message_id); | 548 | dev_dbg(&mgr->pci->dev, "command %x not handled\n", |
549 | resp.message_id); | ||
533 | break; | 550 | break; |
534 | 551 | ||
535 | case MSG_TYPE_NOTIFY: | 552 | case MSG_TYPE_NOTIFY: |
536 | if(msg & MSG_CANCEL_NOTIFY_MASK) { | 553 | if(msg & MSG_CANCEL_NOTIFY_MASK) { |
537 | msg &= ~MSG_CANCEL_NOTIFY_MASK; | 554 | msg &= ~MSG_CANCEL_NOTIFY_MASK; |
538 | snd_printk(KERN_ERR "canceled notification %x !\n", msg); | 555 | dev_err(&mgr->pci->dev, |
556 | "canceled notification %x !\n", msg); | ||
539 | } | 557 | } |
540 | /* no break, continue ! */ | 558 | /* no break, continue ! */ |
541 | case MSG_TYPE_ANSWER: | 559 | case MSG_TYPE_ANSWER: |
@@ -556,7 +574,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id) | |||
556 | break; | 574 | break; |
557 | case MSG_TYPE_REQUEST: | 575 | case MSG_TYPE_REQUEST: |
558 | default: | 576 | default: |
559 | snd_printdd("interrupt received request %x\n", msg); | 577 | dev_dbg(&mgr->pci->dev, |
578 | "interrupt received request %x\n", msg); | ||
560 | /* TODO : are there things to do here ? */ | 579 | /* TODO : are there things to do here ? */ |
561 | break; | 580 | break; |
562 | } /* switch on msg type */ | 581 | } /* switch on msg type */ |
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index ece1f831c16a..581e1e74863c 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c | |||
@@ -165,7 +165,8 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
165 | 165 | ||
166 | err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); | 166 | err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); |
167 | if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { | 167 | if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { |
168 | snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n"); | 168 | dev_err(&mgr->pci->dev, |
169 | "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n"); | ||
169 | err = -EINVAL; | 170 | err = -EINVAL; |
170 | goto __error; | 171 | goto __error; |
171 | } | 172 | } |
@@ -184,7 +185,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
184 | pipe->uid_left_connector = connector->uid[k]; /* even */ | 185 | pipe->uid_left_connector = connector->uid[k]; /* even */ |
185 | } | 186 | } |
186 | 187 | ||
187 | /* snd_printk(KERN_DEBUG "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ | 188 | /* dev_dbg(&mgr->pci->dev, "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ |
188 | 189 | ||
189 | /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ | 190 | /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ |
190 | request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; | 191 | request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; |
@@ -194,10 +195,11 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
194 | 195 | ||
195 | err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); | 196 | err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); |
196 | if( err < 0 ) { | 197 | if( err < 0 ) { |
197 | snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); | 198 | dev_err(&mgr->pci->dev, |
199 | "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); | ||
198 | goto __error; | 200 | goto __error; |
199 | } | 201 | } |
200 | /*snd_printk(KERN_DEBUG "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ | 202 | /*dev_dbg(&mgr->pci->dev, "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ |
201 | } | 203 | } |
202 | 204 | ||
203 | request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR; | 205 | request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR; |
@@ -207,7 +209,8 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
207 | 209 | ||
208 | err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); | 210 | err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); |
209 | if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { | 211 | if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { |
210 | snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n"); | 212 | dev_err(&mgr->pci->dev, |
213 | "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n"); | ||
211 | err = -EINVAL; | 214 | err = -EINVAL; |
212 | goto __error; | 215 | goto __error; |
213 | } | 216 | } |
@@ -226,7 +229,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
226 | pipe->uid_left_connector = connector->uid[k]; /* even */ | 229 | pipe->uid_left_connector = connector->uid[k]; /* even */ |
227 | } | 230 | } |
228 | 231 | ||
229 | /* snd_printk(KERN_DEBUG "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ | 232 | /* dev_dbg(&mgr->pci->dev, "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ |
230 | 233 | ||
231 | /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ | 234 | /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ |
232 | request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; | 235 | request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; |
@@ -236,10 +239,11 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr) | |||
236 | 239 | ||
237 | err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); | 240 | err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); |
238 | if( err < 0 ) { | 241 | if( err < 0 ) { |
239 | snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); | 242 | dev_err(&mgr->pci->dev, |
243 | "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); | ||
240 | goto __error; | 244 | goto __error; |
241 | } | 245 | } |
242 | /*snd_printk(KERN_DEBUG "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ | 246 | /*dev_dbg(&mgr->pci->dev, "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ |
243 | } | 247 | } |
244 | err = 0; | 248 | err = 0; |
245 | 249 | ||
@@ -272,7 +276,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr) | |||
272 | err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr); | 276 | err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr); |
273 | 277 | ||
274 | if( (err < 0) || (console_mgr.error_code != 0) ) { | 278 | if( (err < 0) || (console_mgr.error_code != 0) ) { |
275 | snd_printk(KERN_DEBUG "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", console_mgr.error_code); | 279 | dev_dbg(&mgr->pci->dev, |
280 | "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", | ||
281 | console_mgr.error_code); | ||
276 | return -EINVAL; | 282 | return -EINVAL; |
277 | } | 283 | } |
278 | 284 | ||
@@ -286,7 +292,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr) | |||
286 | 292 | ||
287 | err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io); | 293 | err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io); |
288 | if( (err < 0) || ( phys_io.error_code != 0 ) ) { | 294 | if( (err < 0) || ( phys_io.error_code != 0 ) ) { |
289 | snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code ); | 295 | dev_err(&mgr->pci->dev, |
296 | "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", | ||
297 | err, phys_io.error_code); | ||
290 | return -EINVAL; | 298 | return -EINVAL; |
291 | } | 299 | } |
292 | 300 | ||
@@ -322,7 +330,7 @@ static int mixart_first_init(struct mixart_mgr *mgr) | |||
322 | /* this command has no data. response is a 32 bit status */ | 330 | /* this command has no data. response is a 32 bit status */ |
323 | err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k); | 331 | err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k); |
324 | if( (err < 0) || (k != 0) ) { | 332 | if( (err < 0) || (k != 0) ) { |
325 | snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); | 333 | dev_err(&mgr->pci->dev, "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); |
326 | return err == 0 ? -EINVAL : err; | 334 | return err == 0 ? -EINVAL : err; |
327 | } | 335 | } |
328 | 336 | ||
@@ -348,7 +356,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
348 | 356 | ||
349 | /* motherboard xilinx status 5 will say that the board is performing a reset */ | 357 | /* motherboard xilinx status 5 will say that the board is performing a reset */ |
350 | if (status_xilinx == 5) { | 358 | if (status_xilinx == 5) { |
351 | snd_printk(KERN_ERR "miXart is resetting !\n"); | 359 | dev_err(&mgr->pci->dev, "miXart is resetting !\n"); |
352 | return -EAGAIN; /* try again later */ | 360 | return -EAGAIN; /* try again later */ |
353 | } | 361 | } |
354 | 362 | ||
@@ -357,12 +365,13 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
357 | 365 | ||
358 | /* xilinx already loaded ? */ | 366 | /* xilinx already loaded ? */ |
359 | if (status_xilinx == 4) { | 367 | if (status_xilinx == 4) { |
360 | snd_printk(KERN_DEBUG "xilinx is already loaded !\n"); | 368 | dev_dbg(&mgr->pci->dev, "xilinx is already loaded !\n"); |
361 | return 0; | 369 | return 0; |
362 | } | 370 | } |
363 | /* the status should be 0 == "idle" */ | 371 | /* the status should be 0 == "idle" */ |
364 | if (status_xilinx != 0) { | 372 | if (status_xilinx != 0) { |
365 | snd_printk(KERN_ERR "xilinx load error ! status = %d\n", | 373 | dev_err(&mgr->pci->dev, |
374 | "xilinx load error ! status = %d\n", | ||
366 | status_xilinx); | 375 | status_xilinx); |
367 | return -EIO; /* modprob -r may help ? */ | 376 | return -EIO; /* modprob -r may help ? */ |
368 | } | 377 | } |
@@ -393,13 +402,14 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
393 | case MIXART_MOTHERBOARD_ELF_INDEX: | 402 | case MIXART_MOTHERBOARD_ELF_INDEX: |
394 | 403 | ||
395 | if (status_elf == 4) { | 404 | if (status_elf == 4) { |
396 | snd_printk(KERN_DEBUG "elf file already loaded !\n"); | 405 | dev_dbg(&mgr->pci->dev, "elf file already loaded !\n"); |
397 | return 0; | 406 | return 0; |
398 | } | 407 | } |
399 | 408 | ||
400 | /* the status should be 0 == "idle" */ | 409 | /* the status should be 0 == "idle" */ |
401 | if (status_elf != 0) { | 410 | if (status_elf != 0) { |
402 | snd_printk(KERN_ERR "elf load error ! status = %d\n", | 411 | dev_err(&mgr->pci->dev, |
412 | "elf load error ! status = %d\n", | ||
403 | status_elf); | 413 | status_elf); |
404 | return -EIO; /* modprob -r may help ? */ | 414 | return -EIO; /* modprob -r may help ? */ |
405 | } | 415 | } |
@@ -407,7 +417,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
407 | /* wait for xilinx status == 4 */ | 417 | /* wait for xilinx status == 4 */ |
408 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ | 418 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ |
409 | if (err < 0) { | 419 | if (err < 0) { |
410 | snd_printk(KERN_ERR "xilinx was not loaded or " | 420 | dev_err(&mgr->pci->dev, "xilinx was not loaded or " |
411 | "could not be started\n"); | 421 | "could not be started\n"); |
412 | return err; | 422 | return err; |
413 | } | 423 | } |
@@ -429,7 +439,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
429 | /* wait for elf status == 4 */ | 439 | /* wait for elf status == 4 */ |
430 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ | 440 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ |
431 | if (err < 0) { | 441 | if (err < 0) { |
432 | snd_printk(KERN_ERR "elf could not be started\n"); | 442 | dev_err(&mgr->pci->dev, "elf could not be started\n"); |
433 | return err; | 443 | return err; |
434 | } | 444 | } |
435 | 445 | ||
@@ -443,7 +453,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
443 | 453 | ||
444 | /* elf and xilinx should be loaded */ | 454 | /* elf and xilinx should be loaded */ |
445 | if (status_elf != 4 || status_xilinx != 4) { | 455 | if (status_elf != 4 || status_xilinx != 4) { |
446 | printk(KERN_ERR "xilinx or elf not " | 456 | dev_err(&mgr->pci->dev, "xilinx or elf not " |
447 | "successfully loaded\n"); | 457 | "successfully loaded\n"); |
448 | return -EIO; /* modprob -r may help ? */ | 458 | return -EIO; /* modprob -r may help ? */ |
449 | } | 459 | } |
@@ -451,7 +461,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
451 | /* wait for daughter detection != 0 */ | 461 | /* wait for daughter detection != 0 */ |
452 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ | 462 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ |
453 | if (err < 0) { | 463 | if (err < 0) { |
454 | snd_printk(KERN_ERR "error starting elf file\n"); | 464 | dev_err(&mgr->pci->dev, "error starting elf file\n"); |
455 | return err; | 465 | return err; |
456 | } | 466 | } |
457 | 467 | ||
@@ -467,7 +477,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
467 | 477 | ||
468 | /* daughter should be idle */ | 478 | /* daughter should be idle */ |
469 | if (status_daught != 0) { | 479 | if (status_daught != 0) { |
470 | printk(KERN_ERR "daughter load error ! status = %d\n", | 480 | dev_err(&mgr->pci->dev, |
481 | "daughter load error ! status = %d\n", | ||
471 | status_daught); | 482 | status_daught); |
472 | return -EIO; /* modprob -r may help ? */ | 483 | return -EIO; /* modprob -r may help ? */ |
473 | } | 484 | } |
@@ -487,7 +498,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
487 | /* wait for status == 2 */ | 498 | /* wait for status == 2 */ |
488 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ | 499 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ |
489 | if (err < 0) { | 500 | if (err < 0) { |
490 | snd_printk(KERN_ERR "daughter board load error\n"); | 501 | dev_err(&mgr->pci->dev, "daughter board load error\n"); |
491 | return err; | 502 | return err; |
492 | } | 503 | } |
493 | 504 | ||
@@ -509,7 +520,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
509 | /* wait for daughter status == 3 */ | 520 | /* wait for daughter status == 3 */ |
510 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ | 521 | err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ |
511 | if (err < 0) { | 522 | if (err < 0) { |
512 | snd_printk(KERN_ERR | 523 | dev_err(&mgr->pci->dev, |
513 | "daughter board could not be initialised\n"); | 524 | "daughter board could not be initialised\n"); |
514 | return err; | 525 | return err; |
515 | } | 526 | } |
@@ -520,7 +531,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
520 | /* first communication with embedded */ | 531 | /* first communication with embedded */ |
521 | err = mixart_first_init(mgr); | 532 | err = mixart_first_init(mgr); |
522 | if (err < 0) { | 533 | if (err < 0) { |
523 | snd_printk(KERN_ERR "miXart could not be set up\n"); | 534 | dev_err(&mgr->pci->dev, "miXart could not be set up\n"); |
524 | return err; | 535 | return err; |
525 | } | 536 | } |
526 | 537 | ||
@@ -540,7 +551,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw | |||
540 | return err; | 551 | return err; |
541 | } | 552 | } |
542 | 553 | ||
543 | snd_printdd("miXart firmware downloaded and successfully set up\n"); | 554 | dev_dbg(&mgr->pci->dev, |
555 | "miXart firmware downloaded and successfully set up\n"); | ||
544 | 556 | ||
545 | return 0; | 557 | return 0; |
546 | } | 558 | } |
@@ -559,7 +571,8 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr) | |||
559 | for (i = 0; i < 3; i++) { | 571 | for (i = 0; i < 3; i++) { |
560 | sprintf(path, "mixart/%s", fw_files[i]); | 572 | sprintf(path, "mixart/%s", fw_files[i]); |
561 | if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { | 573 | if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { |
562 | snd_printk(KERN_ERR "miXart: can't load firmware %s\n", path); | 574 | dev_err(&mgr->pci->dev, |
575 | "miXart: can't load firmware %s\n", path); | ||
563 | return -ENOENT; | 576 | return -ENOENT; |
564 | } | 577 | } |
565 | /* fake hwdep dsp record */ | 578 | /* fake hwdep dsp record */ |
diff --git a/sound/pci/mixart/mixart_mixer.c b/sound/pci/mixart/mixart_mixer.c index 3ba6174c3df1..24a1955b8c29 100644 --- a/sound/pci/mixart/mixart_mixer.c +++ b/sound/pci/mixart/mixart_mixer.c | |||
@@ -329,7 +329,9 @@ static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capt | |||
329 | 329 | ||
330 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); | 330 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); |
331 | if((err<0) || (resp.error_code)) { | 331 | if((err<0) || (resp.error_code)) { |
332 | snd_printk(KERN_DEBUG "error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n", chip->chip_idx, is_capture, resp.error_code); | 332 | dev_dbg(chip->card->dev, |
333 | "error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n", | ||
334 | chip->chip_idx, is_capture, resp.error_code); | ||
333 | return -EINVAL; | 335 | return -EINVAL; |
334 | } | 336 | } |
335 | return 0; | 337 | return 0; |
@@ -762,7 +764,9 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int | |||
762 | 764 | ||
763 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status); | 765 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status); |
764 | if((err<0) || status) { | 766 | if((err<0) || status) { |
765 | snd_printk(KERN_DEBUG "error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n", chip->chip_idx, status); | 767 | dev_dbg(chip->card->dev, |
768 | "error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n", | ||
769 | chip->chip_idx, status); | ||
766 | return -EINVAL; | 770 | return -EINVAL; |
767 | } | 771 | } |
768 | return 0; | 772 | return 0; |
@@ -805,7 +809,9 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes) | |||
805 | 809 | ||
806 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status); | 810 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status); |
807 | if((err<0) || status) { | 811 | if((err<0) || status) { |
808 | snd_printk(KERN_DEBUG "error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n", chip->chip_idx, status); | 812 | dev_dbg(chip->card->dev, |
813 | "error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n", | ||
814 | chip->chip_idx, status); | ||
809 | return -EINVAL; | 815 | return -EINVAL; |
810 | } | 816 | } |
811 | return 0; | 817 | return 0; |
@@ -977,7 +983,9 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel) | |||
977 | 983 | ||
978 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); | 984 | err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); |
979 | if((err<0) || resp) { | 985 | if((err<0) || resp) { |
980 | snd_printk(KERN_DEBUG "error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n", chip->chip_idx, resp); | 986 | dev_dbg(chip->card->dev, |
987 | "error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n", | ||
988 | chip->chip_idx, resp); | ||
981 | return -EINVAL; | 989 | return -EINVAL; |
982 | } | 990 | } |
983 | return 0; | 991 | return 0; |