aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 11:32:49 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:28 -0500
commitbe4e6d3c0fa03d3978234feb6a2eefd95b93fa87 (patch)
treefae6141a5a636edea50a0a9c008012bceac08fc3
parentf58e2fcedb44b917cdd4da94f85a81c0bc3d3ef2 (diff)
ALSA: lx6464es: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/lx6464es/lx6464es.c157
-rw-r--r--sound/pci/lx6464es/lx_core.c89
2 files changed, 129 insertions, 117 deletions
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index b9743d4fa1cc..27f60ce8a55c 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -112,16 +112,16 @@ static int lx_hardware_open(struct lx6464es *chip,
112 112
113 snd_pcm_uframes_t period_size = runtime->period_size; 113 snd_pcm_uframes_t period_size = runtime->period_size;
114 114
115 snd_printd(LXP "allocating pipe for %d channels\n", channels); 115 dev_dbg(chip->card->dev, "allocating pipe for %d channels\n", channels);
116 err = lx_pipe_allocate(chip, 0, is_capture, channels); 116 err = lx_pipe_allocate(chip, 0, is_capture, channels);
117 if (err < 0) { 117 if (err < 0) {
118 snd_printk(KERN_ERR LXP "allocating pipe failed\n"); 118 dev_err(chip->card->dev, LXP "allocating pipe failed\n");
119 return err; 119 return err;
120 } 120 }
121 121
122 err = lx_set_granularity(chip, period_size); 122 err = lx_set_granularity(chip, period_size);
123 if (err < 0) { 123 if (err < 0) {
124 snd_printk(KERN_ERR LXP "setting granularity to %ld failed\n", 124 dev_err(chip->card->dev, "setting granularity to %ld failed\n",
125 period_size); 125 period_size);
126 return err; 126 return err;
127 } 127 }
@@ -136,24 +136,24 @@ static int lx_hardware_start(struct lx6464es *chip,
136 struct snd_pcm_runtime *runtime = substream->runtime; 136 struct snd_pcm_runtime *runtime = substream->runtime;
137 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 137 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
138 138
139 snd_printd(LXP "setting stream format\n"); 139 dev_dbg(chip->card->dev, "setting stream format\n");
140 err = lx_stream_set_format(chip, runtime, 0, is_capture); 140 err = lx_stream_set_format(chip, runtime, 0, is_capture);
141 if (err < 0) { 141 if (err < 0) {
142 snd_printk(KERN_ERR LXP "setting stream format failed\n"); 142 dev_err(chip->card->dev, "setting stream format failed\n");
143 return err; 143 return err;
144 } 144 }
145 145
146 snd_printd(LXP "starting pipe\n"); 146 dev_dbg(chip->card->dev, "starting pipe\n");
147 err = lx_pipe_start(chip, 0, is_capture); 147 err = lx_pipe_start(chip, 0, is_capture);
148 if (err < 0) { 148 if (err < 0) {
149 snd_printk(KERN_ERR LXP "starting pipe failed\n"); 149 dev_err(chip->card->dev, "starting pipe failed\n");
150 return err; 150 return err;
151 } 151 }
152 152
153 snd_printd(LXP "waiting for pipe to start\n"); 153 dev_dbg(chip->card->dev, "waiting for pipe to start\n");
154 err = lx_pipe_wait_for_start(chip, 0, is_capture); 154 err = lx_pipe_wait_for_start(chip, 0, is_capture);
155 if (err < 0) { 155 if (err < 0) {
156 snd_printk(KERN_ERR LXP "waiting for pipe failed\n"); 156 dev_err(chip->card->dev, "waiting for pipe failed\n");
157 return err; 157 return err;
158 } 158 }
159 159
@@ -167,24 +167,24 @@ static int lx_hardware_stop(struct lx6464es *chip,
167 int err = 0; 167 int err = 0;
168 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 168 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
169 169
170 snd_printd(LXP "pausing pipe\n"); 170 dev_dbg(chip->card->dev, "pausing pipe\n");
171 err = lx_pipe_pause(chip, 0, is_capture); 171 err = lx_pipe_pause(chip, 0, is_capture);
172 if (err < 0) { 172 if (err < 0) {
173 snd_printk(KERN_ERR LXP "pausing pipe failed\n"); 173 dev_err(chip->card->dev, "pausing pipe failed\n");
174 return err; 174 return err;
175 } 175 }
176 176
177 snd_printd(LXP "waiting for pipe to become idle\n"); 177 dev_dbg(chip->card->dev, "waiting for pipe to become idle\n");
178 err = lx_pipe_wait_for_idle(chip, 0, is_capture); 178 err = lx_pipe_wait_for_idle(chip, 0, is_capture);
179 if (err < 0) { 179 if (err < 0) {
180 snd_printk(KERN_ERR LXP "waiting for pipe failed\n"); 180 dev_err(chip->card->dev, "waiting for pipe failed\n");
181 return err; 181 return err;
182 } 182 }
183 183
184 snd_printd(LXP "stopping pipe\n"); 184 dev_dbg(chip->card->dev, "stopping pipe\n");
185 err = lx_pipe_stop(chip, 0, is_capture); 185 err = lx_pipe_stop(chip, 0, is_capture);
186 if (err < 0) { 186 if (err < 0) {
187 snd_printk(LXP "stopping pipe failed\n"); 187 dev_err(chip->card->dev, "stopping pipe failed\n");
188 return err; 188 return err;
189 } 189 }
190 190
@@ -198,10 +198,10 @@ static int lx_hardware_close(struct lx6464es *chip,
198 int err = 0; 198 int err = 0;
199 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 199 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
200 200
201 snd_printd(LXP "releasing pipe\n"); 201 dev_dbg(chip->card->dev, "releasing pipe\n");
202 err = lx_pipe_release(chip, 0, is_capture); 202 err = lx_pipe_release(chip, 0, is_capture);
203 if (err < 0) { 203 if (err < 0) {
204 snd_printk(LXP "releasing pipe failed\n"); 204 dev_err(chip->card->dev, "releasing pipe failed\n");
205 return err; 205 return err;
206 } 206 }
207 207
@@ -216,7 +216,7 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)
216 int err = 0; 216 int err = 0;
217 int board_rate; 217 int board_rate;
218 218
219 snd_printdd("->lx_pcm_open\n"); 219 dev_dbg(chip->card->dev, "->lx_pcm_open\n");
220 mutex_lock(&chip->setup_mutex); 220 mutex_lock(&chip->setup_mutex);
221 221
222 /* copy the struct snd_pcm_hardware struct */ 222 /* copy the struct snd_pcm_hardware struct */
@@ -227,7 +227,7 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)
227 err = snd_pcm_hw_constraint_integer(runtime, 227 err = snd_pcm_hw_constraint_integer(runtime,
228 SNDRV_PCM_HW_PARAM_PERIODS); 228 SNDRV_PCM_HW_PARAM_PERIODS);
229 if (err < 0) { 229 if (err < 0) {
230 snd_printk(KERN_WARNING LXP "could not constrain periods\n"); 230 dev_warn(chip->card->dev, "could not constrain periods\n");
231 goto exit; 231 goto exit;
232 } 232 }
233#endif 233#endif
@@ -238,7 +238,7 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)
238 board_rate, board_rate); 238 board_rate, board_rate);
239 239
240 if (err < 0) { 240 if (err < 0) {
241 snd_printk(KERN_WARNING LXP "could not constrain periods\n"); 241 dev_warn(chip->card->dev, "could not constrain periods\n");
242 goto exit; 242 goto exit;
243 } 243 }
244 244
@@ -248,7 +248,7 @@ static int lx_pcm_open(struct snd_pcm_substream *substream)
248 MICROBLAZE_IBL_MIN, 248 MICROBLAZE_IBL_MIN,
249 MICROBLAZE_IBL_MAX); 249 MICROBLAZE_IBL_MAX);
250 if (err < 0) { 250 if (err < 0) {
251 snd_printk(KERN_WARNING LXP 251 dev_warn(chip->card->dev,
252 "could not constrain period size\n"); 252 "could not constrain period size\n");
253 goto exit; 253 goto exit;
254 } 254 }
@@ -263,14 +263,14 @@ exit:
263 runtime->private_data = chip; 263 runtime->private_data = chip;
264 264
265 mutex_unlock(&chip->setup_mutex); 265 mutex_unlock(&chip->setup_mutex);
266 snd_printdd("<-lx_pcm_open, %d\n", err); 266 dev_dbg(chip->card->dev, "<-lx_pcm_open, %d\n", err);
267 return err; 267 return err;
268} 268}
269 269
270static int lx_pcm_close(struct snd_pcm_substream *substream) 270static int lx_pcm_close(struct snd_pcm_substream *substream)
271{ 271{
272 int err = 0; 272 int err = 0;
273 snd_printdd("->lx_pcm_close\n"); 273 dev_dbg(substream->pcm->card->dev, "->lx_pcm_close\n");
274 return err; 274 return err;
275} 275}
276 276
@@ -285,13 +285,13 @@ static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream
285 struct lx_stream *lx_stream = is_capture ? &chip->capture_stream : 285 struct lx_stream *lx_stream = is_capture ? &chip->capture_stream :
286 &chip->playback_stream; 286 &chip->playback_stream;
287 287
288 snd_printdd("->lx_pcm_stream_pointer\n"); 288 dev_dbg(chip->card->dev, "->lx_pcm_stream_pointer\n");
289 289
290 spin_lock_irqsave(&chip->lock, flags); 290 spin_lock_irqsave(&chip->lock, flags);
291 pos = lx_stream->frame_pos * substream->runtime->period_size; 291 pos = lx_stream->frame_pos * substream->runtime->period_size;
292 spin_unlock_irqrestore(&chip->lock, flags); 292 spin_unlock_irqrestore(&chip->lock, flags);
293 293
294 snd_printdd(LXP "stream_pointer at %ld\n", pos); 294 dev_dbg(chip->card->dev, "stream_pointer at %ld\n", pos);
295 return pos; 295 return pos;
296} 296}
297 297
@@ -301,37 +301,37 @@ static int lx_pcm_prepare(struct snd_pcm_substream *substream)
301 int err = 0; 301 int err = 0;
302 const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 302 const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
303 303
304 snd_printdd("->lx_pcm_prepare\n"); 304 dev_dbg(chip->card->dev, "->lx_pcm_prepare\n");
305 305
306 mutex_lock(&chip->setup_mutex); 306 mutex_lock(&chip->setup_mutex);
307 307
308 if (chip->hardware_running[is_capture]) { 308 if (chip->hardware_running[is_capture]) {
309 err = lx_hardware_stop(chip, substream); 309 err = lx_hardware_stop(chip, substream);
310 if (err < 0) { 310 if (err < 0) {
311 snd_printk(KERN_ERR LXP "failed to stop hardware. " 311 dev_err(chip->card->dev, "failed to stop hardware. "
312 "Error code %d\n", err); 312 "Error code %d\n", err);
313 goto exit; 313 goto exit;
314 } 314 }
315 315
316 err = lx_hardware_close(chip, substream); 316 err = lx_hardware_close(chip, substream);
317 if (err < 0) { 317 if (err < 0) {
318 snd_printk(KERN_ERR LXP "failed to close hardware. " 318 dev_err(chip->card->dev, "failed to close hardware. "
319 "Error code %d\n", err); 319 "Error code %d\n", err);
320 goto exit; 320 goto exit;
321 } 321 }
322 } 322 }
323 323
324 snd_printd(LXP "opening hardware\n"); 324 dev_dbg(chip->card->dev, "opening hardware\n");
325 err = lx_hardware_open(chip, substream); 325 err = lx_hardware_open(chip, substream);
326 if (err < 0) { 326 if (err < 0) {
327 snd_printk(KERN_ERR LXP "failed to open hardware. " 327 dev_err(chip->card->dev, "failed to open hardware. "
328 "Error code %d\n", err); 328 "Error code %d\n", err);
329 goto exit; 329 goto exit;
330 } 330 }
331 331
332 err = lx_hardware_start(chip, substream); 332 err = lx_hardware_start(chip, substream);
333 if (err < 0) { 333 if (err < 0) {
334 snd_printk(KERN_ERR LXP "failed to start hardware. " 334 dev_err(chip->card->dev, "failed to start hardware. "
335 "Error code %d\n", err); 335 "Error code %d\n", err);
336 goto exit; 336 goto exit;
337 } 337 }
@@ -354,7 +354,7 @@ static int lx_pcm_hw_params(struct snd_pcm_substream *substream,
354 struct lx6464es *chip = snd_pcm_substream_chip(substream); 354 struct lx6464es *chip = snd_pcm_substream_chip(substream);
355 int err = 0; 355 int err = 0;
356 356
357 snd_printdd("->lx_pcm_hw_params\n"); 357 dev_dbg(chip->card->dev, "->lx_pcm_hw_params\n");
358 358
359 mutex_lock(&chip->setup_mutex); 359 mutex_lock(&chip->setup_mutex);
360 360
@@ -389,20 +389,20 @@ static int lx_pcm_hw_free(struct snd_pcm_substream *substream)
389 int err = 0; 389 int err = 0;
390 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 390 int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
391 391
392 snd_printdd("->lx_pcm_hw_free\n"); 392 dev_dbg(chip->card->dev, "->lx_pcm_hw_free\n");
393 mutex_lock(&chip->setup_mutex); 393 mutex_lock(&chip->setup_mutex);
394 394
395 if (chip->hardware_running[is_capture]) { 395 if (chip->hardware_running[is_capture]) {
396 err = lx_hardware_stop(chip, substream); 396 err = lx_hardware_stop(chip, substream);
397 if (err < 0) { 397 if (err < 0) {
398 snd_printk(KERN_ERR LXP "failed to stop hardware. " 398 dev_err(chip->card->dev, "failed to stop hardware. "
399 "Error code %d\n", err); 399 "Error code %d\n", err);
400 goto exit; 400 goto exit;
401 } 401 }
402 402
403 err = lx_hardware_close(chip, substream); 403 err = lx_hardware_close(chip, substream);
404 if (err < 0) { 404 if (err < 0) {
405 snd_printk(KERN_ERR LXP "failed to close hardware. " 405 dev_err(chip->card->dev, "failed to close hardware. "
406 "Error code %d\n", err); 406 "Error code %d\n", err);
407 goto exit; 407 goto exit;
408 } 408 }
@@ -446,25 +446,25 @@ static void lx_trigger_start(struct lx6464es *chip, struct lx_stream *lx_stream)
446 446
447 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, 447 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed,
448 size_array); 448 size_array);
449 snd_printdd(LXP "starting: needed %d, freed %d\n", 449 dev_dbg(chip->card->dev, "starting: needed %d, freed %d\n",
450 needed, freed); 450 needed, freed);
451 451
452 err = lx_buffer_give(chip, 0, is_capture, period_bytes, 452 err = lx_buffer_give(chip, 0, is_capture, period_bytes,
453 lower_32_bits(buf), upper_32_bits(buf), 453 lower_32_bits(buf), upper_32_bits(buf),
454 &buffer_index); 454 &buffer_index);
455 455
456 snd_printdd(LXP "starting: buffer index %x on 0x%lx (%d bytes)\n", 456 dev_dbg(chip->card->dev, "starting: buffer index %x on 0x%lx (%d bytes)\n",
457 buffer_index, (unsigned long)buf, period_bytes); 457 buffer_index, (unsigned long)buf, period_bytes);
458 buf += period_bytes; 458 buf += period_bytes;
459 } 459 }
460 460
461 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array); 461 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array);
462 snd_printdd(LXP "starting: needed %d, freed %d\n", needed, freed); 462 dev_dbg(chip->card->dev, "starting: needed %d, freed %d\n", needed, freed);
463 463
464 snd_printd(LXP "starting: starting stream\n"); 464 dev_dbg(chip->card->dev, "starting: starting stream\n");
465 err = lx_stream_start(chip, 0, is_capture); 465 err = lx_stream_start(chip, 0, is_capture);
466 if (err < 0) 466 if (err < 0)
467 snd_printk(KERN_ERR LXP "couldn't start stream\n"); 467 dev_err(chip->card->dev, "couldn't start stream\n");
468 else 468 else
469 lx_stream->status = LX_STREAM_STATUS_RUNNING; 469 lx_stream->status = LX_STREAM_STATUS_RUNNING;
470 470
@@ -476,10 +476,10 @@ static void lx_trigger_stop(struct lx6464es *chip, struct lx_stream *lx_stream)
476 const unsigned int is_capture = lx_stream->is_capture; 476 const unsigned int is_capture = lx_stream->is_capture;
477 int err; 477 int err;
478 478
479 snd_printd(LXP "stopping: stopping stream\n"); 479 dev_dbg(chip->card->dev, "stopping: stopping stream\n");
480 err = lx_stream_stop(chip, 0, is_capture); 480 err = lx_stream_stop(chip, 0, is_capture);
481 if (err < 0) 481 if (err < 0)
482 snd_printk(KERN_ERR LXP "couldn't stop stream\n"); 482 dev_err(chip->card->dev, "couldn't stop stream\n");
483 else 483 else
484 lx_stream->status = LX_STREAM_STATUS_FREE; 484 lx_stream->status = LX_STREAM_STATUS_FREE;
485 485
@@ -507,7 +507,7 @@ static void lx_trigger_tasklet(unsigned long data)
507 struct lx6464es *chip = (struct lx6464es *)data; 507 struct lx6464es *chip = (struct lx6464es *)data;
508 unsigned long flags; 508 unsigned long flags;
509 509
510 snd_printdd("->lx_trigger_tasklet\n"); 510 dev_dbg(chip->card->dev, "->lx_trigger_tasklet\n");
511 511
512 spin_lock_irqsave(&chip->lock, flags); 512 spin_lock_irqsave(&chip->lock, flags);
513 lx_trigger_tasklet_dispatch_stream(chip, &chip->capture_stream); 513 lx_trigger_tasklet_dispatch_stream(chip, &chip->capture_stream);
@@ -547,14 +547,14 @@ static int lx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
547 struct lx_stream *stream = is_capture ? &chip->capture_stream : 547 struct lx_stream *stream = is_capture ? &chip->capture_stream :
548 &chip->playback_stream; 548 &chip->playback_stream;
549 549
550 snd_printdd("->lx_pcm_trigger\n"); 550 dev_dbg(chip->card->dev, "->lx_pcm_trigger\n");
551 551
552 return lx_pcm_trigger_dispatch(chip, stream, cmd); 552 return lx_pcm_trigger_dispatch(chip, stream, cmd);
553} 553}
554 554
555static int snd_lx6464es_free(struct lx6464es *chip) 555static int snd_lx6464es_free(struct lx6464es *chip)
556{ 556{
557 snd_printdd("->snd_lx6464es_free\n"); 557 dev_dbg(chip->card->dev, "->snd_lx6464es_free\n");
558 558
559 lx_irq_disable(chip); 559 lx_irq_disable(chip);
560 560
@@ -583,7 +583,7 @@ static int lx_init_xilinx_reset(struct lx6464es *chip)
583 int i; 583 int i;
584 u32 plx_reg = lx_plx_reg_read(chip, ePLX_CHIPSC); 584 u32 plx_reg = lx_plx_reg_read(chip, ePLX_CHIPSC);
585 585
586 snd_printdd("->lx_init_xilinx_reset\n"); 586 dev_dbg(chip->card->dev, "->lx_init_xilinx_reset\n");
587 587
588 /* activate reset of xilinx */ 588 /* activate reset of xilinx */
589 plx_reg &= ~CHIPSC_RESET_XILINX; 589 plx_reg &= ~CHIPSC_RESET_XILINX;
@@ -603,8 +603,8 @@ static int lx_init_xilinx_reset(struct lx6464es *chip)
603 msleep(10); 603 msleep(10);
604 reg_mbox3 = lx_plx_reg_read(chip, ePLX_MBOX3); 604 reg_mbox3 = lx_plx_reg_read(chip, ePLX_MBOX3);
605 if (reg_mbox3) { 605 if (reg_mbox3) {
606 snd_printd(LXP "xilinx reset done\n"); 606 dev_dbg(chip->card->dev, "xilinx reset done\n");
607 snd_printdd(LXP "xilinx took %d loops\n", i); 607 dev_dbg(chip->card->dev, "xilinx took %d loops\n", i);
608 break; 608 break;
609 } 609 }
610 } 610 }
@@ -624,7 +624,7 @@ static int lx_init_xilinx_test(struct lx6464es *chip)
624{ 624{
625 u32 reg; 625 u32 reg;
626 626
627 snd_printdd("->lx_init_xilinx_test\n"); 627 dev_dbg(chip->card->dev, "->lx_init_xilinx_test\n");
628 628
629 /* TEST if we have access to Xilinx/MicroBlaze */ 629 /* TEST if we have access to Xilinx/MicroBlaze */
630 lx_dsp_reg_write(chip, eReg_CSM, 0); 630 lx_dsp_reg_write(chip, eReg_CSM, 0);
@@ -632,19 +632,19 @@ static int lx_init_xilinx_test(struct lx6464es *chip)
632 reg = lx_dsp_reg_read(chip, eReg_CSM); 632 reg = lx_dsp_reg_read(chip, eReg_CSM);
633 633
634 if (reg) { 634 if (reg) {
635 snd_printk(KERN_ERR LXP "Problem: Reg_CSM %x.\n", reg); 635 dev_err(chip->card->dev, "Problem: Reg_CSM %x.\n", reg);
636 636
637 /* PCI9056_SPACE0_REMAP */ 637 /* PCI9056_SPACE0_REMAP */
638 lx_plx_reg_write(chip, ePLX_PCICR, 1); 638 lx_plx_reg_write(chip, ePLX_PCICR, 1);
639 639
640 reg = lx_dsp_reg_read(chip, eReg_CSM); 640 reg = lx_dsp_reg_read(chip, eReg_CSM);
641 if (reg) { 641 if (reg) {
642 snd_printk(KERN_ERR LXP "Error: Reg_CSM %x.\n", reg); 642 dev_err(chip->card->dev, "Error: Reg_CSM %x.\n", reg);
643 return -EAGAIN; /* seems to be appropriate */ 643 return -EAGAIN; /* seems to be appropriate */
644 } 644 }
645 } 645 }
646 646
647 snd_printd(LXP "Xilinx/MicroBlaze access test successful\n"); 647 dev_dbg(chip->card->dev, "Xilinx/MicroBlaze access test successful\n");
648 648
649 return 0; 649 return 0;
650} 650}
@@ -661,7 +661,7 @@ static int lx_init_ethersound_config(struct lx6464es *chip)
661 (64 << IOCR_OUTPUTS_OFFSET) | 661 (64 << IOCR_OUTPUTS_OFFSET) |
662 (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET); 662 (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET);
663 663
664 snd_printdd("->lx_init_ethersound\n"); 664 dev_dbg(chip->card->dev, "->lx_init_ethersound\n");
665 665
666 chip->freq_ratio = FREQ_RATIO_SINGLE_MODE; 666 chip->freq_ratio = FREQ_RATIO_SINGLE_MODE;
667 667
@@ -675,18 +675,18 @@ static int lx_init_ethersound_config(struct lx6464es *chip)
675 675
676 for (i = 0; i != 1000; ++i) { 676 for (i = 0; i != 1000; ++i) {
677 if (lx_dsp_reg_read(chip, eReg_CSES) & 4) { 677 if (lx_dsp_reg_read(chip, eReg_CSES) & 4) {
678 snd_printd(LXP "ethersound initialized after %dms\n", 678 dev_dbg(chip->card->dev, "ethersound initialized after %dms\n",
679 i); 679 i);
680 goto ethersound_initialized; 680 goto ethersound_initialized;
681 } 681 }
682 msleep(1); 682 msleep(1);
683 } 683 }
684 snd_printk(KERN_WARNING LXP 684 dev_warn(chip->card->dev,
685 "ethersound could not be initialized after %dms\n", i); 685 "ethersound could not be initialized after %dms\n", i);
686 return -ETIMEDOUT; 686 return -ETIMEDOUT;
687 687
688 ethersound_initialized: 688 ethersound_initialized:
689 snd_printd(LXP "ethersound initialized\n"); 689 dev_dbg(chip->card->dev, "ethersound initialized\n");
690 return 0; 690 return 0;
691} 691}
692 692
@@ -696,14 +696,14 @@ static int lx_init_get_version_features(struct lx6464es *chip)
696 696
697 int err; 697 int err;
698 698
699 snd_printdd("->lx_init_get_version_features\n"); 699 dev_dbg(chip->card->dev, "->lx_init_get_version_features\n");
700 700
701 err = lx_dsp_get_version(chip, &dsp_version); 701 err = lx_dsp_get_version(chip, &dsp_version);
702 702
703 if (err == 0) { 703 if (err == 0) {
704 u32 freq; 704 u32 freq;
705 705
706 snd_printk(LXP "DSP version: V%02d.%02d #%d\n", 706 dev_info(chip->card->dev, "DSP version: V%02d.%02d #%d\n",
707 (dsp_version>>16) & 0xff, (dsp_version>>8) & 0xff, 707 (dsp_version>>16) & 0xff, (dsp_version>>8) & 0xff,
708 dsp_version & 0xff); 708 dsp_version & 0xff);
709 709
@@ -718,9 +718,9 @@ static int lx_init_get_version_features(struct lx6464es *chip)
718 err = lx_dsp_get_clock_frequency(chip, &freq); 718 err = lx_dsp_get_clock_frequency(chip, &freq);
719 if (err == 0) 719 if (err == 0)
720 chip->board_sample_rate = freq; 720 chip->board_sample_rate = freq;
721 snd_printd(LXP "actual clock frequency %d\n", freq); 721 dev_dbg(chip->card->dev, "actual clock frequency %d\n", freq);
722 } else { 722 } else {
723 snd_printk(KERN_ERR LXP "DSP corrupted \n"); 723 dev_err(chip->card->dev, "DSP corrupted \n");
724 err = -EAGAIN; 724 err = -EAGAIN;
725 } 725 }
726 726
@@ -732,7 +732,7 @@ static int lx_set_granularity(struct lx6464es *chip, u32 gran)
732 int err = 0; 732 int err = 0;
733 u32 snapped_gran = MICROBLAZE_IBL_MIN; 733 u32 snapped_gran = MICROBLAZE_IBL_MIN;
734 734
735 snd_printdd("->lx_set_granularity\n"); 735 dev_dbg(chip->card->dev, "->lx_set_granularity\n");
736 736
737 /* blocksize is a power of 2 */ 737 /* blocksize is a power of 2 */
738 while ((snapped_gran < gran) && 738 while ((snapped_gran < gran) &&
@@ -745,14 +745,14 @@ static int lx_set_granularity(struct lx6464es *chip, u32 gran)
745 745
746 err = lx_dsp_set_granularity(chip, snapped_gran); 746 err = lx_dsp_set_granularity(chip, snapped_gran);
747 if (err < 0) { 747 if (err < 0) {
748 snd_printk(KERN_WARNING LXP "could not set granularity\n"); 748 dev_warn(chip->card->dev, "could not set granularity\n");
749 err = -EAGAIN; 749 err = -EAGAIN;
750 } 750 }
751 751
752 if (snapped_gran != gran) 752 if (snapped_gran != gran)
753 snd_printk(LXP "snapped blocksize to %d\n", snapped_gran); 753 dev_err(chip->card->dev, "snapped blocksize to %d\n", snapped_gran);
754 754
755 snd_printd(LXP "set blocksize on board %d\n", snapped_gran); 755 dev_dbg(chip->card->dev, "set blocksize on board %d\n", snapped_gran);
756 chip->pcm_granularity = snapped_gran; 756 chip->pcm_granularity = snapped_gran;
757 757
758 return err; 758 return err;
@@ -764,19 +764,19 @@ static int lx_init_dsp(struct lx6464es *chip)
764 int err; 764 int err;
765 int i; 765 int i;
766 766
767 snd_printdd("->lx_init_dsp\n"); 767 dev_dbg(chip->card->dev, "->lx_init_dsp\n");
768 768
769 snd_printd(LXP "initialize board\n"); 769 dev_dbg(chip->card->dev, "initialize board\n");
770 err = lx_init_xilinx_reset(chip); 770 err = lx_init_xilinx_reset(chip);
771 if (err) 771 if (err)
772 return err; 772 return err;
773 773
774 snd_printd(LXP "testing board\n"); 774 dev_dbg(chip->card->dev, "testing board\n");
775 err = lx_init_xilinx_test(chip); 775 err = lx_init_xilinx_test(chip);
776 if (err) 776 if (err)
777 return err; 777 return err;
778 778
779 snd_printd(LXP "initialize ethersound configuration\n"); 779 dev_dbg(chip->card->dev, "initialize ethersound configuration\n");
780 err = lx_init_ethersound_config(chip); 780 err = lx_init_ethersound_config(chip);
781 if (err) 781 if (err)
782 return err; 782 return err;
@@ -797,8 +797,9 @@ static int lx_init_dsp(struct lx6464es *chip)
797 return -ETIMEDOUT; 797 return -ETIMEDOUT;
798 798
799mac_ready: 799mac_ready:
800 snd_printd(LXP "mac address ready read after: %dms\n", i); 800 dev_dbg(chip->card->dev, "mac address ready read after: %dms\n", i);
801 snd_printk(LXP "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n", 801 dev_info(chip->card->dev,
802 "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n",
802 chip->mac_address[0], chip->mac_address[1], chip->mac_address[2], 803 chip->mac_address[0], chip->mac_address[1], chip->mac_address[2],
803 chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]); 804 chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]);
804 805
@@ -977,7 +978,7 @@ static int snd_lx6464es_create(struct snd_card *card,
977 .dev_free = snd_lx6464es_dev_free, 978 .dev_free = snd_lx6464es_dev_free,
978 }; 979 };
979 980
980 snd_printdd("->snd_lx6464es_create\n"); 981 dev_dbg(card->dev, "->snd_lx6464es_create\n");
981 982
982 *rchip = NULL; 983 *rchip = NULL;
983 984
@@ -991,8 +992,8 @@ static int snd_lx6464es_create(struct snd_card *card,
991 /* check if we can restrict PCI DMA transfers to 32 bits */ 992 /* check if we can restrict PCI DMA transfers to 32 bits */
992 err = pci_set_dma_mask(pci, DMA_BIT_MASK(32)); 993 err = pci_set_dma_mask(pci, DMA_BIT_MASK(32));
993 if (err < 0) { 994 if (err < 0) {
994 snd_printk(KERN_ERR "architecture does not support " 995 dev_err(card->dev,
995 "32bit PCI busmaster DMA\n"); 996 "architecture does not support 32bit PCI busmaster DMA\n");
996 pci_disable_device(pci); 997 pci_disable_device(pci);
997 return -ENXIO; 998 return -ENXIO;
998 } 999 }
@@ -1034,7 +1035,7 @@ static int snd_lx6464es_create(struct snd_card *card,
1034 err = request_irq(pci->irq, lx_interrupt, IRQF_SHARED, 1035 err = request_irq(pci->irq, lx_interrupt, IRQF_SHARED,
1035 KBUILD_MODNAME, chip); 1036 KBUILD_MODNAME, chip);
1036 if (err) { 1037 if (err) {
1037 snd_printk(KERN_ERR LXP "unable to grab IRQ %d\n", pci->irq); 1038 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
1038 goto request_irq_failed; 1039 goto request_irq_failed;
1039 } 1040 }
1040 chip->irq = pci->irq; 1041 chip->irq = pci->irq;
@@ -1045,7 +1046,7 @@ static int snd_lx6464es_create(struct snd_card *card,
1045 1046
1046 err = lx_init_dsp(chip); 1047 err = lx_init_dsp(chip);
1047 if (err < 0) { 1048 if (err < 0) {
1048 snd_printk(KERN_ERR LXP "error during DSP initialization\n"); 1049 dev_err(card->dev, "error during DSP initialization\n");
1049 return err; 1050 return err;
1050 } 1051 }
1051 1052
@@ -1088,7 +1089,7 @@ static int snd_lx6464es_probe(struct pci_dev *pci,
1088 struct lx6464es *chip; 1089 struct lx6464es *chip;
1089 int err; 1090 int err;
1090 1091
1091 snd_printdd("->snd_lx6464es_probe\n"); 1092 dev_dbg(&pci->dev, "->snd_lx6464es_probe\n");
1092 1093
1093 if (dev >= SNDRV_CARDS) 1094 if (dev >= SNDRV_CARDS)
1094 return -ENODEV; 1095 return -ENODEV;
@@ -1104,7 +1105,7 @@ static int snd_lx6464es_probe(struct pci_dev *pci,
1104 1105
1105 err = snd_lx6464es_create(card, pci, &chip); 1106 err = snd_lx6464es_create(card, pci, &chip);
1106 if (err < 0) { 1107 if (err < 0) {
1107 snd_printk(KERN_ERR LXP "error during snd_lx6464es_create\n"); 1108 dev_err(card->dev, "error during snd_lx6464es_create\n");
1108 goto out_free; 1109 goto out_free;
1109 } 1110 }
1110 1111
@@ -1124,7 +1125,7 @@ static int snd_lx6464es_probe(struct pci_dev *pci,
1124 if (err < 0) 1125 if (err < 0)
1125 goto out_free; 1126 goto out_free;
1126 1127
1127 snd_printdd(LXP "initialization successful\n"); 1128 dev_dbg(chip->card->dev, "initialization successful\n");
1128 pci_set_drvdata(pci, card); 1129 pci_set_drvdata(pci, card);
1129 dev++; 1130 dev++;
1130 return 0; 1131 return 0;
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index df4044d4f43d..2d8e95e9fbe5 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -273,7 +273,7 @@ static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh)
273 int dwloop; 273 int dwloop;
274 274
275 if (lx_dsp_reg_read(chip, eReg_CSM) & (Reg_CSM_MC | Reg_CSM_MR)) { 275 if (lx_dsp_reg_read(chip, eReg_CSM) & (Reg_CSM_MC | Reg_CSM_MR)) {
276 snd_printk(KERN_ERR LXP "PIOSendMessage eReg_CSM %x\n", reg); 276 dev_err(chip->card->dev, "PIOSendMessage eReg_CSM %x\n", reg);
277 return -EBUSY; 277 return -EBUSY;
278 } 278 }
279 279
@@ -294,7 +294,7 @@ static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh)
294 } else 294 } else
295 udelay(1); 295 udelay(1);
296 } 296 }
297 snd_printk(KERN_WARNING LXP "TIMEOUT lx_message_send_atomic! " 297 dev_warn(chip->card->dev, "TIMEOUT lx_message_send_atomic! "
298 "polling failed\n"); 298 "polling failed\n");
299 299
300polling_successful: 300polling_successful:
@@ -306,18 +306,18 @@ polling_successful:
306 rmh->stat_len); 306 rmh->stat_len);
307 } 307 }
308 } else 308 } else
309 snd_printk(LXP "rmh error: %08x\n", reg); 309 dev_err(chip->card->dev, "rmh error: %08x\n", reg);
310 310
311 /* clear Reg_CSM_MR */ 311 /* clear Reg_CSM_MR */
312 lx_dsp_reg_write(chip, eReg_CSM, 0); 312 lx_dsp_reg_write(chip, eReg_CSM, 0);
313 313
314 switch (reg) { 314 switch (reg) {
315 case ED_DSP_TIMED_OUT: 315 case ED_DSP_TIMED_OUT:
316 snd_printk(KERN_WARNING LXP "lx_message_send: dsp timeout\n"); 316 dev_warn(chip->card->dev, "lx_message_send: dsp timeout\n");
317 return -ETIMEDOUT; 317 return -ETIMEDOUT;
318 318
319 case ED_DSP_CRASHED: 319 case ED_DSP_CRASHED:
320 snd_printk(KERN_WARNING LXP "lx_message_send: dsp crashed\n"); 320 dev_warn(chip->card->dev, "lx_message_send: dsp crashed\n");
321 return -EAGAIN; 321 return -EAGAIN;
322 } 322 }
323 323
@@ -458,7 +458,7 @@ int lx_pipe_allocate(struct lx6464es *chip, u32 pipe, int is_capture,
458 spin_unlock_irqrestore(&chip->msg_lock, flags); 458 spin_unlock_irqrestore(&chip->msg_lock, flags);
459 459
460 if (err != 0) 460 if (err != 0)
461 snd_printk(KERN_ERR "lx6464es: could not allocate pipe\n"); 461 dev_err(chip->card->dev, "could not allocate pipe\n");
462 462
463 return err; 463 return err;
464} 464}
@@ -520,11 +520,13 @@ int lx_buffer_ask(struct lx6464es *chip, u32 pipe, int is_capture,
520 } 520 }
521 521
522#if 0 522#if 0
523 snd_printdd(LXP "CMD_08_ASK_BUFFERS: needed %d, freed %d\n", 523 dev_dbg(chip->card->dev,
524 "CMD_08_ASK_BUFFERS: needed %d, freed %d\n",
524 *r_needed, *r_freed); 525 *r_needed, *r_freed);
525 for (i = 0; i < MAX_STREAM_BUFFER; ++i) { 526 for (i = 0; i < MAX_STREAM_BUFFER; ++i) {
526 for (i = 0; i != chip->rmh.stat_len; ++i) 527 for (i = 0; i != chip->rmh.stat_len; ++i)
527 snd_printdd(" stat[%d]: %x, %x\n", i, 528 dev_dbg(chip->card->dev,
529 " stat[%d]: %x, %x\n", i,
528 chip->rmh.stat[i], 530 chip->rmh.stat[i],
529 chip->rmh.stat[i] & MASK_DATA_SIZE); 531 chip->rmh.stat[i] & MASK_DATA_SIZE);
530 } 532 }
@@ -617,8 +619,8 @@ int lx_pipe_sample_count(struct lx6464es *chip, u32 pipe, int is_capture,
617 err = lx_message_send_atomic(chip, &chip->rmh); /* don't sleep! */ 619 err = lx_message_send_atomic(chip, &chip->rmh); /* don't sleep! */
618 620
619 if (err != 0) 621 if (err != 0)
620 snd_printk(KERN_ERR 622 dev_err(chip->card->dev,
621 "lx6464es: could not query pipe's sample count\n"); 623 "could not query pipe's sample count\n");
622 else { 624 else {
623 *rsample_count = ((u64)(chip->rmh.stat[0] & MASK_SPL_COUNT_HI) 625 *rsample_count = ((u64)(chip->rmh.stat[0] & MASK_SPL_COUNT_HI)
624 << 24) /* hi part */ 626 << 24) /* hi part */
@@ -644,7 +646,7 @@ int lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate)
644 err = lx_message_send_atomic(chip, &chip->rmh); 646 err = lx_message_send_atomic(chip, &chip->rmh);
645 647
646 if (err != 0) 648 if (err != 0)
647 snd_printk(KERN_ERR "lx6464es: could not query pipe's state\n"); 649 dev_err(chip->card->dev, "could not query pipe's state\n");
648 else 650 else
649 *rstate = (chip->rmh.stat[0] >> PSTATE_OFFSET) & 0x0F; 651 *rstate = (chip->rmh.stat[0] >> PSTATE_OFFSET) & 0x0F;
650 652
@@ -717,7 +719,7 @@ int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime,
717 u32 channels = runtime->channels; 719 u32 channels = runtime->channels;
718 720
719 if (runtime->channels != channels) 721 if (runtime->channels != channels)
720 snd_printk(KERN_ERR LXP "channel count mismatch: %d vs %d", 722 dev_err(chip->card->dev, "channel count mismatch: %d vs %d",
721 runtime->channels, channels); 723 runtime->channels, channels);
722 724
723 spin_lock_irqsave(&chip->msg_lock, flags); 725 spin_lock_irqsave(&chip->msg_lock, flags);
@@ -820,13 +822,16 @@ int lx_buffer_give(struct lx6464es *chip, u32 pipe, int is_capture,
820 } 822 }
821 823
822 if (err == EB_RBUFFERS_TABLE_OVERFLOW) 824 if (err == EB_RBUFFERS_TABLE_OVERFLOW)
823 snd_printk(LXP "lx_buffer_give EB_RBUFFERS_TABLE_OVERFLOW\n"); 825 dev_err(chip->card->dev,
826 "lx_buffer_give EB_RBUFFERS_TABLE_OVERFLOW\n");
824 827
825 if (err == EB_INVALID_STREAM) 828 if (err == EB_INVALID_STREAM)
826 snd_printk(LXP "lx_buffer_give EB_INVALID_STREAM\n"); 829 dev_err(chip->card->dev,
830 "lx_buffer_give EB_INVALID_STREAM\n");
827 831
828 if (err == EB_CMD_REFUSED) 832 if (err == EB_CMD_REFUSED)
829 snd_printk(LXP "lx_buffer_give EB_CMD_REFUSED\n"); 833 dev_err(chip->card->dev,
834 "lx_buffer_give EB_CMD_REFUSED\n");
830 835
831 done: 836 done:
832 spin_unlock_irqrestore(&chip->msg_lock, flags); 837 spin_unlock_irqrestore(&chip->msg_lock, flags);
@@ -899,7 +904,8 @@ int lx_level_unmute(struct lx6464es *chip, int is_capture, int unmute)
899 chip->rmh.cmd[1] = (u32)(mute_mask >> (u64)32); /* hi part */ 904 chip->rmh.cmd[1] = (u32)(mute_mask >> (u64)32); /* hi part */
900 chip->rmh.cmd[2] = (u32)(mute_mask & (u64)0xFFFFFFFF); /* lo part */ 905 chip->rmh.cmd[2] = (u32)(mute_mask & (u64)0xFFFFFFFF); /* lo part */
901 906
902 snd_printk("mute %x %x %x\n", chip->rmh.cmd[0], chip->rmh.cmd[1], 907 dev_dbg(chip->card->dev,
908 "mute %x %x %x\n", chip->rmh.cmd[0], chip->rmh.cmd[1],
903 chip->rmh.cmd[2]); 909 chip->rmh.cmd[2]);
904 910
905 err = lx_message_send_atomic(chip, &chip->rmh); 911 err = lx_message_send_atomic(chip, &chip->rmh);
@@ -1009,7 +1015,7 @@ static int lx_interrupt_ack(struct lx6464es *chip, u32 *r_irqsrc,
1009 } 1015 }
1010 1016
1011 if (irq_async) { 1017 if (irq_async) {
1012 /* snd_printd("interrupt: async event pending\n"); */ 1018 /* dev_dbg(chip->card->dev, "interrupt: async event pending\n"); */
1013 *r_async_pending = 1; 1019 *r_async_pending = 1;
1014 } 1020 }
1015 1021
@@ -1055,13 +1061,13 @@ static int lx_interrupt_handle_async_events(struct lx6464es *chip, u32 irqsrc,
1055 if (eb_pending_in) { 1061 if (eb_pending_in) {
1056 *r_notified_in_pipe_mask = ((u64)stat[3] << 32) 1062 *r_notified_in_pipe_mask = ((u64)stat[3] << 32)
1057 + stat[4]; 1063 + stat[4];
1058 snd_printdd(LXP "interrupt: EOBI pending %llx\n", 1064 dev_dbg(chip->card->dev, "interrupt: EOBI pending %llx\n",
1059 *r_notified_in_pipe_mask); 1065 *r_notified_in_pipe_mask);
1060 } 1066 }
1061 if (eb_pending_out) { 1067 if (eb_pending_out) {
1062 *r_notified_out_pipe_mask = ((u64)stat[1] << 32) 1068 *r_notified_out_pipe_mask = ((u64)stat[1] << 32)
1063 + stat[2]; 1069 + stat[2];
1064 snd_printdd(LXP "interrupt: EOBO pending %llx\n", 1070 dev_dbg(chip->card->dev, "interrupt: EOBO pending %llx\n",
1065 *r_notified_out_pipe_mask); 1071 *r_notified_out_pipe_mask);
1066 } 1072 }
1067 1073
@@ -1097,17 +1103,19 @@ static int lx_interrupt_request_new_buffer(struct lx6464es *chip,
1097 u32 needed, freed; 1103 u32 needed, freed;
1098 u32 size_array[MAX_STREAM_BUFFER]; 1104 u32 size_array[MAX_STREAM_BUFFER];
1099 1105
1100 snd_printdd("->lx_interrupt_request_new_buffer\n"); 1106 dev_dbg(chip->card->dev, "->lx_interrupt_request_new_buffer\n");
1101 1107
1102 spin_lock_irqsave(&chip->lock, flags); 1108 spin_lock_irqsave(&chip->lock, flags);
1103 1109
1104 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array); 1110 err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array);
1105 snd_printdd(LXP "interrupt: needed %d, freed %d\n", needed, freed); 1111 dev_dbg(chip->card->dev,
1112 "interrupt: needed %d, freed %d\n", needed, freed);
1106 1113
1107 unpack_pointer(buf, &buf_lo, &buf_hi); 1114 unpack_pointer(buf, &buf_lo, &buf_hi);
1108 err = lx_buffer_give(chip, 0, is_capture, period_bytes, buf_lo, buf_hi, 1115 err = lx_buffer_give(chip, 0, is_capture, period_bytes, buf_lo, buf_hi,
1109 &buffer_index); 1116 &buffer_index);
1110 snd_printdd(LXP "interrupt: gave buffer index %x on 0x%lx (%d bytes)\n", 1117 dev_dbg(chip->card->dev,
1118 "interrupt: gave buffer index %x on 0x%lx (%d bytes)\n",
1111 buffer_index, (unsigned long)buf, period_bytes); 1119 buffer_index, (unsigned long)buf, period_bytes);
1112 1120
1113 lx_stream->frame_pos = next_pos; 1121 lx_stream->frame_pos = next_pos;
@@ -1122,11 +1130,11 @@ void lx_tasklet_playback(unsigned long data)
1122 struct lx_stream *lx_stream = &chip->playback_stream; 1130 struct lx_stream *lx_stream = &chip->playback_stream;
1123 int err; 1131 int err;
1124 1132
1125 snd_printdd("->lx_tasklet_playback\n"); 1133 dev_dbg(chip->card->dev, "->lx_tasklet_playback\n");
1126 1134
1127 err = lx_interrupt_request_new_buffer(chip, lx_stream); 1135 err = lx_interrupt_request_new_buffer(chip, lx_stream);
1128 if (err < 0) 1136 if (err < 0)
1129 snd_printk(KERN_ERR LXP 1137 dev_err(chip->card->dev,
1130 "cannot request new buffer for playback\n"); 1138 "cannot request new buffer for playback\n");
1131 1139
1132 snd_pcm_period_elapsed(lx_stream->stream); 1140 snd_pcm_period_elapsed(lx_stream->stream);
@@ -1138,10 +1146,10 @@ void lx_tasklet_capture(unsigned long data)
1138 struct lx_stream *lx_stream = &chip->capture_stream; 1146 struct lx_stream *lx_stream = &chip->capture_stream;
1139 int err; 1147 int err;
1140 1148
1141 snd_printdd("->lx_tasklet_capture\n"); 1149 dev_dbg(chip->card->dev, "->lx_tasklet_capture\n");
1142 err = lx_interrupt_request_new_buffer(chip, lx_stream); 1150 err = lx_interrupt_request_new_buffer(chip, lx_stream);
1143 if (err < 0) 1151 if (err < 0)
1144 snd_printk(KERN_ERR LXP 1152 dev_err(chip->card->dev,
1145 "cannot request new buffer for capture\n"); 1153 "cannot request new buffer for capture\n");
1146 1154
1147 snd_pcm_period_elapsed(lx_stream->stream); 1155 snd_pcm_period_elapsed(lx_stream->stream);
@@ -1156,12 +1164,14 @@ static int lx_interrupt_handle_audio_transfer(struct lx6464es *chip,
1156 int err = 0; 1164 int err = 0;
1157 1165
1158 if (notified_in_pipe_mask) { 1166 if (notified_in_pipe_mask) {
1159 snd_printdd(LXP "requesting audio transfer for capture\n"); 1167 dev_dbg(chip->card->dev,
1168 "requesting audio transfer for capture\n");
1160 tasklet_hi_schedule(&chip->tasklet_capture); 1169 tasklet_hi_schedule(&chip->tasklet_capture);
1161 } 1170 }
1162 1171
1163 if (notified_out_pipe_mask) { 1172 if (notified_out_pipe_mask) {
1164 snd_printdd(LXP "requesting audio transfer for playback\n"); 1173 dev_dbg(chip->card->dev,
1174 "requesting audio transfer for playback\n");
1165 tasklet_hi_schedule(&chip->tasklet_playback); 1175 tasklet_hi_schedule(&chip->tasklet_playback);
1166 } 1176 }
1167 1177
@@ -1177,11 +1187,12 @@ irqreturn_t lx_interrupt(int irq, void *dev_id)
1177 1187
1178 spin_lock(&chip->lock); 1188 spin_lock(&chip->lock);
1179 1189
1180 snd_printdd("**************************************************\n"); 1190 dev_dbg(chip->card->dev,
1191 "**************************************************\n");
1181 1192
1182 if (!lx_interrupt_ack(chip, &irqsrc, &async_pending, &async_escmd)) { 1193 if (!lx_interrupt_ack(chip, &irqsrc, &async_pending, &async_escmd)) {
1183 spin_unlock(&chip->lock); 1194 spin_unlock(&chip->lock);
1184 snd_printdd("IRQ_NONE\n"); 1195 dev_dbg(chip->card->dev, "IRQ_NONE\n");
1185 return IRQ_NONE; /* this device did not cause the interrupt */ 1196 return IRQ_NONE; /* this device did not cause the interrupt */
1186 } 1197 }
1187 1198
@@ -1190,16 +1201,16 @@ irqreturn_t lx_interrupt(int irq, void *dev_id)
1190 1201
1191#if 0 1202#if 0
1192 if (irqsrc & MASK_SYS_STATUS_EOBI) 1203 if (irqsrc & MASK_SYS_STATUS_EOBI)
1193 snd_printdd(LXP "interrupt: EOBI\n"); 1204 dev_dgg(chip->card->dev, "interrupt: EOBI\n");
1194 1205
1195 if (irqsrc & MASK_SYS_STATUS_EOBO) 1206 if (irqsrc & MASK_SYS_STATUS_EOBO)
1196 snd_printdd(LXP "interrupt: EOBO\n"); 1207 dev_dbg(chip->card->dev, "interrupt: EOBO\n");
1197 1208
1198 if (irqsrc & MASK_SYS_STATUS_URUN) 1209 if (irqsrc & MASK_SYS_STATUS_URUN)
1199 snd_printdd(LXP "interrupt: URUN\n"); 1210 dev_dbg(chip->card->dev, "interrupt: URUN\n");
1200 1211
1201 if (irqsrc & MASK_SYS_STATUS_ORUN) 1212 if (irqsrc & MASK_SYS_STATUS_ORUN)
1202 snd_printdd(LXP "interrupt: ORUN\n"); 1213 dev_dbg(chip->card->dev, "interrupt: ORUN\n");
1203#endif 1214#endif
1204 1215
1205 if (async_pending) { 1216 if (async_pending) {
@@ -1214,7 +1225,7 @@ irqreturn_t lx_interrupt(int irq, void *dev_id)
1214 &notified_in_pipe_mask, 1225 &notified_in_pipe_mask,
1215 &notified_out_pipe_mask); 1226 &notified_out_pipe_mask);
1216 if (err) 1227 if (err)
1217 snd_printk(KERN_ERR LXP 1228 dev_err(chip->card->dev,
1218 "error handling async events\n"); 1229 "error handling async events\n");
1219 1230
1220 err = lx_interrupt_handle_audio_transfer(chip, 1231 err = lx_interrupt_handle_audio_transfer(chip,
@@ -1222,7 +1233,7 @@ irqreturn_t lx_interrupt(int irq, void *dev_id)
1222 notified_out_pipe_mask 1233 notified_out_pipe_mask
1223 ); 1234 );
1224 if (err) 1235 if (err)
1225 snd_printk(KERN_ERR LXP 1236 dev_err(chip->card->dev,
1226 "error during audio transfer\n"); 1237 "error during audio transfer\n");
1227 } 1238 }
1228 1239
@@ -1234,7 +1245,7 @@ irqreturn_t lx_interrupt(int irq, void *dev_id)
1234 * 1245 *
1235 * */ 1246 * */
1236 1247
1237 snd_printdd("lx6464es: interrupt requests escmd handling\n"); 1248 dev_dbg(chip->card->dev, "interrupt requests escmd handling\n");
1238#endif 1249#endif
1239 } 1250 }
1240 1251
@@ -1262,12 +1273,12 @@ static void lx_irq_set(struct lx6464es *chip, int enable)
1262 1273
1263void lx_irq_enable(struct lx6464es *chip) 1274void lx_irq_enable(struct lx6464es *chip)
1264{ 1275{
1265 snd_printdd("->lx_irq_enable\n"); 1276 dev_dbg(chip->card->dev, "->lx_irq_enable\n");
1266 lx_irq_set(chip, 1); 1277 lx_irq_set(chip, 1);
1267} 1278}
1268 1279
1269void lx_irq_disable(struct lx6464es *chip) 1280void lx_irq_disable(struct lx6464es *chip)
1270{ 1281{
1271 snd_printdd("->lx_irq_disable\n"); 1282 dev_dbg(chip->card->dev, "->lx_irq_disable\n");
1272 lx_irq_set(chip, 0); 1283 lx_irq_set(chip, 0);
1273} 1284}