diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2014-11-03 05:34:13 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-03 08:07:25 -0500 |
commit | b5b4a41b392960010fccf1f9ccf8334d612bd450 (patch) | |
tree | a017259a4e81f8c211d28bd66469bded68d31819 | |
parent | e369086968157415aeb11af3b57cd998c6721603 (diff) |
ALSA: echoaudio: remove all snd_printk
removed all references of snd_printk with the standard dev_* macro.
[a few places degraded to dev_dbg(), too -- tiwai]
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/echoaudio/darla20_dsp.c | 7 | ||||
-rw-r--r-- | sound/pci/echoaudio/darla24_dsp.c | 15 | ||||
-rw-r--r-- | sound/pci/echoaudio/echo3g_dsp.c | 7 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 137 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio.h | 28 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio_3g.c | 32 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio_dsp.c | 111 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio_gml.c | 11 | ||||
-rw-r--r-- | sound/pci/echoaudio/gina20_dsp.c | 15 | ||||
-rw-r--r-- | sound/pci/echoaudio/gina24_dsp.c | 39 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigo_dsp.c | 13 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigo_express_dsp.c | 6 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigodj_dsp.c | 13 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigodjx_dsp.c | 7 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigoio_dsp.c | 10 | ||||
-rw-r--r-- | sound/pci/echoaudio/indigoiox_dsp.c | 7 | ||||
-rw-r--r-- | sound/pci/echoaudio/layla20_dsp.c | 37 | ||||
-rw-r--r-- | sound/pci/echoaudio/layla24_dsp.c | 34 | ||||
-rw-r--r-- | sound/pci/echoaudio/mia_dsp.c | 17 | ||||
-rw-r--r-- | sound/pci/echoaudio/midi.c | 29 | ||||
-rw-r--r-- | sound/pci/echoaudio/mona_dsp.c | 35 |
21 files changed, 327 insertions, 283 deletions
diff --git a/sound/pci/echoaudio/darla20_dsp.c b/sound/pci/echoaudio/darla20_dsp.c index 20c7cbc89bb3..c94e92e31ae6 100644 --- a/sound/pci/echoaudio/darla20_dsp.c +++ b/sound/pci/echoaudio/darla20_dsp.c | |||
@@ -33,12 +33,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
33 | { | 33 | { |
34 | int err; | 34 | int err; |
35 | 35 | ||
36 | DE_INIT(("init_hw() - Darla20\n")); | 36 | dev_dbg(chip->card->dev, "init_hw() - Darla20\n"); |
37 | if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA20)) | 37 | if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA20)) |
38 | return -ENODEV; | 38 | return -ENODEV; |
39 | 39 | ||
40 | if ((err = init_dsp_comm_page(chip))) { | 40 | if ((err = init_dsp_comm_page(chip))) { |
41 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 41 | dev_err(chip->card->dev, |
42 | "init_hw: could not initialize DSP comm page\n"); | ||
42 | return err; | 43 | return err; |
43 | } | 44 | } |
44 | 45 | ||
@@ -57,7 +58,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
57 | return err; | 58 | return err; |
58 | chip->bad_board = FALSE; | 59 | chip->bad_board = FALSE; |
59 | 60 | ||
60 | DE_INIT(("init_hw done\n")); | 61 | dev_dbg(chip->card->dev, "init_hw: done\n"); |
61 | return err; | 62 | return err; |
62 | } | 63 | } |
63 | 64 | ||
diff --git a/sound/pci/echoaudio/darla24_dsp.c b/sound/pci/echoaudio/darla24_dsp.c index 6da6663e9176..b1272f88d59d 100644 --- a/sound/pci/echoaudio/darla24_dsp.c +++ b/sound/pci/echoaudio/darla24_dsp.c | |||
@@ -33,12 +33,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
33 | { | 33 | { |
34 | int err; | 34 | int err; |
35 | 35 | ||
36 | DE_INIT(("init_hw() - Darla24\n")); | 36 | dev_dbg(chip->card->dev, "init_hw() - Darla24\n"); |
37 | if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA24)) | 37 | if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA24)) |
38 | return -ENODEV; | 38 | return -ENODEV; |
39 | 39 | ||
40 | if ((err = init_dsp_comm_page(chip))) { | 40 | if ((err = init_dsp_comm_page(chip))) { |
41 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 41 | dev_err(chip->card->dev, |
42 | "init_hw: could not initialize DSP comm page\n"); | ||
42 | return err; | 43 | return err; |
43 | } | 44 | } |
44 | 45 | ||
@@ -56,7 +57,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
56 | return err; | 57 | return err; |
57 | chip->bad_board = FALSE; | 58 | chip->bad_board = FALSE; |
58 | 59 | ||
59 | DE_INIT(("init_hw done\n")); | 60 | dev_dbg(chip->card->dev, "init_hw: done\n"); |
60 | return err; | 61 | return err; |
61 | } | 62 | } |
62 | 63 | ||
@@ -128,15 +129,17 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
128 | clock = GD24_8000; | 129 | clock = GD24_8000; |
129 | break; | 130 | break; |
130 | default: | 131 | default: |
131 | DE_ACT(("set_sample_rate: Error, invalid sample rate %d\n", | 132 | dev_err(chip->card->dev, |
132 | rate)); | 133 | "set_sample_rate: Error, invalid sample rate %d\n", |
134 | rate); | ||
133 | return -EINVAL; | 135 | return -EINVAL; |
134 | } | 136 | } |
135 | 137 | ||
136 | if (wait_handshake(chip)) | 138 | if (wait_handshake(chip)) |
137 | return -EIO; | 139 | return -EIO; |
138 | 140 | ||
139 | DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock)); | 141 | dev_dbg(chip->card->dev, |
142 | "set_sample_rate: %d clock %d\n", rate, clock); | ||
140 | chip->sample_rate = rate; | 143 | chip->sample_rate = rate; |
141 | 144 | ||
142 | /* Override the sample rate if this card is set to Echo sync. */ | 145 | /* Override the sample rate if this card is set to Echo sync. */ |
diff --git a/sound/pci/echoaudio/echo3g_dsp.c b/sound/pci/echoaudio/echo3g_dsp.c index 3cdc2ee2d1dd..bc3716895fc8 100644 --- a/sound/pci/echoaudio/echo3g_dsp.c +++ b/sound/pci/echoaudio/echo3g_dsp.c | |||
@@ -46,12 +46,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
46 | int err; | 46 | int err; |
47 | 47 | ||
48 | local_irq_enable(); | 48 | local_irq_enable(); |
49 | DE_INIT(("init_hw() - Echo3G\n")); | 49 | dev_dbg(chip->card->dev, "init_hw() - Echo3G\n"); |
50 | if (snd_BUG_ON((subdevice_id & 0xfff0) != ECHO3G)) | 50 | if (snd_BUG_ON((subdevice_id & 0xfff0) != ECHO3G)) |
51 | return -ENODEV; | 51 | return -ENODEV; |
52 | 52 | ||
53 | if ((err = init_dsp_comm_page(chip))) { | 53 | if ((err = init_dsp_comm_page(chip))) { |
54 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 54 | dev_err(chip->card->dev, |
55 | "init_hw - could not initialize DSP comm page\n"); | ||
55 | return err; | 56 | return err; |
56 | } | 57 | } |
57 | 58 | ||
@@ -98,7 +99,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
98 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | | 99 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | |
99 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; | 100 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; |
100 | 101 | ||
101 | DE_INIT(("init_hw done\n")); | 102 | dev_dbg(chip->card->dev, "init_hw done\n"); |
102 | return err; | 103 | return err; |
103 | } | 104 | } |
104 | 105 | ||
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index db1b247d8587..1ef29e5b53a7 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -48,13 +48,16 @@ static int get_firmware(const struct firmware **fw_entry, | |||
48 | 48 | ||
49 | #ifdef CONFIG_PM_SLEEP | 49 | #ifdef CONFIG_PM_SLEEP |
50 | if (chip->fw_cache[fw_index]) { | 50 | if (chip->fw_cache[fw_index]) { |
51 | DE_ACT(("firmware requested: %s is cached\n", card_fw[fw_index].data)); | 51 | dev_dbg(chip->card->dev, |
52 | "firmware requested: %s is cached\n", | ||
53 | card_fw[fw_index].data); | ||
52 | *fw_entry = chip->fw_cache[fw_index]; | 54 | *fw_entry = chip->fw_cache[fw_index]; |
53 | return 0; | 55 | return 0; |
54 | } | 56 | } |
55 | #endif | 57 | #endif |
56 | 58 | ||
57 | DE_ACT(("firmware requested: %s\n", card_fw[fw_index].data)); | 59 | dev_dbg(chip->card->dev, |
60 | "firmware requested: %s\n", card_fw[fw_index].data); | ||
58 | snprintf(name, sizeof(name), "ea/%s", card_fw[fw_index].data); | 61 | snprintf(name, sizeof(name), "ea/%s", card_fw[fw_index].data); |
59 | err = request_firmware(fw_entry, name, pci_device(chip)); | 62 | err = request_firmware(fw_entry, name, pci_device(chip)); |
60 | if (err < 0) | 63 | if (err < 0) |
@@ -73,10 +76,10 @@ static void free_firmware(const struct firmware *fw_entry, | |||
73 | struct echoaudio *chip) | 76 | struct echoaudio *chip) |
74 | { | 77 | { |
75 | #ifdef CONFIG_PM_SLEEP | 78 | #ifdef CONFIG_PM_SLEEP |
76 | DE_ACT(("firmware not released (kept in cache)\n")); | 79 | dev_dbg(chip->card->dev, "firmware not released (kept in cache)\n"); |
77 | #else | 80 | #else |
78 | release_firmware(fw_entry); | 81 | release_firmware(fw_entry); |
79 | DE_ACT(("firmware released\n")); | 82 | dev_dbg(chip->card->dev, "firmware released\n"); |
80 | #endif | 83 | #endif |
81 | } | 84 | } |
82 | 85 | ||
@@ -90,10 +93,10 @@ static void free_firmware_cache(struct echoaudio *chip) | |||
90 | for (i = 0; i < 8 ; i++) | 93 | for (i = 0; i < 8 ; i++) |
91 | if (chip->fw_cache[i]) { | 94 | if (chip->fw_cache[i]) { |
92 | release_firmware(chip->fw_cache[i]); | 95 | release_firmware(chip->fw_cache[i]); |
93 | DE_ACT(("release_firmware(%d)\n", i)); | 96 | dev_dbg(chip->card->dev, "release_firmware(%d)\n", i); |
94 | } | 97 | } |
95 | 98 | ||
96 | DE_ACT(("firmware_cache released\n")); | 99 | dev_dbg(chip->card->dev, "firmware_cache released\n"); |
97 | #endif | 100 | #endif |
98 | } | 101 | } |
99 | 102 | ||
@@ -287,7 +290,7 @@ static int pcm_open(struct snd_pcm_substream *substream, | |||
287 | 290 | ||
288 | /* Set up hw capabilities and contraints */ | 291 | /* Set up hw capabilities and contraints */ |
289 | memcpy(&pipe->hw, &pcm_hardware_skel, sizeof(struct snd_pcm_hardware)); | 292 | memcpy(&pipe->hw, &pcm_hardware_skel, sizeof(struct snd_pcm_hardware)); |
290 | DE_HWP(("max_channels=%d\n", max_channels)); | 293 | dev_dbg(chip->card->dev, "max_channels=%d\n", max_channels); |
291 | pipe->constr.list = channels_list; | 294 | pipe->constr.list = channels_list; |
292 | pipe->constr.mask = 0; | 295 | pipe->constr.mask = 0; |
293 | for (i = 0; channels_list[i] <= max_channels; i++); | 296 | for (i = 0; channels_list[i] <= max_channels; i++); |
@@ -337,7 +340,7 @@ static int pcm_open(struct snd_pcm_substream *substream, | |||
337 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, | 340 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, |
338 | snd_dma_pci_data(chip->pci), | 341 | snd_dma_pci_data(chip->pci), |
339 | PAGE_SIZE, &pipe->sgpage)) < 0) { | 342 | PAGE_SIZE, &pipe->sgpage)) < 0) { |
340 | DE_HWP(("s-g list allocation failed\n")); | 343 | dev_err(chip->card->dev, "s-g list allocation failed\n"); |
341 | return err; | 344 | return err; |
342 | } | 345 | } |
343 | 346 | ||
@@ -351,7 +354,7 @@ static int pcm_analog_in_open(struct snd_pcm_substream *substream) | |||
351 | struct echoaudio *chip = snd_pcm_substream_chip(substream); | 354 | struct echoaudio *chip = snd_pcm_substream_chip(substream); |
352 | int err; | 355 | int err; |
353 | 356 | ||
354 | DE_ACT(("pcm_analog_in_open\n")); | 357 | dev_dbg(chip->card->dev, "pcm_analog_in_open\n"); |
355 | if ((err = pcm_open(substream, num_analog_busses_in(chip) - | 358 | if ((err = pcm_open(substream, num_analog_busses_in(chip) - |
356 | substream->number)) < 0) | 359 | substream->number)) < 0) |
357 | return err; | 360 | return err; |
@@ -368,9 +371,9 @@ static int pcm_analog_in_open(struct snd_pcm_substream *substream) | |||
368 | atomic_inc(&chip->opencount); | 371 | atomic_inc(&chip->opencount); |
369 | if (atomic_read(&chip->opencount) > 1 && chip->rate_set) | 372 | if (atomic_read(&chip->opencount) > 1 && chip->rate_set) |
370 | chip->can_set_rate=0; | 373 | chip->can_set_rate=0; |
371 | DE_HWP(("pcm_analog_in_open cs=%d oc=%d r=%d\n", | 374 | dev_dbg(chip->card->dev, "pcm_analog_in_open cs=%d oc=%d r=%d\n", |
372 | chip->can_set_rate, atomic_read(&chip->opencount), | 375 | chip->can_set_rate, atomic_read(&chip->opencount), |
373 | chip->sample_rate)); | 376 | chip->sample_rate); |
374 | return 0; | 377 | return 0; |
375 | } | 378 | } |
376 | 379 | ||
@@ -386,7 +389,7 @@ static int pcm_analog_out_open(struct snd_pcm_substream *substream) | |||
386 | #else | 389 | #else |
387 | max_channels = num_analog_busses_out(chip); | 390 | max_channels = num_analog_busses_out(chip); |
388 | #endif | 391 | #endif |
389 | DE_ACT(("pcm_analog_out_open\n")); | 392 | dev_dbg(chip->card->dev, "pcm_analog_out_open\n"); |
390 | if ((err = pcm_open(substream, max_channels - substream->number)) < 0) | 393 | if ((err = pcm_open(substream, max_channels - substream->number)) < 0) |
391 | return err; | 394 | return err; |
392 | if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, | 395 | if ((err = snd_pcm_hw_rule_add(substream->runtime, 0, |
@@ -404,9 +407,9 @@ static int pcm_analog_out_open(struct snd_pcm_substream *substream) | |||
404 | atomic_inc(&chip->opencount); | 407 | atomic_inc(&chip->opencount); |
405 | if (atomic_read(&chip->opencount) > 1 && chip->rate_set) | 408 | if (atomic_read(&chip->opencount) > 1 && chip->rate_set) |
406 | chip->can_set_rate=0; | 409 | chip->can_set_rate=0; |
407 | DE_HWP(("pcm_analog_out_open cs=%d oc=%d r=%d\n", | 410 | dev_dbg(chip->card->dev, "pcm_analog_out_open cs=%d oc=%d r=%d\n", |
408 | chip->can_set_rate, atomic_read(&chip->opencount), | 411 | chip->can_set_rate, atomic_read(&chip->opencount), |
409 | chip->sample_rate)); | 412 | chip->sample_rate); |
410 | return 0; | 413 | return 0; |
411 | } | 414 | } |
412 | 415 | ||
@@ -419,7 +422,7 @@ static int pcm_digital_in_open(struct snd_pcm_substream *substream) | |||
419 | struct echoaudio *chip = snd_pcm_substream_chip(substream); | 422 | struct echoaudio *chip = snd_pcm_substream_chip(substream); |
420 | int err, max_channels; | 423 | int err, max_channels; |
421 | 424 | ||
422 | DE_ACT(("pcm_digital_in_open\n")); | 425 | dev_dbg(chip->card->dev, "pcm_digital_in_open\n"); |
423 | max_channels = num_digital_busses_in(chip) - substream->number; | 426 | max_channels = num_digital_busses_in(chip) - substream->number; |
424 | mutex_lock(&chip->mode_mutex); | 427 | mutex_lock(&chip->mode_mutex); |
425 | if (chip->digital_mode == DIGITAL_MODE_ADAT) | 428 | if (chip->digital_mode == DIGITAL_MODE_ADAT) |
@@ -461,7 +464,7 @@ static int pcm_digital_out_open(struct snd_pcm_substream *substream) | |||
461 | struct echoaudio *chip = snd_pcm_substream_chip(substream); | 464 | struct echoaudio *chip = snd_pcm_substream_chip(substream); |
462 | int err, max_channels; | 465 | int err, max_channels; |
463 | 466 | ||
464 | DE_ACT(("pcm_digital_out_open\n")); | 467 | dev_dbg(chip->card->dev, "pcm_digital_out_open\n"); |
465 | max_channels = num_digital_busses_out(chip) - substream->number; | 468 | max_channels = num_digital_busses_out(chip) - substream->number; |
466 | mutex_lock(&chip->mode_mutex); | 469 | mutex_lock(&chip->mode_mutex); |
467 | if (chip->digital_mode == DIGITAL_MODE_ADAT) | 470 | if (chip->digital_mode == DIGITAL_MODE_ADAT) |
@@ -508,18 +511,18 @@ static int pcm_close(struct snd_pcm_substream *substream) | |||
508 | /* Nothing to do here. Audio is already off and pipe will be | 511 | /* Nothing to do here. Audio is already off and pipe will be |
509 | * freed by its callback | 512 | * freed by its callback |
510 | */ | 513 | */ |
511 | DE_ACT(("pcm_close\n")); | 514 | dev_dbg(chip->card->dev, "pcm_close\n"); |
512 | 515 | ||
513 | atomic_dec(&chip->opencount); | 516 | atomic_dec(&chip->opencount); |
514 | oc = atomic_read(&chip->opencount); | 517 | oc = atomic_read(&chip->opencount); |
515 | DE_ACT(("pcm_close oc=%d cs=%d rs=%d\n", oc, | 518 | dev_dbg(chip->card->dev, "pcm_close oc=%d cs=%d rs=%d\n", oc, |
516 | chip->can_set_rate, chip->rate_set)); | 519 | chip->can_set_rate, chip->rate_set); |
517 | if (oc < 2) | 520 | if (oc < 2) |
518 | chip->can_set_rate = 1; | 521 | chip->can_set_rate = 1; |
519 | if (oc == 0) | 522 | if (oc == 0) |
520 | chip->rate_set = 0; | 523 | chip->rate_set = 0; |
521 | DE_ACT(("pcm_close2 oc=%d cs=%d rs=%d\n", oc, | 524 | dev_dbg(chip->card->dev, "pcm_close2 oc=%d cs=%d rs=%d\n", oc, |
522 | chip->can_set_rate,chip->rate_set)); | 525 | chip->can_set_rate, chip->rate_set); |
523 | 526 | ||
524 | return 0; | 527 | return 0; |
525 | } | 528 | } |
@@ -543,7 +546,7 @@ static int init_engine(struct snd_pcm_substream *substream, | |||
543 | */ | 546 | */ |
544 | spin_lock_irq(&chip->lock); | 547 | spin_lock_irq(&chip->lock); |
545 | if (pipe->index >= 0) { | 548 | if (pipe->index >= 0) { |
546 | DE_HWP(("hwp_ie free(%d)\n", pipe->index)); | 549 | dev_dbg(chip->card->dev, "hwp_ie free(%d)\n", pipe->index); |
547 | err = free_pipes(chip, pipe); | 550 | err = free_pipes(chip, pipe); |
548 | snd_BUG_ON(err); | 551 | snd_BUG_ON(err); |
549 | chip->substream[pipe->index] = NULL; | 552 | chip->substream[pipe->index] = NULL; |
@@ -552,16 +555,17 @@ static int init_engine(struct snd_pcm_substream *substream, | |||
552 | err = allocate_pipes(chip, pipe, pipe_index, interleave); | 555 | err = allocate_pipes(chip, pipe, pipe_index, interleave); |
553 | if (err < 0) { | 556 | if (err < 0) { |
554 | spin_unlock_irq(&chip->lock); | 557 | spin_unlock_irq(&chip->lock); |
555 | DE_ACT((KERN_NOTICE "allocate_pipes(%d) err=%d\n", | 558 | dev_err(chip->card->dev, "allocate_pipes(%d) err=%d\n", |
556 | pipe_index, err)); | 559 | pipe_index, err); |
557 | return err; | 560 | return err; |
558 | } | 561 | } |
559 | spin_unlock_irq(&chip->lock); | 562 | spin_unlock_irq(&chip->lock); |
560 | DE_ACT((KERN_NOTICE "allocate_pipes()=%d\n", pipe_index)); | 563 | dev_dbg(chip->card->dev, "allocate_pipes()=%d\n", pipe_index); |
561 | 564 | ||
562 | DE_HWP(("pcm_hw_params (bufsize=%dB periods=%d persize=%dB)\n", | 565 | dev_dbg(chip->card->dev, |
566 | "pcm_hw_params (bufsize=%dB periods=%d persize=%dB)\n", | ||
563 | params_buffer_bytes(hw_params), params_periods(hw_params), | 567 | params_buffer_bytes(hw_params), params_periods(hw_params), |
564 | params_period_bytes(hw_params))); | 568 | params_period_bytes(hw_params)); |
565 | err = snd_pcm_lib_malloc_pages(substream, | 569 | err = snd_pcm_lib_malloc_pages(substream, |
566 | params_buffer_bytes(hw_params)); | 570 | params_buffer_bytes(hw_params)); |
567 | if (err < 0) { | 571 | if (err < 0) { |
@@ -616,7 +620,7 @@ static int init_engine(struct snd_pcm_substream *substream, | |||
616 | spin_lock_irq(&chip->lock); | 620 | spin_lock_irq(&chip->lock); |
617 | set_sample_rate(chip, hw_params->rate_num / hw_params->rate_den); | 621 | set_sample_rate(chip, hw_params->rate_num / hw_params->rate_den); |
618 | spin_unlock_irq(&chip->lock); | 622 | spin_unlock_irq(&chip->lock); |
619 | DE_HWP(("pcm_hw_params ok\n")); | 623 | dev_dbg(chip->card->dev, "pcm_hw_params ok\n"); |
620 | return 0; | 624 | return 0; |
621 | } | 625 | } |
622 | 626 | ||
@@ -680,14 +684,14 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) | |||
680 | 684 | ||
681 | spin_lock_irq(&chip->lock); | 685 | spin_lock_irq(&chip->lock); |
682 | if (pipe->index >= 0) { | 686 | if (pipe->index >= 0) { |
683 | DE_HWP(("pcm_hw_free(%d)\n", pipe->index)); | 687 | dev_dbg(chip->card->dev, "pcm_hw_free(%d)\n", pipe->index); |
684 | free_pipes(chip, pipe); | 688 | free_pipes(chip, pipe); |
685 | chip->substream[pipe->index] = NULL; | 689 | chip->substream[pipe->index] = NULL; |
686 | pipe->index = -1; | 690 | pipe->index = -1; |
687 | } | 691 | } |
688 | spin_unlock_irq(&chip->lock); | 692 | spin_unlock_irq(&chip->lock); |
689 | 693 | ||
690 | DE_HWP(("pcm_hw_freed\n")); | 694 | dev_dbg(chip->card->dev, "pcm_hw_freed\n"); |
691 | snd_pcm_lib_free_pages(substream); | 695 | snd_pcm_lib_free_pages(substream); |
692 | return 0; | 696 | return 0; |
693 | } | 697 | } |
@@ -701,8 +705,8 @@ static int pcm_prepare(struct snd_pcm_substream *substream) | |||
701 | struct audioformat format; | 705 | struct audioformat format; |
702 | int pipe_index = ((struct audiopipe *)runtime->private_data)->index; | 706 | int pipe_index = ((struct audiopipe *)runtime->private_data)->index; |
703 | 707 | ||
704 | DE_HWP(("Prepare rate=%d format=%d channels=%d\n", | 708 | dev_dbg(chip->card->dev, "Prepare rate=%d format=%d channels=%d\n", |
705 | runtime->rate, runtime->format, runtime->channels)); | 709 | runtime->rate, runtime->format, runtime->channels); |
706 | format.interleave = runtime->channels; | 710 | format.interleave = runtime->channels; |
707 | format.data_are_bigendian = 0; | 711 | format.data_are_bigendian = 0; |
708 | format.mono_to_stereo = 0; | 712 | format.mono_to_stereo = 0; |
@@ -722,8 +726,9 @@ static int pcm_prepare(struct snd_pcm_substream *substream) | |||
722 | format.bits_per_sample = 32; | 726 | format.bits_per_sample = 32; |
723 | break; | 727 | break; |
724 | default: | 728 | default: |
725 | DE_HWP(("Prepare error: unsupported format %d\n", | 729 | dev_err(chip->card->dev, |
726 | runtime->format)); | 730 | "Prepare error: unsupported format %d\n", |
731 | runtime->format); | ||
727 | return -EINVAL; | 732 | return -EINVAL; |
728 | } | 733 | } |
729 | 734 | ||
@@ -758,10 +763,10 @@ static int pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
758 | spin_lock(&chip->lock); | 763 | spin_lock(&chip->lock); |
759 | switch (cmd) { | 764 | switch (cmd) { |
760 | case SNDRV_PCM_TRIGGER_RESUME: | 765 | case SNDRV_PCM_TRIGGER_RESUME: |
761 | DE_ACT(("pcm_trigger resume\n")); | 766 | dev_dbg(chip->card->dev, "pcm_trigger resume\n"); |
762 | case SNDRV_PCM_TRIGGER_START: | 767 | case SNDRV_PCM_TRIGGER_START: |
763 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 768 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
764 | DE_ACT(("pcm_trigger start\n")); | 769 | dev_dbg(chip->card->dev, "pcm_trigger start\n"); |
765 | for (i = 0; i < DSP_MAXPIPES; i++) { | 770 | for (i = 0; i < DSP_MAXPIPES; i++) { |
766 | if (channelmask & (1 << i)) { | 771 | if (channelmask & (1 << i)) { |
767 | pipe = chip->substream[i]->runtime->private_data; | 772 | pipe = chip->substream[i]->runtime->private_data; |
@@ -783,9 +788,9 @@ static int pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
783 | chip->pipe_cyclic_mask); | 788 | chip->pipe_cyclic_mask); |
784 | break; | 789 | break; |
785 | case SNDRV_PCM_TRIGGER_SUSPEND: | 790 | case SNDRV_PCM_TRIGGER_SUSPEND: |
786 | DE_ACT(("pcm_trigger suspend\n")); | 791 | dev_dbg(chip->card->dev, "pcm_trigger suspend\n"); |
787 | case SNDRV_PCM_TRIGGER_STOP: | 792 | case SNDRV_PCM_TRIGGER_STOP: |
788 | DE_ACT(("pcm_trigger stop\n")); | 793 | dev_dbg(chip->card->dev, "pcm_trigger stop\n"); |
789 | for (i = 0; i < DSP_MAXPIPES; i++) { | 794 | for (i = 0; i < DSP_MAXPIPES; i++) { |
790 | if (channelmask & (1 << i)) { | 795 | if (channelmask & (1 << i)) { |
791 | pipe = chip->substream[i]->runtime->private_data; | 796 | pipe = chip->substream[i]->runtime->private_data; |
@@ -795,7 +800,7 @@ static int pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
795 | err = stop_transport(chip, channelmask); | 800 | err = stop_transport(chip, channelmask); |
796 | break; | 801 | break; |
797 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 802 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
798 | DE_ACT(("pcm_trigger pause\n")); | 803 | dev_dbg(chip->card->dev, "pcm_trigger pause\n"); |
799 | for (i = 0; i < DSP_MAXPIPES; i++) { | 804 | for (i = 0; i < DSP_MAXPIPES; i++) { |
800 | if (channelmask & (1 << i)) { | 805 | if (channelmask & (1 << i)) { |
801 | pipe = chip->substream[i]->runtime->private_data; | 806 | pipe = chip->substream[i]->runtime->private_data; |
@@ -932,7 +937,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip) | |||
932 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &analog_capture_ops); | 937 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &analog_capture_ops); |
933 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) | 938 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) |
934 | return err; | 939 | return err; |
935 | DE_INIT(("Analog PCM ok\n")); | 940 | dev_dbg(chip->card->dev, "Analog PCM ok\n"); |
936 | 941 | ||
937 | #ifdef ECHOCARD_HAS_DIGITAL_IO | 942 | #ifdef ECHOCARD_HAS_DIGITAL_IO |
938 | /* PCM#1 Digital inputs, no outputs */ | 943 | /* PCM#1 Digital inputs, no outputs */ |
@@ -945,7 +950,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip) | |||
945 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &digital_capture_ops); | 950 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &digital_capture_ops); |
946 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) | 951 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) |
947 | return err; | 952 | return err; |
948 | DE_INIT(("Digital PCM ok\n")); | 953 | dev_dbg(chip->card->dev, "Digital PCM ok\n"); |
949 | #endif /* ECHOCARD_HAS_DIGITAL_IO */ | 954 | #endif /* ECHOCARD_HAS_DIGITAL_IO */ |
950 | 955 | ||
951 | #else /* ECHOCARD_HAS_VMIXER */ | 956 | #else /* ECHOCARD_HAS_VMIXER */ |
@@ -967,7 +972,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip) | |||
967 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &analog_capture_ops); | 972 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &analog_capture_ops); |
968 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) | 973 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) |
969 | return err; | 974 | return err; |
970 | DE_INIT(("Analog PCM ok\n")); | 975 | dev_dbg(chip->card->dev, "Analog PCM ok\n"); |
971 | 976 | ||
972 | #ifdef ECHOCARD_HAS_DIGITAL_IO | 977 | #ifdef ECHOCARD_HAS_DIGITAL_IO |
973 | /* PCM#1 Digital i/o */ | 978 | /* PCM#1 Digital i/o */ |
@@ -982,7 +987,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip) | |||
982 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &digital_capture_ops); | 987 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &digital_capture_ops); |
983 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) | 988 | if ((err = snd_echo_preallocate_pages(pcm, snd_dma_pci_data(chip->pci))) < 0) |
984 | return err; | 989 | return err; |
985 | DE_INIT(("Digital PCM ok\n")); | 990 | dev_dbg(chip->card->dev, "Digital PCM ok\n"); |
986 | #endif /* ECHOCARD_HAS_DIGITAL_IO */ | 991 | #endif /* ECHOCARD_HAS_DIGITAL_IO */ |
987 | 992 | ||
988 | #endif /* ECHOCARD_HAS_VMIXER */ | 993 | #endif /* ECHOCARD_HAS_VMIXER */ |
@@ -1475,7 +1480,8 @@ static int snd_echo_digital_mode_put(struct snd_kcontrol *kcontrol, | |||
1475 | snd_ctl_notify(chip->card, | 1480 | snd_ctl_notify(chip->card, |
1476 | SNDRV_CTL_EVENT_MASK_VALUE, | 1481 | SNDRV_CTL_EVENT_MASK_VALUE, |
1477 | &chip->clock_src_ctl->id); | 1482 | &chip->clock_src_ctl->id); |
1478 | DE_ACT(("SDM() =%d\n", changed)); | 1483 | dev_dbg(chip->card->dev, |
1484 | "SDM() =%d\n", changed); | ||
1479 | } | 1485 | } |
1480 | if (changed >= 0) | 1486 | if (changed >= 0) |
1481 | changed = 1; /* No errors */ | 1487 | changed = 1; /* No errors */ |
@@ -1602,7 +1608,8 @@ static int snd_echo_clock_source_put(struct snd_kcontrol *kcontrol, | |||
1602 | } | 1608 | } |
1603 | 1609 | ||
1604 | if (changed < 0) | 1610 | if (changed < 0) |
1605 | DE_ACT(("seticlk val%d err 0x%x\n", dclock, changed)); | 1611 | dev_dbg(chip->card->dev, |
1612 | "seticlk val%d err 0x%x\n", dclock, changed); | ||
1606 | 1613 | ||
1607 | return changed; | 1614 | return changed; |
1608 | } | 1615 | } |
@@ -1859,7 +1866,7 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id) | |||
1859 | #ifdef ECHOCARD_HAS_MIDI | 1866 | #ifdef ECHOCARD_HAS_MIDI |
1860 | if (st > 0 && chip->midi_in) { | 1867 | if (st > 0 && chip->midi_in) { |
1861 | snd_rawmidi_receive(chip->midi_in, chip->midi_buffer, st); | 1868 | snd_rawmidi_receive(chip->midi_in, chip->midi_buffer, st); |
1862 | DE_MID(("rawmidi_iread=%d\n", st)); | 1869 | dev_dbg(chip->card->dev, "rawmidi_iread=%d\n", st); |
1863 | } | 1870 | } |
1864 | #endif | 1871 | #endif |
1865 | return IRQ_HANDLED; | 1872 | return IRQ_HANDLED; |
@@ -1874,10 +1881,10 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id) | |||
1874 | 1881 | ||
1875 | static int snd_echo_free(struct echoaudio *chip) | 1882 | static int snd_echo_free(struct echoaudio *chip) |
1876 | { | 1883 | { |
1877 | DE_INIT(("Stop DSP...\n")); | 1884 | dev_dbg(chip->card->dev, "Stop DSP...\n"); |
1878 | if (chip->comm_page) | 1885 | if (chip->comm_page) |
1879 | rest_in_peace(chip); | 1886 | rest_in_peace(chip); |
1880 | DE_INIT(("Stopped.\n")); | 1887 | dev_dbg(chip->card->dev, "Stopped.\n"); |
1881 | 1888 | ||
1882 | if (chip->irq >= 0) | 1889 | if (chip->irq >= 0) |
1883 | free_irq(chip->irq, chip); | 1890 | free_irq(chip->irq, chip); |
@@ -1891,14 +1898,14 @@ static int snd_echo_free(struct echoaudio *chip) | |||
1891 | if (chip->iores) | 1898 | if (chip->iores) |
1892 | release_and_free_resource(chip->iores); | 1899 | release_and_free_resource(chip->iores); |
1893 | 1900 | ||
1894 | DE_INIT(("MMIO freed.\n")); | 1901 | dev_dbg(chip->card->dev, "MMIO freed.\n"); |
1895 | 1902 | ||
1896 | pci_disable_device(chip->pci); | 1903 | pci_disable_device(chip->pci); |
1897 | 1904 | ||
1898 | /* release chip data */ | 1905 | /* release chip data */ |
1899 | free_firmware_cache(chip); | 1906 | free_firmware_cache(chip); |
1900 | kfree(chip); | 1907 | kfree(chip); |
1901 | DE_INIT(("Chip freed.\n")); | 1908 | dev_dbg(chip->card->dev, "Chip freed.\n"); |
1902 | return 0; | 1909 | return 0; |
1903 | } | 1910 | } |
1904 | 1911 | ||
@@ -1908,7 +1915,7 @@ static int snd_echo_dev_free(struct snd_device *device) | |||
1908 | { | 1915 | { |
1909 | struct echoaudio *chip = device->device_data; | 1916 | struct echoaudio *chip = device->device_data; |
1910 | 1917 | ||
1911 | DE_INIT(("snd_echo_dev_free()...\n")); | 1918 | dev_dbg(chip->card->dev, "snd_echo_dev_free()...\n"); |
1912 | return snd_echo_free(chip); | 1919 | return snd_echo_free(chip); |
1913 | } | 1920 | } |
1914 | 1921 | ||
@@ -1941,7 +1948,7 @@ static int snd_echo_create(struct snd_card *card, | |||
1941 | pci_disable_device(pci); | 1948 | pci_disable_device(pci); |
1942 | return -ENOMEM; | 1949 | return -ENOMEM; |
1943 | } | 1950 | } |
1944 | DE_INIT(("chip=%p\n", chip)); | 1951 | dev_dbg(card->dev, "chip=%p\n", chip); |
1945 | spin_lock_init(&chip->lock); | 1952 | spin_lock_init(&chip->lock); |
1946 | chip->card = card; | 1953 | chip->card = card; |
1947 | chip->pci = pci; | 1954 | chip->pci = pci; |
@@ -1978,8 +1985,8 @@ static int snd_echo_create(struct snd_card *card, | |||
1978 | return -EBUSY; | 1985 | return -EBUSY; |
1979 | } | 1986 | } |
1980 | chip->irq = pci->irq; | 1987 | chip->irq = pci->irq; |
1981 | DE_INIT(("pci=%p irq=%d subdev=%04x Init hardware...\n", | 1988 | dev_dbg(card->dev, "pci=%p irq=%d subdev=%04x Init hardware...\n", |
1982 | chip->pci, chip->irq, chip->pci->subsystem_device)); | 1989 | chip->pci, chip->irq, chip->pci->subsystem_device); |
1983 | 1990 | ||
1984 | /* Create the DSP comm page - this is the area of memory used for most | 1991 | /* Create the DSP comm page - this is the area of memory used for most |
1985 | of the communication with the DSP, which accesses it via bus mastering */ | 1992 | of the communication with the DSP, which accesses it via bus mastering */ |
@@ -1997,11 +2004,11 @@ static int snd_echo_create(struct snd_card *card, | |||
1997 | if (err >= 0) | 2004 | if (err >= 0) |
1998 | err = set_mixer_defaults(chip); | 2005 | err = set_mixer_defaults(chip); |
1999 | if (err < 0) { | 2006 | if (err < 0) { |
2000 | DE_INIT(("init_hw err=%d\n", err)); | 2007 | dev_err(card->dev, "init_hw err=%d\n", err); |
2001 | snd_echo_free(chip); | 2008 | snd_echo_free(chip); |
2002 | return err; | 2009 | return err; |
2003 | } | 2010 | } |
2004 | DE_INIT(("Card init OK\n")); | 2011 | dev_dbg(card->dev, "Card init OK\n"); |
2005 | 2012 | ||
2006 | if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { | 2013 | if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { |
2007 | snd_echo_free(chip); | 2014 | snd_echo_free(chip); |
@@ -2031,7 +2038,7 @@ static int snd_echo_probe(struct pci_dev *pci, | |||
2031 | return -ENOENT; | 2038 | return -ENOENT; |
2032 | } | 2039 | } |
2033 | 2040 | ||
2034 | DE_INIT(("Echoaudio driver starting...\n")); | 2041 | dev_dbg(&pci->dev, "Echoaudio driver starting...\n"); |
2035 | i = 0; | 2042 | i = 0; |
2036 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | 2043 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, |
2037 | 0, &card); | 2044 | 0, &card); |
@@ -2184,7 +2191,7 @@ static int snd_echo_suspend(struct device *dev) | |||
2184 | struct pci_dev *pci = to_pci_dev(dev); | 2191 | struct pci_dev *pci = to_pci_dev(dev); |
2185 | struct echoaudio *chip = dev_get_drvdata(dev); | 2192 | struct echoaudio *chip = dev_get_drvdata(dev); |
2186 | 2193 | ||
2187 | DE_INIT(("suspend start\n")); | 2194 | dev_dbg(dev, "suspend start\n"); |
2188 | snd_pcm_suspend_all(chip->analog_pcm); | 2195 | snd_pcm_suspend_all(chip->analog_pcm); |
2189 | snd_pcm_suspend_all(chip->digital_pcm); | 2196 | snd_pcm_suspend_all(chip->digital_pcm); |
2190 | 2197 | ||
@@ -2211,7 +2218,7 @@ static int snd_echo_suspend(struct device *dev) | |||
2211 | pci_save_state(pci); | 2218 | pci_save_state(pci); |
2212 | pci_disable_device(pci); | 2219 | pci_disable_device(pci); |
2213 | 2220 | ||
2214 | DE_INIT(("suspend done\n")); | 2221 | dev_dbg(dev, "suspend done\n"); |
2215 | return 0; | 2222 | return 0; |
2216 | } | 2223 | } |
2217 | 2224 | ||
@@ -2225,7 +2232,7 @@ static int snd_echo_resume(struct device *dev) | |||
2225 | u32 pipe_alloc_mask; | 2232 | u32 pipe_alloc_mask; |
2226 | int err; | 2233 | int err; |
2227 | 2234 | ||
2228 | DE_INIT(("resume start\n")); | 2235 | dev_dbg(dev, "resume start\n"); |
2229 | pci_restore_state(pci); | 2236 | pci_restore_state(pci); |
2230 | commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); | 2237 | commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); |
2231 | if (commpage_bak == NULL) | 2238 | if (commpage_bak == NULL) |
@@ -2236,11 +2243,11 @@ static int snd_echo_resume(struct device *dev) | |||
2236 | err = init_hw(chip, chip->pci->device, chip->pci->subsystem_device); | 2243 | err = init_hw(chip, chip->pci->device, chip->pci->subsystem_device); |
2237 | if (err < 0) { | 2244 | if (err < 0) { |
2238 | kfree(commpage_bak); | 2245 | kfree(commpage_bak); |
2239 | DE_INIT(("resume init_hw err=%d\n", err)); | 2246 | dev_err(dev, "resume init_hw err=%d\n", err); |
2240 | snd_echo_free(chip); | 2247 | snd_echo_free(chip); |
2241 | return err; | 2248 | return err; |
2242 | } | 2249 | } |
2243 | DE_INIT(("resume init OK\n")); | 2250 | dev_dbg(dev, "resume init OK\n"); |
2244 | 2251 | ||
2245 | /* Temporarily set chip->pipe_alloc_mask=0 otherwise | 2252 | /* Temporarily set chip->pipe_alloc_mask=0 otherwise |
2246 | * restore_dsp_settings() fails. | 2253 | * restore_dsp_settings() fails. |
@@ -2253,7 +2260,7 @@ static int snd_echo_resume(struct device *dev) | |||
2253 | kfree(commpage_bak); | 2260 | kfree(commpage_bak); |
2254 | return err; | 2261 | return err; |
2255 | } | 2262 | } |
2256 | DE_INIT(("resume restore OK\n")); | 2263 | dev_dbg(dev, "resume restore OK\n"); |
2257 | 2264 | ||
2258 | memcpy(&commpage->audio_format, &commpage_bak->audio_format, | 2265 | memcpy(&commpage->audio_format, &commpage_bak->audio_format, |
2259 | sizeof(commpage->audio_format)); | 2266 | sizeof(commpage->audio_format)); |
@@ -2270,7 +2277,7 @@ static int snd_echo_resume(struct device *dev) | |||
2270 | return -EBUSY; | 2277 | return -EBUSY; |
2271 | } | 2278 | } |
2272 | chip->irq = pci->irq; | 2279 | chip->irq = pci->irq; |
2273 | DE_INIT(("resume irq=%d\n", chip->irq)); | 2280 | dev_dbg(dev, "resume irq=%d\n", chip->irq); |
2274 | 2281 | ||
2275 | #ifdef ECHOCARD_HAS_MIDI | 2282 | #ifdef ECHOCARD_HAS_MIDI |
2276 | if (chip->midi_input_enabled) | 2283 | if (chip->midi_input_enabled) |
@@ -2279,7 +2286,7 @@ static int snd_echo_resume(struct device *dev) | |||
2279 | snd_echo_midi_output_trigger(chip->midi_out, 1); | 2286 | snd_echo_midi_output_trigger(chip->midi_out, 1); |
2280 | #endif | 2287 | #endif |
2281 | 2288 | ||
2282 | DE_INIT(("resume done\n")); | 2289 | dev_dbg(dev, "resume done\n"); |
2283 | return 0; | 2290 | return 0; |
2284 | } | 2291 | } |
2285 | 2292 | ||
diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h index a4f112aa78e2..32515227a692 100644 --- a/sound/pci/echoaudio/echoaudio.h +++ b/sound/pci/echoaudio/echoaudio.h | |||
@@ -295,34 +295,6 @@ | |||
295 | #define PIPE_STATE_PENDING 3 /* Pipe has pending start */ | 295 | #define PIPE_STATE_PENDING 3 /* Pipe has pending start */ |
296 | 296 | ||
297 | 297 | ||
298 | /* Debug initialization */ | ||
299 | #ifdef CONFIG_SND_DEBUG | ||
300 | #define DE_INIT(x) snd_printk x | ||
301 | #else | ||
302 | #define DE_INIT(x) | ||
303 | #endif | ||
304 | |||
305 | /* Debug hw_params callbacks */ | ||
306 | #ifdef CONFIG_SND_DEBUG | ||
307 | #define DE_HWP(x) snd_printk x | ||
308 | #else | ||
309 | #define DE_HWP(x) | ||
310 | #endif | ||
311 | |||
312 | /* Debug normal activity (open, start, stop...) */ | ||
313 | #ifdef CONFIG_SND_DEBUG | ||
314 | #define DE_ACT(x) snd_printk x | ||
315 | #else | ||
316 | #define DE_ACT(x) | ||
317 | #endif | ||
318 | |||
319 | /* Debug midi activity */ | ||
320 | #ifdef CONFIG_SND_DEBUG | ||
321 | #define DE_MID(x) snd_printk x | ||
322 | #else | ||
323 | #define DE_MID(x) | ||
324 | #endif | ||
325 | |||
326 | 298 | ||
327 | struct audiopipe { | 299 | struct audiopipe { |
328 | volatile u32 *dma_counter; /* Commpage register that contains | 300 | volatile u32 *dma_counter; /* Commpage register that contains |
diff --git a/sound/pci/echoaudio/echoaudio_3g.c b/sound/pci/echoaudio/echoaudio_3g.c index 658db44ef746..50a21690447d 100644 --- a/sound/pci/echoaudio/echoaudio_3g.c +++ b/sound/pci/echoaudio/echoaudio_3g.c | |||
@@ -51,7 +51,7 @@ static int check_asic_status(struct echoaudio *chip) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | box_status = le32_to_cpu(chip->comm_page->ext_box_status); | 53 | box_status = le32_to_cpu(chip->comm_page->ext_box_status); |
54 | DE_INIT(("box_status=%x\n", box_status)); | 54 | dev_dbg(chip->card->dev, "box_status=%x\n", box_status); |
55 | if (box_status == E3G_ASIC_NOT_LOADED) | 55 | if (box_status == E3G_ASIC_NOT_LOADED) |
56 | return -ENODEV; | 56 | return -ENODEV; |
57 | 57 | ||
@@ -76,7 +76,8 @@ static int write_control_reg(struct echoaudio *chip, u32 ctl, u32 frq, | |||
76 | if (wait_handshake(chip)) | 76 | if (wait_handshake(chip)) |
77 | return -EIO; | 77 | return -EIO; |
78 | 78 | ||
79 | DE_ACT(("WriteControlReg: Setting 0x%x, 0x%x\n", ctl, frq)); | 79 | dev_dbg(chip->card->dev, |
80 | "WriteControlReg: Setting 0x%x, 0x%x\n", ctl, frq); | ||
80 | 81 | ||
81 | ctl = cpu_to_le32(ctl); | 82 | ctl = cpu_to_le32(ctl); |
82 | frq = cpu_to_le32(frq); | 83 | frq = cpu_to_le32(frq); |
@@ -89,7 +90,7 @@ static int write_control_reg(struct echoaudio *chip, u32 ctl, u32 frq, | |||
89 | return send_vector(chip, DSP_VC_WRITE_CONTROL_REG); | 90 | return send_vector(chip, DSP_VC_WRITE_CONTROL_REG); |
90 | } | 91 | } |
91 | 92 | ||
92 | DE_ACT(("WriteControlReg: not written, no change\n")); | 93 | dev_dbg(chip->card->dev, "WriteControlReg: not written, no change\n"); |
93 | return 0; | 94 | return 0; |
94 | } | 95 | } |
95 | 96 | ||
@@ -258,8 +259,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
258 | 259 | ||
259 | /* Only set the clock for internal mode. */ | 260 | /* Only set the clock for internal mode. */ |
260 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { | 261 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { |
261 | DE_ACT(("set_sample_rate: Cannot set sample rate - " | 262 | dev_warn(chip->card->dev, |
262 | "clock not set to CLK_CLOCKININTERNAL\n")); | 263 | "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); |
263 | /* Save the rate anyhow */ | 264 | /* Save the rate anyhow */ |
264 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 265 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
265 | chip->sample_rate = rate; | 266 | chip->sample_rate = rate; |
@@ -313,7 +314,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
313 | 314 | ||
314 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ | 315 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ |
315 | chip->sample_rate = rate; | 316 | chip->sample_rate = rate; |
316 | DE_ACT(("SetSampleRate: %d clock %x\n", rate, control_reg)); | 317 | dev_dbg(chip->card->dev, |
318 | "SetSampleRate: %d clock %x\n", rate, control_reg); | ||
317 | 319 | ||
318 | /* Tell the DSP about it - DSP reads both control reg & freq reg */ | 320 | /* Tell the DSP about it - DSP reads both control reg & freq reg */ |
319 | return write_control_reg(chip, control_reg, frq_reg, 0); | 321 | return write_control_reg(chip, control_reg, frq_reg, 0); |
@@ -326,7 +328,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
326 | { | 328 | { |
327 | u32 control_reg, clocks_from_dsp; | 329 | u32 control_reg, clocks_from_dsp; |
328 | 330 | ||
329 | DE_ACT(("set_input_clock:\n")); | 331 | dev_dbg(chip->card->dev, "set_input_clock:\n"); |
330 | 332 | ||
331 | /* Mask off the clock select bits */ | 333 | /* Mask off the clock select bits */ |
332 | control_reg = le32_to_cpu(chip->comm_page->control_register) & | 334 | control_reg = le32_to_cpu(chip->comm_page->control_register) & |
@@ -335,13 +337,13 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
335 | 337 | ||
336 | switch (clock) { | 338 | switch (clock) { |
337 | case ECHO_CLOCK_INTERNAL: | 339 | case ECHO_CLOCK_INTERNAL: |
338 | DE_ACT(("Set Echo3G clock to INTERNAL\n")); | 340 | dev_dbg(chip->card->dev, "Set Echo3G clock to INTERNAL\n"); |
339 | chip->input_clock = ECHO_CLOCK_INTERNAL; | 341 | chip->input_clock = ECHO_CLOCK_INTERNAL; |
340 | return set_sample_rate(chip, chip->sample_rate); | 342 | return set_sample_rate(chip, chip->sample_rate); |
341 | case ECHO_CLOCK_SPDIF: | 343 | case ECHO_CLOCK_SPDIF: |
342 | if (chip->digital_mode == DIGITAL_MODE_ADAT) | 344 | if (chip->digital_mode == DIGITAL_MODE_ADAT) |
343 | return -EAGAIN; | 345 | return -EAGAIN; |
344 | DE_ACT(("Set Echo3G clock to SPDIF\n")); | 346 | dev_dbg(chip->card->dev, "Set Echo3G clock to SPDIF\n"); |
345 | control_reg |= E3G_SPDIF_CLOCK; | 347 | control_reg |= E3G_SPDIF_CLOCK; |
346 | if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_SPDIF96) | 348 | if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_SPDIF96) |
347 | control_reg |= E3G_DOUBLE_SPEED_MODE; | 349 | control_reg |= E3G_DOUBLE_SPEED_MODE; |
@@ -351,12 +353,12 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
351 | case ECHO_CLOCK_ADAT: | 353 | case ECHO_CLOCK_ADAT: |
352 | if (chip->digital_mode != DIGITAL_MODE_ADAT) | 354 | if (chip->digital_mode != DIGITAL_MODE_ADAT) |
353 | return -EAGAIN; | 355 | return -EAGAIN; |
354 | DE_ACT(("Set Echo3G clock to ADAT\n")); | 356 | dev_dbg(chip->card->dev, "Set Echo3G clock to ADAT\n"); |
355 | control_reg |= E3G_ADAT_CLOCK; | 357 | control_reg |= E3G_ADAT_CLOCK; |
356 | control_reg &= ~E3G_DOUBLE_SPEED_MODE; | 358 | control_reg &= ~E3G_DOUBLE_SPEED_MODE; |
357 | break; | 359 | break; |
358 | case ECHO_CLOCK_WORD: | 360 | case ECHO_CLOCK_WORD: |
359 | DE_ACT(("Set Echo3G clock to WORD\n")); | 361 | dev_dbg(chip->card->dev, "Set Echo3G clock to WORD\n"); |
360 | control_reg |= E3G_WORD_CLOCK; | 362 | control_reg |= E3G_WORD_CLOCK; |
361 | if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_WORD96) | 363 | if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_WORD96) |
362 | control_reg |= E3G_DOUBLE_SPEED_MODE; | 364 | control_reg |= E3G_DOUBLE_SPEED_MODE; |
@@ -364,7 +366,8 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
364 | control_reg &= ~E3G_DOUBLE_SPEED_MODE; | 366 | control_reg &= ~E3G_DOUBLE_SPEED_MODE; |
365 | break; | 367 | break; |
366 | default: | 368 | default: |
367 | DE_ACT(("Input clock 0x%x not supported for Echo3G\n", clock)); | 369 | dev_err(chip->card->dev, |
370 | "Input clock 0x%x not supported for Echo3G\n", clock); | ||
368 | return -EINVAL; | 371 | return -EINVAL; |
369 | } | 372 | } |
370 | 373 | ||
@@ -392,7 +395,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
392 | incompatible_clock = TRUE; | 395 | incompatible_clock = TRUE; |
393 | break; | 396 | break; |
394 | default: | 397 | default: |
395 | DE_ACT(("Digital mode not supported: %d\n", mode)); | 398 | dev_err(chip->card->dev, |
399 | "Digital mode not supported: %d\n", mode); | ||
396 | return -EINVAL; | 400 | return -EINVAL; |
397 | } | 401 | } |
398 | 402 | ||
@@ -427,6 +431,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
427 | return err; | 431 | return err; |
428 | chip->digital_mode = mode; | 432 | chip->digital_mode = mode; |
429 | 433 | ||
430 | DE_ACT(("set_digital_mode(%d)\n", chip->digital_mode)); | 434 | dev_dbg(chip->card->dev, "set_digital_mode(%d)\n", chip->digital_mode); |
431 | return incompatible_clock; | 435 | return incompatible_clock; |
432 | } | 436 | } |
diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c index 977b2bd2e72f..ba9d4f16cbb3 100644 --- a/sound/pci/echoaudio/echoaudio_dsp.c +++ b/sound/pci/echoaudio/echoaudio_dsp.c | |||
@@ -80,7 +80,7 @@ static int send_vector(struct echoaudio *chip, u32 command) | |||
80 | udelay(1); | 80 | udelay(1); |
81 | } | 81 | } |
82 | 82 | ||
83 | DE_ACT((KERN_ERR "timeout on send_vector\n")); | 83 | dev_err(chip->card->dev, "timeout on send_vector\n"); |
84 | return -EBUSY; | 84 | return -EBUSY; |
85 | } | 85 | } |
86 | 86 | ||
@@ -104,7 +104,7 @@ static int write_dsp(struct echoaudio *chip, u32 data) | |||
104 | } | 104 | } |
105 | 105 | ||
106 | chip->bad_board = TRUE; /* Set TRUE until DSP re-loaded */ | 106 | chip->bad_board = TRUE; /* Set TRUE until DSP re-loaded */ |
107 | DE_ACT((KERN_ERR "write_dsp: Set bad_board to TRUE\n")); | 107 | dev_dbg(chip->card->dev, "write_dsp: Set bad_board to TRUE\n"); |
108 | return -EIO; | 108 | return -EIO; |
109 | } | 109 | } |
110 | 110 | ||
@@ -127,7 +127,7 @@ static int read_dsp(struct echoaudio *chip, u32 *data) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | chip->bad_board = TRUE; /* Set TRUE until DSP re-loaded */ | 129 | chip->bad_board = TRUE; /* Set TRUE until DSP re-loaded */ |
130 | DE_INIT((KERN_ERR "read_dsp: Set bad_board to TRUE\n")); | 130 | dev_err(chip->card->dev, "read_dsp: Set bad_board to TRUE\n"); |
131 | return -EIO; | 131 | return -EIO; |
132 | } | 132 | } |
133 | 133 | ||
@@ -154,8 +154,9 @@ static int read_sn(struct echoaudio *chip) | |||
154 | return -EIO; | 154 | return -EIO; |
155 | } | 155 | } |
156 | } | 156 | } |
157 | DE_INIT(("Read serial number %08x %08x %08x %08x %08x\n", | 157 | dev_dbg(chip->card->dev, |
158 | sn[0], sn[1], sn[2], sn[3], sn[4])); | 158 | "Read serial number %08x %08x %08x %08x %08x\n", |
159 | sn[0], sn[1], sn[2], sn[3], sn[4]); | ||
159 | return 0; | 160 | return 0; |
160 | } | 161 | } |
161 | 162 | ||
@@ -205,12 +206,12 @@ static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic) | |||
205 | goto la_error; | 206 | goto la_error; |
206 | } | 207 | } |
207 | 208 | ||
208 | DE_INIT(("ASIC loaded\n")); | 209 | dev_dbg(chip->card->dev, "ASIC loaded\n"); |
209 | free_firmware(fw, chip); | 210 | free_firmware(fw, chip); |
210 | return 0; | 211 | return 0; |
211 | 212 | ||
212 | la_error: | 213 | la_error: |
213 | DE_INIT(("failed on write_dsp\n")); | 214 | dev_err(chip->card->dev, "failed on write_dsp\n"); |
214 | free_firmware(fw, chip); | 215 | free_firmware(fw, chip); |
215 | return -EIO; | 216 | return -EIO; |
216 | } | 217 | } |
@@ -241,8 +242,9 @@ static int install_resident_loader(struct echoaudio *chip) | |||
241 | loader is already installed, host flag 5 will be on. */ | 242 | loader is already installed, host flag 5 will be on. */ |
242 | status = get_dsp_register(chip, CHI32_STATUS_REG); | 243 | status = get_dsp_register(chip, CHI32_STATUS_REG); |
243 | if (status & CHI32_STATUS_REG_HF5) { | 244 | if (status & CHI32_STATUS_REG_HF5) { |
244 | DE_INIT(("Resident loader already installed; status is 0x%x\n", | 245 | dev_dbg(chip->card->dev, |
245 | status)); | 246 | "Resident loader already installed; status is 0x%x\n", |
247 | status); | ||
246 | return 0; | 248 | return 0; |
247 | } | 249 | } |
248 | 250 | ||
@@ -283,12 +285,14 @@ static int install_resident_loader(struct echoaudio *chip) | |||
283 | 285 | ||
284 | /* Write the count to the DSP */ | 286 | /* Write the count to the DSP */ |
285 | if (write_dsp(chip, words)) { | 287 | if (write_dsp(chip, words)) { |
286 | DE_INIT(("install_resident_loader: Failed to write word count!\n")); | 288 | dev_err(chip->card->dev, |
289 | "install_resident_loader: Failed to write word count!\n"); | ||
287 | goto irl_error; | 290 | goto irl_error; |
288 | } | 291 | } |
289 | /* Write the DSP address */ | 292 | /* Write the DSP address */ |
290 | if (write_dsp(chip, address)) { | 293 | if (write_dsp(chip, address)) { |
291 | DE_INIT(("install_resident_loader: Failed to write DSP address!\n")); | 294 | dev_err(chip->card->dev, |
295 | "install_resident_loader: Failed to write DSP address!\n"); | ||
292 | goto irl_error; | 296 | goto irl_error; |
293 | } | 297 | } |
294 | /* Write out this block of code to the DSP */ | 298 | /* Write out this block of code to the DSP */ |
@@ -297,7 +301,8 @@ static int install_resident_loader(struct echoaudio *chip) | |||
297 | 301 | ||
298 | data = ((u32)code[index] << 16) + code[index + 1]; | 302 | data = ((u32)code[index] << 16) + code[index + 1]; |
299 | if (write_dsp(chip, data)) { | 303 | if (write_dsp(chip, data)) { |
300 | DE_INIT(("install_resident_loader: Failed to write DSP code\n")); | 304 | dev_err(chip->card->dev, |
305 | "install_resident_loader: Failed to write DSP code\n"); | ||
301 | goto irl_error; | 306 | goto irl_error; |
302 | } | 307 | } |
303 | index += 2; | 308 | index += 2; |
@@ -312,11 +317,11 @@ static int install_resident_loader(struct echoaudio *chip) | |||
312 | } | 317 | } |
313 | 318 | ||
314 | if (i == 200) { | 319 | if (i == 200) { |
315 | DE_INIT(("Resident loader failed to set HF5\n")); | 320 | dev_err(chip->card->dev, "Resident loader failed to set HF5\n"); |
316 | goto irl_error; | 321 | goto irl_error; |
317 | } | 322 | } |
318 | 323 | ||
319 | DE_INIT(("Resident loader successfully installed\n")); | 324 | dev_dbg(chip->card->dev, "Resident loader successfully installed\n"); |
320 | free_firmware(fw, chip); | 325 | free_firmware(fw, chip); |
321 | return 0; | 326 | return 0; |
322 | 327 | ||
@@ -334,14 +339,14 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
334 | int index, words, i; | 339 | int index, words, i; |
335 | 340 | ||
336 | if (chip->dsp_code == code) { | 341 | if (chip->dsp_code == code) { |
337 | DE_INIT(("DSP is already loaded!\n")); | 342 | dev_warn(chip->card->dev, "DSP is already loaded!\n"); |
338 | return 0; | 343 | return 0; |
339 | } | 344 | } |
340 | chip->bad_board = TRUE; /* Set TRUE until DSP loaded */ | 345 | chip->bad_board = TRUE; /* Set TRUE until DSP loaded */ |
341 | chip->dsp_code = NULL; /* Current DSP code not loaded */ | 346 | chip->dsp_code = NULL; /* Current DSP code not loaded */ |
342 | chip->asic_loaded = FALSE; /* Loading the DSP code will reset the ASIC */ | 347 | chip->asic_loaded = FALSE; /* Loading the DSP code will reset the ASIC */ |
343 | 348 | ||
344 | DE_INIT(("load_dsp: Set bad_board to TRUE\n")); | 349 | dev_dbg(chip->card->dev, "load_dsp: Set bad_board to TRUE\n"); |
345 | 350 | ||
346 | /* If this board requires a resident loader, install it. */ | 351 | /* If this board requires a resident loader, install it. */ |
347 | #ifdef DSP_56361 | 352 | #ifdef DSP_56361 |
@@ -351,7 +356,8 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
351 | 356 | ||
352 | /* Send software reset command */ | 357 | /* Send software reset command */ |
353 | if (send_vector(chip, DSP_VC_RESET) < 0) { | 358 | if (send_vector(chip, DSP_VC_RESET) < 0) { |
354 | DE_INIT(("LoadDsp: send_vector DSP_VC_RESET failed, Critical Failure\n")); | 359 | dev_err(chip->card->dev, |
360 | "LoadDsp: send_vector DSP_VC_RESET failed, Critical Failure\n"); | ||
355 | return -EIO; | 361 | return -EIO; |
356 | } | 362 | } |
357 | /* Delay 10us */ | 363 | /* Delay 10us */ |
@@ -366,7 +372,8 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
366 | } | 372 | } |
367 | 373 | ||
368 | if (i == 1000) { | 374 | if (i == 1000) { |
369 | DE_INIT(("load_dsp: Timeout waiting for CHI32_STATUS_REG_HF3\n")); | 375 | dev_err(chip->card->dev, |
376 | "load_dsp: Timeout waiting for CHI32_STATUS_REG_HF3\n"); | ||
370 | return -EIO; | 377 | return -EIO; |
371 | } | 378 | } |
372 | 379 | ||
@@ -403,29 +410,34 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
403 | index += 2; | 410 | index += 2; |
404 | 411 | ||
405 | if (write_dsp(chip, words) < 0) { | 412 | if (write_dsp(chip, words) < 0) { |
406 | DE_INIT(("load_dsp: failed to write number of DSP words\n")); | 413 | dev_err(chip->card->dev, |
414 | "load_dsp: failed to write number of DSP words\n"); | ||
407 | return -EIO; | 415 | return -EIO; |
408 | } | 416 | } |
409 | if (write_dsp(chip, address) < 0) { | 417 | if (write_dsp(chip, address) < 0) { |
410 | DE_INIT(("load_dsp: failed to write DSP address\n")); | 418 | dev_err(chip->card->dev, |
419 | "load_dsp: failed to write DSP address\n"); | ||
411 | return -EIO; | 420 | return -EIO; |
412 | } | 421 | } |
413 | if (write_dsp(chip, mem_type) < 0) { | 422 | if (write_dsp(chip, mem_type) < 0) { |
414 | DE_INIT(("load_dsp: failed to write DSP memory type\n")); | 423 | dev_err(chip->card->dev, |
424 | "load_dsp: failed to write DSP memory type\n"); | ||
415 | return -EIO; | 425 | return -EIO; |
416 | } | 426 | } |
417 | /* Code */ | 427 | /* Code */ |
418 | for (i = 0; i < words; i++, index+=2) { | 428 | for (i = 0; i < words; i++, index+=2) { |
419 | data = ((u32)code[index] << 16) + code[index + 1]; | 429 | data = ((u32)code[index] << 16) + code[index + 1]; |
420 | if (write_dsp(chip, data) < 0) { | 430 | if (write_dsp(chip, data) < 0) { |
421 | DE_INIT(("load_dsp: failed to write DSP data\n")); | 431 | dev_err(chip->card->dev, |
432 | "load_dsp: failed to write DSP data\n"); | ||
422 | return -EIO; | 433 | return -EIO; |
423 | } | 434 | } |
424 | } | 435 | } |
425 | } | 436 | } |
426 | 437 | ||
427 | if (write_dsp(chip, 0) < 0) { /* We're done!!! */ | 438 | if (write_dsp(chip, 0) < 0) { /* We're done!!! */ |
428 | DE_INIT(("load_dsp: Failed to write final zero\n")); | 439 | dev_err(chip->card->dev, |
440 | "load_dsp: Failed to write final zero\n"); | ||
429 | return -EIO; | 441 | return -EIO; |
430 | } | 442 | } |
431 | udelay(10); | 443 | udelay(10); |
@@ -438,12 +450,14 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
438 | get_dsp_register(chip, CHI32_CONTROL_REG) & ~0x1b00); | 450 | get_dsp_register(chip, CHI32_CONTROL_REG) & ~0x1b00); |
439 | 451 | ||
440 | if (write_dsp(chip, DSP_FNC_SET_COMMPAGE_ADDR) < 0) { | 452 | if (write_dsp(chip, DSP_FNC_SET_COMMPAGE_ADDR) < 0) { |
441 | DE_INIT(("load_dsp: Failed to write DSP_FNC_SET_COMMPAGE_ADDR\n")); | 453 | dev_err(chip->card->dev, |
454 | "load_dsp: Failed to write DSP_FNC_SET_COMMPAGE_ADDR\n"); | ||
442 | return -EIO; | 455 | return -EIO; |
443 | } | 456 | } |
444 | 457 | ||
445 | if (write_dsp(chip, chip->comm_page_phys) < 0) { | 458 | if (write_dsp(chip, chip->comm_page_phys) < 0) { |
446 | DE_INIT(("load_dsp: Failed to write comm page address\n")); | 459 | dev_err(chip->card->dev, |
460 | "load_dsp: Failed to write comm page address\n"); | ||
447 | return -EIO; | 461 | return -EIO; |
448 | } | 462 | } |
449 | 463 | ||
@@ -452,19 +466,21 @@ static int load_dsp(struct echoaudio *chip, u16 *code) | |||
452 | We don't actually use the serial number but we have to | 466 | We don't actually use the serial number but we have to |
453 | get it as part of the DSP init voodoo. */ | 467 | get it as part of the DSP init voodoo. */ |
454 | if (read_sn(chip) < 0) { | 468 | if (read_sn(chip) < 0) { |
455 | DE_INIT(("load_dsp: Failed to read serial number\n")); | 469 | dev_err(chip->card->dev, |
470 | "load_dsp: Failed to read serial number\n"); | ||
456 | return -EIO; | 471 | return -EIO; |
457 | } | 472 | } |
458 | 473 | ||
459 | chip->dsp_code = code; /* Show which DSP code loaded */ | 474 | chip->dsp_code = code; /* Show which DSP code loaded */ |
460 | chip->bad_board = FALSE; /* DSP OK */ | 475 | chip->bad_board = FALSE; /* DSP OK */ |
461 | DE_INIT(("load_dsp: OK!\n")); | 476 | dev_dbg(chip->card->dev, "load_dsp: OK!\n"); |
462 | return 0; | 477 | return 0; |
463 | } | 478 | } |
464 | udelay(100); | 479 | udelay(100); |
465 | } | 480 | } |
466 | 481 | ||
467 | DE_INIT(("load_dsp: DSP load timed out waiting for HF4\n")); | 482 | dev_err(chip->card->dev, |
483 | "load_dsp: DSP load timed out waiting for HF4\n"); | ||
468 | return -EIO; | 484 | return -EIO; |
469 | } | 485 | } |
470 | 486 | ||
@@ -658,7 +674,7 @@ static void get_audio_meters(struct echoaudio *chip, long *meters) | |||
658 | static int restore_dsp_rettings(struct echoaudio *chip) | 674 | static int restore_dsp_rettings(struct echoaudio *chip) |
659 | { | 675 | { |
660 | int i, o, err; | 676 | int i, o, err; |
661 | DE_INIT(("restore_dsp_settings\n")); | 677 | dev_dbg(chip->card->dev, "restore_dsp_settings\n"); |
662 | 678 | ||
663 | if ((err = check_asic_status(chip)) < 0) | 679 | if ((err = check_asic_status(chip)) < 0) |
664 | return err; | 680 | return err; |
@@ -755,7 +771,7 @@ static int restore_dsp_rettings(struct echoaudio *chip) | |||
755 | if (send_vector(chip, DSP_VC_UPDATE_FLAGS) < 0) | 771 | if (send_vector(chip, DSP_VC_UPDATE_FLAGS) < 0) |
756 | return -EIO; | 772 | return -EIO; |
757 | 773 | ||
758 | DE_INIT(("restore_dsp_rettings done\n")); | 774 | dev_dbg(chip->card->dev, "restore_dsp_rettings done\n"); |
759 | return 0; | 775 | return 0; |
760 | } | 776 | } |
761 | 777 | ||
@@ -835,7 +851,8 @@ static void set_audio_format(struct echoaudio *chip, u16 pipe_index, | |||
835 | break; | 851 | break; |
836 | } | 852 | } |
837 | } | 853 | } |
838 | DE_ACT(("set_audio_format[%d] = %x\n", pipe_index, dsp_format)); | 854 | dev_dbg(chip->card->dev, |
855 | "set_audio_format[%d] = %x\n", pipe_index, dsp_format); | ||
839 | chip->comm_page->audio_format[pipe_index] = cpu_to_le16(dsp_format); | 856 | chip->comm_page->audio_format[pipe_index] = cpu_to_le16(dsp_format); |
840 | } | 857 | } |
841 | 858 | ||
@@ -848,7 +865,7 @@ Same thing for pause_ and stop_ -trasport below. */ | |||
848 | static int start_transport(struct echoaudio *chip, u32 channel_mask, | 865 | static int start_transport(struct echoaudio *chip, u32 channel_mask, |
849 | u32 cyclic_mask) | 866 | u32 cyclic_mask) |
850 | { | 867 | { |
851 | DE_ACT(("start_transport %x\n", channel_mask)); | 868 | dev_dbg(chip->card->dev, "start_transport %x\n", channel_mask); |
852 | 869 | ||
853 | if (wait_handshake(chip)) | 870 | if (wait_handshake(chip)) |
854 | return -EIO; | 871 | return -EIO; |
@@ -866,7 +883,7 @@ static int start_transport(struct echoaudio *chip, u32 channel_mask, | |||
866 | return 0; | 883 | return 0; |
867 | } | 884 | } |
868 | 885 | ||
869 | DE_ACT(("start_transport: No pipes to start!\n")); | 886 | dev_err(chip->card->dev, "start_transport: No pipes to start!\n"); |
870 | return -EINVAL; | 887 | return -EINVAL; |
871 | } | 888 | } |
872 | 889 | ||
@@ -874,7 +891,7 @@ static int start_transport(struct echoaudio *chip, u32 channel_mask, | |||
874 | 891 | ||
875 | static int pause_transport(struct echoaudio *chip, u32 channel_mask) | 892 | static int pause_transport(struct echoaudio *chip, u32 channel_mask) |
876 | { | 893 | { |
877 | DE_ACT(("pause_transport %x\n", channel_mask)); | 894 | dev_dbg(chip->card->dev, "pause_transport %x\n", channel_mask); |
878 | 895 | ||
879 | if (wait_handshake(chip)) | 896 | if (wait_handshake(chip)) |
880 | return -EIO; | 897 | return -EIO; |
@@ -893,7 +910,7 @@ static int pause_transport(struct echoaudio *chip, u32 channel_mask) | |||
893 | return 0; | 910 | return 0; |
894 | } | 911 | } |
895 | 912 | ||
896 | DE_ACT(("pause_transport: No pipes to stop!\n")); | 913 | dev_warn(chip->card->dev, "pause_transport: No pipes to stop!\n"); |
897 | return 0; | 914 | return 0; |
898 | } | 915 | } |
899 | 916 | ||
@@ -901,7 +918,7 @@ static int pause_transport(struct echoaudio *chip, u32 channel_mask) | |||
901 | 918 | ||
902 | static int stop_transport(struct echoaudio *chip, u32 channel_mask) | 919 | static int stop_transport(struct echoaudio *chip, u32 channel_mask) |
903 | { | 920 | { |
904 | DE_ACT(("stop_transport %x\n", channel_mask)); | 921 | dev_dbg(chip->card->dev, "stop_transport %x\n", channel_mask); |
905 | 922 | ||
906 | if (wait_handshake(chip)) | 923 | if (wait_handshake(chip)) |
907 | return -EIO; | 924 | return -EIO; |
@@ -920,7 +937,7 @@ static int stop_transport(struct echoaudio *chip, u32 channel_mask) | |||
920 | return 0; | 937 | return 0; |
921 | } | 938 | } |
922 | 939 | ||
923 | DE_ACT(("stop_transport: No pipes to stop!\n")); | 940 | dev_warn(chip->card->dev, "stop_transport: No pipes to stop!\n"); |
924 | return 0; | 941 | return 0; |
925 | } | 942 | } |
926 | 943 | ||
@@ -937,7 +954,8 @@ static inline int is_pipe_allocated(struct echoaudio *chip, u16 pipe_index) | |||
937 | stopped and unallocated. */ | 954 | stopped and unallocated. */ |
938 | static int rest_in_peace(struct echoaudio *chip) | 955 | static int rest_in_peace(struct echoaudio *chip) |
939 | { | 956 | { |
940 | DE_ACT(("rest_in_peace() open=%x\n", chip->pipe_alloc_mask)); | 957 | dev_dbg(chip->card->dev, |
958 | "rest_in_peace() open=%x\n", chip->pipe_alloc_mask); | ||
941 | 959 | ||
942 | /* Stops all active pipes (just to be sure) */ | 960 | /* Stops all active pipes (just to be sure) */ |
943 | stop_transport(chip, chip->active_mask); | 961 | stop_transport(chip, chip->active_mask); |
@@ -965,7 +983,8 @@ static int init_dsp_comm_page(struct echoaudio *chip) | |||
965 | { | 983 | { |
966 | /* Check if the compiler added extra padding inside the structure */ | 984 | /* Check if the compiler added extra padding inside the structure */ |
967 | if (offsetof(struct comm_page, midi_output) != 0xbe0) { | 985 | if (offsetof(struct comm_page, midi_output) != 0xbe0) { |
968 | DE_INIT(("init_dsp_comm_page() - Invalid struct comm_page structure\n")); | 986 | dev_err(chip->card->dev, |
987 | "init_dsp_comm_page() - Invalid struct comm_page structure\n"); | ||
969 | return -EPERM; | 988 | return -EPERM; |
970 | } | 989 | } |
971 | 990 | ||
@@ -999,7 +1018,7 @@ static int init_dsp_comm_page(struct echoaudio *chip) | |||
999 | */ | 1018 | */ |
1000 | static int init_line_levels(struct echoaudio *chip) | 1019 | static int init_line_levels(struct echoaudio *chip) |
1001 | { | 1020 | { |
1002 | DE_INIT(("init_line_levels\n")); | 1021 | dev_dbg(chip->card->dev, "init_line_levels\n"); |
1003 | memset(chip->output_gain, ECHOGAIN_MUTED, sizeof(chip->output_gain)); | 1022 | memset(chip->output_gain, ECHOGAIN_MUTED, sizeof(chip->output_gain)); |
1004 | memset(chip->input_gain, ECHOGAIN_MUTED, sizeof(chip->input_gain)); | 1023 | memset(chip->input_gain, ECHOGAIN_MUTED, sizeof(chip->input_gain)); |
1005 | memset(chip->monitor_gain, ECHOGAIN_MUTED, sizeof(chip->monitor_gain)); | 1024 | memset(chip->monitor_gain, ECHOGAIN_MUTED, sizeof(chip->monitor_gain)); |
@@ -1051,7 +1070,8 @@ static int allocate_pipes(struct echoaudio *chip, struct audiopipe *pipe, | |||
1051 | u32 channel_mask; | 1070 | u32 channel_mask; |
1052 | char is_cyclic; | 1071 | char is_cyclic; |
1053 | 1072 | ||
1054 | DE_ACT(("allocate_pipes: ch=%d int=%d\n", pipe_index, interleave)); | 1073 | dev_dbg(chip->card->dev, |
1074 | "allocate_pipes: ch=%d int=%d\n", pipe_index, interleave); | ||
1055 | 1075 | ||
1056 | if (chip->bad_board) | 1076 | if (chip->bad_board) |
1057 | return -EIO; | 1077 | return -EIO; |
@@ -1061,7 +1081,8 @@ static int allocate_pipes(struct echoaudio *chip, struct audiopipe *pipe, | |||
1061 | for (channel_mask = i = 0; i < interleave; i++) | 1081 | for (channel_mask = i = 0; i < interleave; i++) |
1062 | channel_mask |= 1 << (pipe_index + i); | 1082 | channel_mask |= 1 << (pipe_index + i); |
1063 | if (chip->pipe_alloc_mask & channel_mask) { | 1083 | if (chip->pipe_alloc_mask & channel_mask) { |
1064 | DE_ACT(("allocate_pipes: channel already open\n")); | 1084 | dev_err(chip->card->dev, |
1085 | "allocate_pipes: channel already open\n"); | ||
1065 | return -EAGAIN; | 1086 | return -EAGAIN; |
1066 | } | 1087 | } |
1067 | 1088 | ||
@@ -1078,7 +1099,7 @@ static int allocate_pipes(struct echoaudio *chip, struct audiopipe *pipe, | |||
1078 | it moves data. The DMA counter is in units of bytes, not samples. */ | 1099 | it moves data. The DMA counter is in units of bytes, not samples. */ |
1079 | pipe->dma_counter = &chip->comm_page->position[pipe_index]; | 1100 | pipe->dma_counter = &chip->comm_page->position[pipe_index]; |
1080 | *pipe->dma_counter = 0; | 1101 | *pipe->dma_counter = 0; |
1081 | DE_ACT(("allocate_pipes: ok\n")); | 1102 | dev_dbg(chip->card->dev, "allocate_pipes: ok\n"); |
1082 | return pipe_index; | 1103 | return pipe_index; |
1083 | } | 1104 | } |
1084 | 1105 | ||
@@ -1089,7 +1110,7 @@ static int free_pipes(struct echoaudio *chip, struct audiopipe *pipe) | |||
1089 | u32 channel_mask; | 1110 | u32 channel_mask; |
1090 | int i; | 1111 | int i; |
1091 | 1112 | ||
1092 | DE_ACT(("free_pipes: Pipe %d\n", pipe->index)); | 1113 | dev_dbg(chip->card->dev, "free_pipes: Pipe %d\n", pipe->index); |
1093 | if (snd_BUG_ON(!is_pipe_allocated(chip, pipe->index))) | 1114 | if (snd_BUG_ON(!is_pipe_allocated(chip, pipe->index))) |
1094 | return -EINVAL; | 1115 | return -EINVAL; |
1095 | if (snd_BUG_ON(pipe->state != PIPE_STATE_STOPPED)) | 1116 | if (snd_BUG_ON(pipe->state != PIPE_STATE_STOPPED)) |
@@ -1131,7 +1152,7 @@ static int sglist_add_mapping(struct echoaudio *chip, struct audiopipe *pipe, | |||
1131 | list[head].size = cpu_to_le32(length); | 1152 | list[head].size = cpu_to_le32(length); |
1132 | pipe->sglist_head++; | 1153 | pipe->sglist_head++; |
1133 | } else { | 1154 | } else { |
1134 | DE_ACT(("SGlist: too many fragments\n")); | 1155 | dev_err(chip->card->dev, "SGlist: too many fragments\n"); |
1135 | return -ENOMEM; | 1156 | return -ENOMEM; |
1136 | } | 1157 | } |
1137 | return 0; | 1158 | return 0; |
diff --git a/sound/pci/echoaudio/echoaudio_gml.c b/sound/pci/echoaudio/echoaudio_gml.c index afa273330e8a..23a099425834 100644 --- a/sound/pci/echoaudio/echoaudio_gml.c +++ b/sound/pci/echoaudio/echoaudio_gml.c | |||
@@ -46,7 +46,8 @@ static int check_asic_status(struct echoaudio *chip) | |||
46 | /* The DSP will return a value to indicate whether or not the | 46 | /* The DSP will return a value to indicate whether or not the |
47 | ASIC is currently loaded */ | 47 | ASIC is currently loaded */ |
48 | if (read_dsp(chip, &asic_status) < 0) { | 48 | if (read_dsp(chip, &asic_status) < 0) { |
49 | DE_INIT(("check_asic_status: failed on read_dsp\n")); | 49 | dev_err(chip->card->dev, |
50 | "check_asic_status: failed on read_dsp\n"); | ||
50 | chip->asic_loaded = FALSE; | 51 | chip->asic_loaded = FALSE; |
51 | return -EIO; | 52 | return -EIO; |
52 | } | 53 | } |
@@ -68,7 +69,7 @@ static int write_control_reg(struct echoaudio *chip, u32 value, char force) | |||
68 | else | 69 | else |
69 | value &= ~GML_DIGITAL_IN_AUTO_MUTE; | 70 | value &= ~GML_DIGITAL_IN_AUTO_MUTE; |
70 | 71 | ||
71 | DE_ACT(("write_control_reg: 0x%x\n", value)); | 72 | dev_dbg(chip->card->dev, "write_control_reg: 0x%x\n", value); |
72 | 73 | ||
73 | /* Write the control register */ | 74 | /* Write the control register */ |
74 | value = cpu_to_le32(value); | 75 | value = cpu_to_le32(value); |
@@ -91,7 +92,7 @@ If the auto-mute is disabled, the digital inputs are enabled regardless of | |||
91 | what the input clock is set or what is connected. */ | 92 | what the input clock is set or what is connected. */ |
92 | static int set_input_auto_mute(struct echoaudio *chip, int automute) | 93 | static int set_input_auto_mute(struct echoaudio *chip, int automute) |
93 | { | 94 | { |
94 | DE_ACT(("set_input_auto_mute %d\n", automute)); | 95 | dev_dbg(chip->card->dev, "set_input_auto_mute %d\n", automute); |
95 | 96 | ||
96 | chip->digital_in_automute = automute; | 97 | chip->digital_in_automute = automute; |
97 | 98 | ||
@@ -194,7 +195,7 @@ static int set_professional_spdif(struct echoaudio *chip, char prof) | |||
194 | if ((err = write_control_reg(chip, control_reg, FALSE))) | 195 | if ((err = write_control_reg(chip, control_reg, FALSE))) |
195 | return err; | 196 | return err; |
196 | chip->professional_spdif = prof; | 197 | chip->professional_spdif = prof; |
197 | DE_ACT(("set_professional_spdif to %s\n", | 198 | dev_dbg(chip->card->dev, "set_professional_spdif to %s\n", |
198 | prof ? "Professional" : "Consumer")); | 199 | prof ? "Professional" : "Consumer"); |
199 | return 0; | 200 | return 0; |
200 | } | 201 | } |
diff --git a/sound/pci/echoaudio/gina20_dsp.c b/sound/pci/echoaudio/gina20_dsp.c index d1615a0579d1..a959eae95e0d 100644 --- a/sound/pci/echoaudio/gina20_dsp.c +++ b/sound/pci/echoaudio/gina20_dsp.c | |||
@@ -37,12 +37,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
37 | { | 37 | { |
38 | int err; | 38 | int err; |
39 | 39 | ||
40 | DE_INIT(("init_hw() - Gina20\n")); | 40 | dev_dbg(chip->card->dev, "init_hw() - Gina20\n"); |
41 | if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA20)) | 41 | if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA20)) |
42 | return -ENODEV; | 42 | return -ENODEV; |
43 | 43 | ||
44 | if ((err = init_dsp_comm_page(chip))) { | 44 | if ((err = init_dsp_comm_page(chip))) { |
45 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 45 | dev_err(chip->card->dev, |
46 | "init_hw - could not initialize DSP comm page\n"); | ||
46 | return err; | 47 | return err; |
47 | } | 48 | } |
48 | 49 | ||
@@ -62,7 +63,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
62 | return err; | 63 | return err; |
63 | chip->bad_board = FALSE; | 64 | chip->bad_board = FALSE; |
64 | 65 | ||
65 | DE_INIT(("init_hw done\n")); | 66 | dev_dbg(chip->card->dev, "init_hw done\n"); |
66 | return err; | 67 | return err; |
67 | } | 68 | } |
68 | 69 | ||
@@ -149,7 +150,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
149 | 150 | ||
150 | static int set_input_clock(struct echoaudio *chip, u16 clock) | 151 | static int set_input_clock(struct echoaudio *chip, u16 clock) |
151 | { | 152 | { |
152 | DE_ACT(("set_input_clock:\n")); | 153 | dev_dbg(chip->card->dev, "set_input_clock:\n"); |
153 | 154 | ||
154 | switch (clock) { | 155 | switch (clock) { |
155 | case ECHO_CLOCK_INTERNAL: | 156 | case ECHO_CLOCK_INTERNAL: |
@@ -158,7 +159,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
158 | chip->spdif_status = GD_SPDIF_STATUS_UNDEF; | 159 | chip->spdif_status = GD_SPDIF_STATUS_UNDEF; |
159 | set_sample_rate(chip, chip->sample_rate); | 160 | set_sample_rate(chip, chip->sample_rate); |
160 | chip->input_clock = clock; | 161 | chip->input_clock = clock; |
161 | DE_ACT(("Set Gina clock to INTERNAL\n")); | 162 | dev_dbg(chip->card->dev, "Set Gina clock to INTERNAL\n"); |
162 | break; | 163 | break; |
163 | case ECHO_CLOCK_SPDIF: | 164 | case ECHO_CLOCK_SPDIF: |
164 | chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN; | 165 | chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN; |
@@ -166,7 +167,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
166 | clear_handshake(chip); | 167 | clear_handshake(chip); |
167 | send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE); | 168 | send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE); |
168 | chip->clock_state = GD_CLOCK_SPDIFIN; | 169 | chip->clock_state = GD_CLOCK_SPDIFIN; |
169 | DE_ACT(("Set Gina20 clock to SPDIF\n")); | 170 | dev_dbg(chip->card->dev, "Set Gina20 clock to SPDIF\n"); |
170 | chip->input_clock = clock; | 171 | chip->input_clock = clock; |
171 | break; | 172 | break; |
172 | default: | 173 | default: |
@@ -208,7 +209,7 @@ static int update_flags(struct echoaudio *chip) | |||
208 | 209 | ||
209 | static int set_professional_spdif(struct echoaudio *chip, char prof) | 210 | static int set_professional_spdif(struct echoaudio *chip, char prof) |
210 | { | 211 | { |
211 | DE_ACT(("set_professional_spdif %d\n", prof)); | 212 | dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof); |
212 | if (prof) | 213 | if (prof) |
213 | chip->comm_page->flags |= | 214 | chip->comm_page->flags |= |
214 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); | 215 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); |
diff --git a/sound/pci/echoaudio/gina24_dsp.c b/sound/pci/echoaudio/gina24_dsp.c index 98f7cfa81b5f..c8ea57612d22 100644 --- a/sound/pci/echoaudio/gina24_dsp.c +++ b/sound/pci/echoaudio/gina24_dsp.c | |||
@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
41 | { | 41 | { |
42 | int err; | 42 | int err; |
43 | 43 | ||
44 | DE_INIT(("init_hw() - Gina24\n")); | 44 | dev_dbg(chip->card->dev, "init_hw() - Gina24\n"); |
45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA24)) | 45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA24)) |
46 | return -ENODEV; | 46 | return -ENODEV; |
47 | 47 | ||
48 | if ((err = init_dsp_comm_page(chip))) { | 48 | if ((err = init_dsp_comm_page(chip))) { |
49 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 49 | dev_err(chip->card->dev, |
50 | "init_hw - could not initialize DSP comm page\n"); | ||
50 | return err; | 51 | return err; |
51 | } | 52 | } |
52 | 53 | ||
@@ -78,7 +79,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
78 | return err; | 79 | return err; |
79 | chip->bad_board = FALSE; | 80 | chip->bad_board = FALSE; |
80 | 81 | ||
81 | DE_INIT(("init_hw done\n")); | 82 | dev_dbg(chip->card->dev, "init_hw done\n"); |
82 | return err; | 83 | return err; |
83 | } | 84 | } |
84 | 85 | ||
@@ -155,7 +156,7 @@ static int load_asic(struct echoaudio *chip) | |||
155 | control_reg = GML_CONVERTER_ENABLE | GML_48KHZ; | 156 | control_reg = GML_CONVERTER_ENABLE | GML_48KHZ; |
156 | err = write_control_reg(chip, control_reg, TRUE); | 157 | err = write_control_reg(chip, control_reg, TRUE); |
157 | } | 158 | } |
158 | DE_INIT(("load_asic() done\n")); | 159 | dev_dbg(chip->card->dev, "load_asic() done\n"); |
159 | return err; | 160 | return err; |
160 | } | 161 | } |
161 | 162 | ||
@@ -171,8 +172,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
171 | 172 | ||
172 | /* Only set the clock for internal mode. */ | 173 | /* Only set the clock for internal mode. */ |
173 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { | 174 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { |
174 | DE_ACT(("set_sample_rate: Cannot set sample rate - " | 175 | dev_warn(chip->card->dev, |
175 | "clock not set to CLK_CLOCKININTERNAL\n")); | 176 | "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); |
176 | /* Save the rate anyhow */ | 177 | /* Save the rate anyhow */ |
177 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 178 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
178 | chip->sample_rate = rate; | 179 | chip->sample_rate = rate; |
@@ -217,7 +218,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
217 | clock = GML_8KHZ; | 218 | clock = GML_8KHZ; |
218 | break; | 219 | break; |
219 | default: | 220 | default: |
220 | DE_ACT(("set_sample_rate: %d invalid!\n", rate)); | 221 | dev_err(chip->card->dev, |
222 | "set_sample_rate: %d invalid!\n", rate); | ||
221 | return -EINVAL; | 223 | return -EINVAL; |
222 | } | 224 | } |
223 | 225 | ||
@@ -225,7 +227,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
225 | 227 | ||
226 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ | 228 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ |
227 | chip->sample_rate = rate; | 229 | chip->sample_rate = rate; |
228 | DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock)); | 230 | dev_dbg(chip->card->dev, "set_sample_rate: %d clock %d\n", rate, clock); |
229 | 231 | ||
230 | return write_control_reg(chip, control_reg, FALSE); | 232 | return write_control_reg(chip, control_reg, FALSE); |
231 | } | 233 | } |
@@ -236,7 +238,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
236 | { | 238 | { |
237 | u32 control_reg, clocks_from_dsp; | 239 | u32 control_reg, clocks_from_dsp; |
238 | 240 | ||
239 | DE_ACT(("set_input_clock:\n")); | 241 | dev_dbg(chip->card->dev, "set_input_clock:\n"); |
240 | 242 | ||
241 | /* Mask off the clock select bits */ | 243 | /* Mask off the clock select bits */ |
242 | control_reg = le32_to_cpu(chip->comm_page->control_register) & | 244 | control_reg = le32_to_cpu(chip->comm_page->control_register) & |
@@ -245,13 +247,13 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
245 | 247 | ||
246 | switch (clock) { | 248 | switch (clock) { |
247 | case ECHO_CLOCK_INTERNAL: | 249 | case ECHO_CLOCK_INTERNAL: |
248 | DE_ACT(("Set Gina24 clock to INTERNAL\n")); | 250 | dev_dbg(chip->card->dev, "Set Gina24 clock to INTERNAL\n"); |
249 | chip->input_clock = ECHO_CLOCK_INTERNAL; | 251 | chip->input_clock = ECHO_CLOCK_INTERNAL; |
250 | return set_sample_rate(chip, chip->sample_rate); | 252 | return set_sample_rate(chip, chip->sample_rate); |
251 | case ECHO_CLOCK_SPDIF: | 253 | case ECHO_CLOCK_SPDIF: |
252 | if (chip->digital_mode == DIGITAL_MODE_ADAT) | 254 | if (chip->digital_mode == DIGITAL_MODE_ADAT) |
253 | return -EAGAIN; | 255 | return -EAGAIN; |
254 | DE_ACT(("Set Gina24 clock to SPDIF\n")); | 256 | dev_dbg(chip->card->dev, "Set Gina24 clock to SPDIF\n"); |
255 | control_reg |= GML_SPDIF_CLOCK; | 257 | control_reg |= GML_SPDIF_CLOCK; |
256 | if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96) | 258 | if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96) |
257 | control_reg |= GML_DOUBLE_SPEED_MODE; | 259 | control_reg |= GML_DOUBLE_SPEED_MODE; |
@@ -261,21 +263,22 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
261 | case ECHO_CLOCK_ADAT: | 263 | case ECHO_CLOCK_ADAT: |
262 | if (chip->digital_mode != DIGITAL_MODE_ADAT) | 264 | if (chip->digital_mode != DIGITAL_MODE_ADAT) |
263 | return -EAGAIN; | 265 | return -EAGAIN; |
264 | DE_ACT(("Set Gina24 clock to ADAT\n")); | 266 | dev_dbg(chip->card->dev, "Set Gina24 clock to ADAT\n"); |
265 | control_reg |= GML_ADAT_CLOCK; | 267 | control_reg |= GML_ADAT_CLOCK; |
266 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 268 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
267 | break; | 269 | break; |
268 | case ECHO_CLOCK_ESYNC: | 270 | case ECHO_CLOCK_ESYNC: |
269 | DE_ACT(("Set Gina24 clock to ESYNC\n")); | 271 | dev_dbg(chip->card->dev, "Set Gina24 clock to ESYNC\n"); |
270 | control_reg |= GML_ESYNC_CLOCK; | 272 | control_reg |= GML_ESYNC_CLOCK; |
271 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 273 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
272 | break; | 274 | break; |
273 | case ECHO_CLOCK_ESYNC96: | 275 | case ECHO_CLOCK_ESYNC96: |
274 | DE_ACT(("Set Gina24 clock to ESYNC96\n")); | 276 | dev_dbg(chip->card->dev, "Set Gina24 clock to ESYNC96\n"); |
275 | control_reg |= GML_ESYNC_CLOCK | GML_DOUBLE_SPEED_MODE; | 277 | control_reg |= GML_ESYNC_CLOCK | GML_DOUBLE_SPEED_MODE; |
276 | break; | 278 | break; |
277 | default: | 279 | default: |
278 | DE_ACT(("Input clock 0x%x not supported for Gina24\n", clock)); | 280 | dev_err(chip->card->dev, |
281 | "Input clock 0x%x not supported for Gina24\n", clock); | ||
279 | return -EINVAL; | 282 | return -EINVAL; |
280 | } | 283 | } |
281 | 284 | ||
@@ -304,7 +307,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
304 | incompatible_clock = TRUE; | 307 | incompatible_clock = TRUE; |
305 | break; | 308 | break; |
306 | default: | 309 | default: |
307 | DE_ACT(("Digital mode not supported: %d\n", mode)); | 310 | dev_err(chip->card->dev, |
311 | "Digital mode not supported: %d\n", mode); | ||
308 | return -EINVAL; | 312 | return -EINVAL; |
309 | } | 313 | } |
310 | 314 | ||
@@ -344,6 +348,7 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
344 | return err; | 348 | return err; |
345 | chip->digital_mode = mode; | 349 | chip->digital_mode = mode; |
346 | 350 | ||
347 | DE_ACT(("set_digital_mode to %d\n", chip->digital_mode)); | 351 | dev_dbg(chip->card->dev, |
352 | "set_digital_mode to %d\n", chip->digital_mode); | ||
348 | return incompatible_clock; | 353 | return incompatible_clock; |
349 | } | 354 | } |
diff --git a/sound/pci/echoaudio/indigo_dsp.c b/sound/pci/echoaudio/indigo_dsp.c index 5e85f14fe5a8..cdeb073fad85 100644 --- a/sound/pci/echoaudio/indigo_dsp.c +++ b/sound/pci/echoaudio/indigo_dsp.c | |||
@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
38 | { | 38 | { |
39 | int err; | 39 | int err; |
40 | 40 | ||
41 | DE_INIT(("init_hw() - Indigo\n")); | 41 | dev_dbg(chip->card->dev, "init_hw() - Indigo\n"); |
42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO)) | 42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO)) |
43 | return -ENODEV; | 43 | return -ENODEV; |
44 | 44 | ||
45 | if ((err = init_dsp_comm_page(chip))) { | 45 | if ((err = init_dsp_comm_page(chip))) { |
46 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 46 | dev_err(chip->card->dev, |
47 | "init_hw - could not initialize DSP comm page\n"); | ||
47 | return err; | 48 | return err; |
48 | } | 49 | } |
49 | 50 | ||
@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
60 | return err; | 61 | return err; |
61 | chip->bad_board = FALSE; | 62 | chip->bad_board = FALSE; |
62 | 63 | ||
63 | DE_INIT(("init_hw done\n")); | 64 | dev_dbg(chip->card->dev, "init_hw done\n"); |
64 | return err; | 65 | return err; |
65 | } | 66 | } |
66 | 67 | ||
@@ -109,7 +110,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
109 | control_reg = MIA_32000; | 110 | control_reg = MIA_32000; |
110 | break; | 111 | break; |
111 | default: | 112 | default: |
112 | DE_ACT(("set_sample_rate: %d invalid!\n", rate)); | 113 | dev_err(chip->card->dev, |
114 | "set_sample_rate: %d invalid!\n", rate); | ||
113 | return -EINVAL; | 115 | return -EINVAL; |
114 | } | 116 | } |
115 | 117 | ||
@@ -147,7 +149,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe, | |||
147 | index = output * num_pipes_out(chip) + pipe; | 149 | index = output * num_pipes_out(chip) + pipe; |
148 | chip->comm_page->vmixer[index] = gain; | 150 | chip->comm_page->vmixer[index] = gain; |
149 | 151 | ||
150 | DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain)); | 152 | dev_dbg(chip->card->dev, |
153 | "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); | ||
151 | return 0; | 154 | return 0; |
152 | } | 155 | } |
153 | 156 | ||
diff --git a/sound/pci/echoaudio/indigo_express_dsp.c b/sound/pci/echoaudio/indigo_express_dsp.c index 2e4ab3e34a74..ceda2d7046ac 100644 --- a/sound/pci/echoaudio/indigo_express_dsp.c +++ b/sound/pci/echoaudio/indigo_express_dsp.c | |||
@@ -61,7 +61,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
61 | 61 | ||
62 | control_reg |= clock; | 62 | control_reg |= clock; |
63 | if (control_reg != old_control_reg) { | 63 | if (control_reg != old_control_reg) { |
64 | DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock)); | 64 | dev_dbg(chip->card->dev, |
65 | "set_sample_rate: %d clock %d\n", rate, clock); | ||
65 | chip->comm_page->control_register = cpu_to_le32(control_reg); | 66 | chip->comm_page->control_register = cpu_to_le32(control_reg); |
66 | chip->sample_rate = rate; | 67 | chip->sample_rate = rate; |
67 | clear_handshake(chip); | 68 | clear_handshake(chip); |
@@ -89,7 +90,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe, | |||
89 | index = output * num_pipes_out(chip) + pipe; | 90 | index = output * num_pipes_out(chip) + pipe; |
90 | chip->comm_page->vmixer[index] = gain; | 91 | chip->comm_page->vmixer[index] = gain; |
91 | 92 | ||
92 | DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain)); | 93 | dev_dbg(chip->card->dev, |
94 | "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); | ||
93 | return 0; | 95 | return 0; |
94 | } | 96 | } |
95 | 97 | ||
diff --git a/sound/pci/echoaudio/indigodj_dsp.c b/sound/pci/echoaudio/indigodj_dsp.c index 68f3c8ccc1bf..133915ca6438 100644 --- a/sound/pci/echoaudio/indigodj_dsp.c +++ b/sound/pci/echoaudio/indigodj_dsp.c | |||
@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
38 | { | 38 | { |
39 | int err; | 39 | int err; |
40 | 40 | ||
41 | DE_INIT(("init_hw() - Indigo DJ\n")); | 41 | dev_dbg(chip->card->dev, "init_hw() - Indigo DJ\n"); |
42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJ)) | 42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJ)) |
43 | return -ENODEV; | 43 | return -ENODEV; |
44 | 44 | ||
45 | if ((err = init_dsp_comm_page(chip))) { | 45 | if ((err = init_dsp_comm_page(chip))) { |
46 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 46 | dev_err(chip->card->dev, |
47 | "init_hw - could not initialize DSP comm page\n"); | ||
47 | return err; | 48 | return err; |
48 | } | 49 | } |
49 | 50 | ||
@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
60 | return err; | 61 | return err; |
61 | chip->bad_board = FALSE; | 62 | chip->bad_board = FALSE; |
62 | 63 | ||
63 | DE_INIT(("init_hw done\n")); | 64 | dev_dbg(chip->card->dev, "init_hw done\n"); |
64 | return err; | 65 | return err; |
65 | } | 66 | } |
66 | 67 | ||
@@ -109,7 +110,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
109 | control_reg = MIA_32000; | 110 | control_reg = MIA_32000; |
110 | break; | 111 | break; |
111 | default: | 112 | default: |
112 | DE_ACT(("set_sample_rate: %d invalid!\n", rate)); | 113 | dev_err(chip->card->dev, |
114 | "set_sample_rate: %d invalid!\n", rate); | ||
113 | return -EINVAL; | 115 | return -EINVAL; |
114 | } | 116 | } |
115 | 117 | ||
@@ -147,7 +149,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe, | |||
147 | index = output * num_pipes_out(chip) + pipe; | 149 | index = output * num_pipes_out(chip) + pipe; |
148 | chip->comm_page->vmixer[index] = gain; | 150 | chip->comm_page->vmixer[index] = gain; |
149 | 151 | ||
150 | DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain)); | 152 | dev_dbg(chip->card->dev, |
153 | "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); | ||
151 | return 0; | 154 | return 0; |
152 | } | 155 | } |
153 | 156 | ||
diff --git a/sound/pci/echoaudio/indigodjx_dsp.c b/sound/pci/echoaudio/indigodjx_dsp.c index bb9632c752a9..26cdfcfc5553 100644 --- a/sound/pci/echoaudio/indigodjx_dsp.c +++ b/sound/pci/echoaudio/indigodjx_dsp.c | |||
@@ -35,13 +35,14 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
35 | { | 35 | { |
36 | int err; | 36 | int err; |
37 | 37 | ||
38 | DE_INIT(("init_hw() - Indigo DJx\n")); | 38 | dev_dbg(chip->card->dev, "init_hw() - Indigo DJx\n"); |
39 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJX)) | 39 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJX)) |
40 | return -ENODEV; | 40 | return -ENODEV; |
41 | 41 | ||
42 | err = init_dsp_comm_page(chip); | 42 | err = init_dsp_comm_page(chip); |
43 | if (err < 0) { | 43 | if (err < 0) { |
44 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 44 | dev_err(chip->card->dev, |
45 | "init_hw - could not initialize DSP comm page\n"); | ||
45 | return err; | 46 | return err; |
46 | } | 47 | } |
47 | 48 | ||
@@ -59,7 +60,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
59 | return err; | 60 | return err; |
60 | chip->bad_board = FALSE; | 61 | chip->bad_board = FALSE; |
61 | 62 | ||
62 | DE_INIT(("init_hw done\n")); | 63 | dev_dbg(chip->card->dev, "init_hw done\n"); |
63 | return err; | 64 | return err; |
64 | } | 65 | } |
65 | 66 | ||
diff --git a/sound/pci/echoaudio/indigoio_dsp.c b/sound/pci/echoaudio/indigoio_dsp.c index beb9a5b69892..5e6df7c25055 100644 --- a/sound/pci/echoaudio/indigoio_dsp.c +++ b/sound/pci/echoaudio/indigoio_dsp.c | |||
@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
38 | { | 38 | { |
39 | int err; | 39 | int err; |
40 | 40 | ||
41 | DE_INIT(("init_hw() - Indigo IO\n")); | 41 | dev_dbg(chip->card->dev, "init_hw() - Indigo IO\n"); |
42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IO)) | 42 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IO)) |
43 | return -ENODEV; | 43 | return -ENODEV; |
44 | 44 | ||
45 | if ((err = init_dsp_comm_page(chip))) { | 45 | if ((err = init_dsp_comm_page(chip))) { |
46 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 46 | dev_err(chip->card->dev, |
47 | "init_hw - could not initialize DSP comm page\n"); | ||
47 | return err; | 48 | return err; |
48 | } | 49 | } |
49 | 50 | ||
@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
60 | return err; | 61 | return err; |
61 | chip->bad_board = FALSE; | 62 | chip->bad_board = FALSE; |
62 | 63 | ||
63 | DE_INIT(("init_hw done\n")); | 64 | dev_dbg(chip->card->dev, "init_hw done\n"); |
64 | return err; | 65 | return err; |
65 | } | 66 | } |
66 | 67 | ||
@@ -118,7 +119,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe, | |||
118 | index = output * num_pipes_out(chip) + pipe; | 119 | index = output * num_pipes_out(chip) + pipe; |
119 | chip->comm_page->vmixer[index] = gain; | 120 | chip->comm_page->vmixer[index] = gain; |
120 | 121 | ||
121 | DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain)); | 122 | dev_dbg(chip->card->dev, |
123 | "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); | ||
122 | return 0; | 124 | return 0; |
123 | } | 125 | } |
124 | 126 | ||
diff --git a/sound/pci/echoaudio/indigoiox_dsp.c b/sound/pci/echoaudio/indigoiox_dsp.c index 394c6e76bcbc..90cdd271d9fc 100644 --- a/sound/pci/echoaudio/indigoiox_dsp.c +++ b/sound/pci/echoaudio/indigoiox_dsp.c | |||
@@ -35,13 +35,14 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
35 | { | 35 | { |
36 | int err; | 36 | int err; |
37 | 37 | ||
38 | DE_INIT(("init_hw() - Indigo IOx\n")); | 38 | dev_dbg(chip->card->dev, "init_hw() - Indigo IOx\n"); |
39 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX)) | 39 | if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX)) |
40 | return -ENODEV; | 40 | return -ENODEV; |
41 | 41 | ||
42 | err = init_dsp_comm_page(chip); | 42 | err = init_dsp_comm_page(chip); |
43 | if (err < 0) { | 43 | if (err < 0) { |
44 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 44 | dev_err(chip->card->dev, |
45 | "init_hw - could not initialize DSP comm page\n"); | ||
45 | return err; | 46 | return err; |
46 | } | 47 | } |
47 | 48 | ||
@@ -59,7 +60,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
59 | return err; | 60 | return err; |
60 | chip->bad_board = FALSE; | 61 | chip->bad_board = FALSE; |
61 | 62 | ||
62 | DE_INIT(("init_hw done\n")); | 63 | dev_dbg(chip->card->dev, "init_hw done\n"); |
63 | return err; | 64 | return err; |
64 | } | 65 | } |
65 | 66 | ||
diff --git a/sound/pci/echoaudio/layla20_dsp.c b/sound/pci/echoaudio/layla20_dsp.c index 53ce94605044..7f0f6ea08ca7 100644 --- a/sound/pci/echoaudio/layla20_dsp.c +++ b/sound/pci/echoaudio/layla20_dsp.c | |||
@@ -40,12 +40,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
40 | { | 40 | { |
41 | int err; | 41 | int err; |
42 | 42 | ||
43 | DE_INIT(("init_hw() - Layla20\n")); | 43 | dev_dbg(chip->card->dev, "init_hw() - Layla20\n"); |
44 | if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA20)) | 44 | if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA20)) |
45 | return -ENODEV; | 45 | return -ENODEV; |
46 | 46 | ||
47 | if ((err = init_dsp_comm_page(chip))) { | 47 | if ((err = init_dsp_comm_page(chip))) { |
48 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 48 | dev_err(chip->card->dev, |
49 | "init_hw - could not initialize DSP comm page\n"); | ||
49 | return err; | 50 | return err; |
50 | } | 51 | } |
51 | 52 | ||
@@ -64,7 +65,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
64 | return err; | 65 | return err; |
65 | chip->bad_board = FALSE; | 66 | chip->bad_board = FALSE; |
66 | 67 | ||
67 | DE_INIT(("init_hw done\n")); | 68 | dev_dbg(chip->card->dev, "init_hw done\n"); |
68 | return err; | 69 | return err; |
69 | } | 70 | } |
70 | 71 | ||
@@ -121,7 +122,8 @@ static int check_asic_status(struct echoaudio *chip) | |||
121 | /* The DSP will return a value to indicate whether or not | 122 | /* The DSP will return a value to indicate whether or not |
122 | the ASIC is currently loaded */ | 123 | the ASIC is currently loaded */ |
123 | if (read_dsp(chip, &asic_status) < 0) { | 124 | if (read_dsp(chip, &asic_status) < 0) { |
124 | DE_ACT(("check_asic_status: failed on read_dsp\n")); | 125 | dev_err(chip->card->dev, |
126 | "check_asic_status: failed on read_dsp\n"); | ||
125 | return -EIO; | 127 | return -EIO; |
126 | } | 128 | } |
127 | 129 | ||
@@ -164,8 +166,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
164 | /* Only set the clock for internal mode. Do not return failure, | 166 | /* Only set the clock for internal mode. Do not return failure, |
165 | simply treat it as a non-event. */ | 167 | simply treat it as a non-event. */ |
166 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { | 168 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { |
167 | DE_ACT(("set_sample_rate: Cannot set sample rate - " | 169 | dev_warn(chip->card->dev, |
168 | "clock not set to CLK_CLOCKININTERNAL\n")); | 170 | "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); |
169 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 171 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
170 | chip->sample_rate = rate; | 172 | chip->sample_rate = rate; |
171 | return 0; | 173 | return 0; |
@@ -174,7 +176,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
174 | if (wait_handshake(chip)) | 176 | if (wait_handshake(chip)) |
175 | return -EIO; | 177 | return -EIO; |
176 | 178 | ||
177 | DE_ACT(("set_sample_rate(%d)\n", rate)); | 179 | dev_dbg(chip->card->dev, "set_sample_rate(%d)\n", rate); |
178 | chip->sample_rate = rate; | 180 | chip->sample_rate = rate; |
179 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 181 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
180 | clear_handshake(chip); | 182 | clear_handshake(chip); |
@@ -188,29 +190,30 @@ static int set_input_clock(struct echoaudio *chip, u16 clock_source) | |||
188 | u16 clock; | 190 | u16 clock; |
189 | u32 rate; | 191 | u32 rate; |
190 | 192 | ||
191 | DE_ACT(("set_input_clock:\n")); | 193 | dev_dbg(chip->card->dev, "set_input_clock:\n"); |
192 | rate = 0; | 194 | rate = 0; |
193 | switch (clock_source) { | 195 | switch (clock_source) { |
194 | case ECHO_CLOCK_INTERNAL: | 196 | case ECHO_CLOCK_INTERNAL: |
195 | DE_ACT(("Set Layla20 clock to INTERNAL\n")); | 197 | dev_dbg(chip->card->dev, "Set Layla20 clock to INTERNAL\n"); |
196 | rate = chip->sample_rate; | 198 | rate = chip->sample_rate; |
197 | clock = LAYLA20_CLOCK_INTERNAL; | 199 | clock = LAYLA20_CLOCK_INTERNAL; |
198 | break; | 200 | break; |
199 | case ECHO_CLOCK_SPDIF: | 201 | case ECHO_CLOCK_SPDIF: |
200 | DE_ACT(("Set Layla20 clock to SPDIF\n")); | 202 | dev_dbg(chip->card->dev, "Set Layla20 clock to SPDIF\n"); |
201 | clock = LAYLA20_CLOCK_SPDIF; | 203 | clock = LAYLA20_CLOCK_SPDIF; |
202 | break; | 204 | break; |
203 | case ECHO_CLOCK_WORD: | 205 | case ECHO_CLOCK_WORD: |
204 | DE_ACT(("Set Layla20 clock to WORD\n")); | 206 | dev_dbg(chip->card->dev, "Set Layla20 clock to WORD\n"); |
205 | clock = LAYLA20_CLOCK_WORD; | 207 | clock = LAYLA20_CLOCK_WORD; |
206 | break; | 208 | break; |
207 | case ECHO_CLOCK_SUPER: | 209 | case ECHO_CLOCK_SUPER: |
208 | DE_ACT(("Set Layla20 clock to SUPER\n")); | 210 | dev_dbg(chip->card->dev, "Set Layla20 clock to SUPER\n"); |
209 | clock = LAYLA20_CLOCK_SUPER; | 211 | clock = LAYLA20_CLOCK_SUPER; |
210 | break; | 212 | break; |
211 | default: | 213 | default: |
212 | DE_ACT(("Input clock 0x%x not supported for Layla24\n", | 214 | dev_err(chip->card->dev, |
213 | clock_source)); | 215 | "Input clock 0x%x not supported for Layla24\n", |
216 | clock_source); | ||
214 | return -EINVAL; | 217 | return -EINVAL; |
215 | } | 218 | } |
216 | chip->input_clock = clock_source; | 219 | chip->input_clock = clock_source; |
@@ -229,7 +232,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock_source) | |||
229 | 232 | ||
230 | static int set_output_clock(struct echoaudio *chip, u16 clock) | 233 | static int set_output_clock(struct echoaudio *chip, u16 clock) |
231 | { | 234 | { |
232 | DE_ACT(("set_output_clock: %d\n", clock)); | 235 | dev_dbg(chip->card->dev, "set_output_clock: %d\n", clock); |
233 | switch (clock) { | 236 | switch (clock) { |
234 | case ECHO_CLOCK_SUPER: | 237 | case ECHO_CLOCK_SUPER: |
235 | clock = LAYLA20_OUTPUT_CLOCK_SUPER; | 238 | clock = LAYLA20_OUTPUT_CLOCK_SUPER; |
@@ -238,7 +241,7 @@ static int set_output_clock(struct echoaudio *chip, u16 clock) | |||
238 | clock = LAYLA20_OUTPUT_CLOCK_WORD; | 241 | clock = LAYLA20_OUTPUT_CLOCK_WORD; |
239 | break; | 242 | break; |
240 | default: | 243 | default: |
241 | DE_ACT(("set_output_clock wrong clock\n")); | 244 | dev_err(chip->card->dev, "set_output_clock wrong clock\n"); |
242 | return -EINVAL; | 245 | return -EINVAL; |
243 | } | 246 | } |
244 | 247 | ||
@@ -283,7 +286,7 @@ static int update_flags(struct echoaudio *chip) | |||
283 | 286 | ||
284 | static int set_professional_spdif(struct echoaudio *chip, char prof) | 287 | static int set_professional_spdif(struct echoaudio *chip, char prof) |
285 | { | 288 | { |
286 | DE_ACT(("set_professional_spdif %d\n", prof)); | 289 | dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof); |
287 | if (prof) | 290 | if (prof) |
288 | chip->comm_page->flags |= | 291 | chip->comm_page->flags |= |
289 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); | 292 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); |
diff --git a/sound/pci/echoaudio/layla24_dsp.c b/sound/pci/echoaudio/layla24_dsp.c index 8c041647f285..eb8f218f79fe 100644 --- a/sound/pci/echoaudio/layla24_dsp.c +++ b/sound/pci/echoaudio/layla24_dsp.c | |||
@@ -40,12 +40,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
40 | { | 40 | { |
41 | int err; | 41 | int err; |
42 | 42 | ||
43 | DE_INIT(("init_hw() - Layla24\n")); | 43 | dev_dbg(chip->card->dev, "init_hw() - Layla24\n"); |
44 | if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA24)) | 44 | if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA24)) |
45 | return -ENODEV; | 45 | return -ENODEV; |
46 | 46 | ||
47 | if ((err = init_dsp_comm_page(chip))) { | 47 | if ((err = init_dsp_comm_page(chip))) { |
48 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 48 | dev_err(chip->card->dev, |
49 | "init_hw - could not initialize DSP comm page\n"); | ||
49 | return err; | 50 | return err; |
50 | } | 51 | } |
51 | 52 | ||
@@ -69,7 +70,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
69 | if ((err = init_line_levels(chip)) < 0) | 70 | if ((err = init_line_levels(chip)) < 0) |
70 | return err; | 71 | return err; |
71 | 72 | ||
72 | DE_INIT(("init_hw done\n")); | 73 | dev_dbg(chip->card->dev, "init_hw done\n"); |
73 | return err; | 74 | return err; |
74 | } | 75 | } |
75 | 76 | ||
@@ -117,7 +118,7 @@ static int load_asic(struct echoaudio *chip) | |||
117 | if (chip->asic_loaded) | 118 | if (chip->asic_loaded) |
118 | return 1; | 119 | return 1; |
119 | 120 | ||
120 | DE_INIT(("load_asic\n")); | 121 | dev_dbg(chip->card->dev, "load_asic\n"); |
121 | 122 | ||
122 | /* Give the DSP a few milliseconds to settle down */ | 123 | /* Give the DSP a few milliseconds to settle down */ |
123 | mdelay(10); | 124 | mdelay(10); |
@@ -151,7 +152,7 @@ static int load_asic(struct echoaudio *chip) | |||
151 | err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ, | 152 | err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ, |
152 | TRUE); | 153 | TRUE); |
153 | 154 | ||
154 | DE_INIT(("load_asic() done\n")); | 155 | dev_dbg(chip->card->dev, "load_asic() done\n"); |
155 | return err; | 156 | return err; |
156 | } | 157 | } |
157 | 158 | ||
@@ -167,8 +168,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
167 | 168 | ||
168 | /* Only set the clock for internal mode. */ | 169 | /* Only set the clock for internal mode. */ |
169 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { | 170 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { |
170 | DE_ACT(("set_sample_rate: Cannot set sample rate - " | 171 | dev_warn(chip->card->dev, |
171 | "clock not set to CLK_CLOCKININTERNAL\n")); | 172 | "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); |
172 | /* Save the rate anyhow */ | 173 | /* Save the rate anyhow */ |
173 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 174 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
174 | chip->sample_rate = rate; | 175 | chip->sample_rate = rate; |
@@ -241,7 +242,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
241 | 242 | ||
242 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP ? */ | 243 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP ? */ |
243 | chip->sample_rate = rate; | 244 | chip->sample_rate = rate; |
244 | DE_ACT(("set_sample_rate: %d clock %d\n", rate, control_reg)); | 245 | dev_dbg(chip->card->dev, |
246 | "set_sample_rate: %d clock %d\n", rate, control_reg); | ||
245 | 247 | ||
246 | return write_control_reg(chip, control_reg, FALSE); | 248 | return write_control_reg(chip, control_reg, FALSE); |
247 | } | 249 | } |
@@ -260,7 +262,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
260 | /* Pick the new clock */ | 262 | /* Pick the new clock */ |
261 | switch (clock) { | 263 | switch (clock) { |
262 | case ECHO_CLOCK_INTERNAL: | 264 | case ECHO_CLOCK_INTERNAL: |
263 | DE_ACT(("Set Layla24 clock to INTERNAL\n")); | 265 | dev_dbg(chip->card->dev, "Set Layla24 clock to INTERNAL\n"); |
264 | chip->input_clock = ECHO_CLOCK_INTERNAL; | 266 | chip->input_clock = ECHO_CLOCK_INTERNAL; |
265 | return set_sample_rate(chip, chip->sample_rate); | 267 | return set_sample_rate(chip, chip->sample_rate); |
266 | case ECHO_CLOCK_SPDIF: | 268 | case ECHO_CLOCK_SPDIF: |
@@ -269,7 +271,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
269 | control_reg |= GML_SPDIF_CLOCK; | 271 | control_reg |= GML_SPDIF_CLOCK; |
270 | /* Layla24 doesn't support 96KHz S/PDIF */ | 272 | /* Layla24 doesn't support 96KHz S/PDIF */ |
271 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 273 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
272 | DE_ACT(("Set Layla24 clock to SPDIF\n")); | 274 | dev_dbg(chip->card->dev, "Set Layla24 clock to SPDIF\n"); |
273 | break; | 275 | break; |
274 | case ECHO_CLOCK_WORD: | 276 | case ECHO_CLOCK_WORD: |
275 | control_reg |= GML_WORD_CLOCK; | 277 | control_reg |= GML_WORD_CLOCK; |
@@ -277,17 +279,18 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
277 | control_reg |= GML_DOUBLE_SPEED_MODE; | 279 | control_reg |= GML_DOUBLE_SPEED_MODE; |
278 | else | 280 | else |
279 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 281 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
280 | DE_ACT(("Set Layla24 clock to WORD\n")); | 282 | dev_dbg(chip->card->dev, "Set Layla24 clock to WORD\n"); |
281 | break; | 283 | break; |
282 | case ECHO_CLOCK_ADAT: | 284 | case ECHO_CLOCK_ADAT: |
283 | if (chip->digital_mode != DIGITAL_MODE_ADAT) | 285 | if (chip->digital_mode != DIGITAL_MODE_ADAT) |
284 | return -EAGAIN; | 286 | return -EAGAIN; |
285 | control_reg |= GML_ADAT_CLOCK; | 287 | control_reg |= GML_ADAT_CLOCK; |
286 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 288 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
287 | DE_ACT(("Set Layla24 clock to ADAT\n")); | 289 | dev_dbg(chip->card->dev, "Set Layla24 clock to ADAT\n"); |
288 | break; | 290 | break; |
289 | default: | 291 | default: |
290 | DE_ACT(("Input clock 0x%x not supported for Layla24\n", clock)); | 292 | dev_err(chip->card->dev, |
293 | "Input clock 0x%x not supported for Layla24\n", clock); | ||
291 | return -EINVAL; | 294 | return -EINVAL; |
292 | } | 295 | } |
293 | 296 | ||
@@ -353,7 +356,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
353 | asic = FW_LAYLA24_2A_ASIC; | 356 | asic = FW_LAYLA24_2A_ASIC; |
354 | break; | 357 | break; |
355 | default: | 358 | default: |
356 | DE_ACT(("Digital mode not supported: %d\n", mode)); | 359 | dev_err(chip->card->dev, |
360 | "Digital mode not supported: %d\n", mode); | ||
357 | return -EINVAL; | 361 | return -EINVAL; |
358 | } | 362 | } |
359 | 363 | ||
@@ -393,6 +397,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
393 | return err; | 397 | return err; |
394 | chip->digital_mode = mode; | 398 | chip->digital_mode = mode; |
395 | 399 | ||
396 | DE_ACT(("set_digital_mode to %d\n", mode)); | 400 | dev_dbg(chip->card->dev, "set_digital_mode to %d\n", mode); |
397 | return incompatible_clock; | 401 | return incompatible_clock; |
398 | } | 402 | } |
diff --git a/sound/pci/echoaudio/mia_dsp.c b/sound/pci/echoaudio/mia_dsp.c index 6ebfa6e7ab9e..ed2f21dcd1c9 100644 --- a/sound/pci/echoaudio/mia_dsp.c +++ b/sound/pci/echoaudio/mia_dsp.c | |||
@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
41 | { | 41 | { |
42 | int err; | 42 | int err; |
43 | 43 | ||
44 | DE_INIT(("init_hw() - Mia\n")); | 44 | dev_dbg(chip->card->dev, "init_hw() - Mia\n"); |
45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != MIA)) | 45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != MIA)) |
46 | return -ENODEV; | 46 | return -ENODEV; |
47 | 47 | ||
48 | if ((err = init_dsp_comm_page(chip))) { | 48 | if ((err = init_dsp_comm_page(chip))) { |
49 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 49 | dev_err(chip->card->dev, |
50 | "init_hw - could not initialize DSP comm page\n"); | ||
50 | return err; | 51 | return err; |
51 | } | 52 | } |
52 | 53 | ||
@@ -66,7 +67,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
66 | return err; | 67 | return err; |
67 | chip->bad_board = FALSE; | 68 | chip->bad_board = FALSE; |
68 | 69 | ||
69 | DE_INIT(("init_hw done\n")); | 70 | dev_dbg(chip->card->dev, "init_hw done\n"); |
70 | return err; | 71 | return err; |
71 | } | 72 | } |
72 | 73 | ||
@@ -126,7 +127,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
126 | control_reg = MIA_32000; | 127 | control_reg = MIA_32000; |
127 | break; | 128 | break; |
128 | default: | 129 | default: |
129 | DE_ACT(("set_sample_rate: %d invalid!\n", rate)); | 130 | dev_err(chip->card->dev, |
131 | "set_sample_rate: %d invalid!\n", rate); | ||
130 | return -EINVAL; | 132 | return -EINVAL; |
131 | } | 133 | } |
132 | 134 | ||
@@ -153,7 +155,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
153 | 155 | ||
154 | static int set_input_clock(struct echoaudio *chip, u16 clock) | 156 | static int set_input_clock(struct echoaudio *chip, u16 clock) |
155 | { | 157 | { |
156 | DE_ACT(("set_input_clock(%d)\n", clock)); | 158 | dev_dbg(chip->card->dev, "set_input_clock(%d)\n", clock); |
157 | if (snd_BUG_ON(clock != ECHO_CLOCK_INTERNAL && | 159 | if (snd_BUG_ON(clock != ECHO_CLOCK_INTERNAL && |
158 | clock != ECHO_CLOCK_SPDIF)) | 160 | clock != ECHO_CLOCK_SPDIF)) |
159 | return -EINVAL; | 161 | return -EINVAL; |
@@ -181,7 +183,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe, | |||
181 | index = output * num_pipes_out(chip) + pipe; | 183 | index = output * num_pipes_out(chip) + pipe; |
182 | chip->comm_page->vmixer[index] = gain; | 184 | chip->comm_page->vmixer[index] = gain; |
183 | 185 | ||
184 | DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain)); | 186 | dev_dbg(chip->card->dev, |
187 | "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); | ||
185 | return 0; | 188 | return 0; |
186 | } | 189 | } |
187 | 190 | ||
@@ -211,7 +214,7 @@ static int update_flags(struct echoaudio *chip) | |||
211 | 214 | ||
212 | static int set_professional_spdif(struct echoaudio *chip, char prof) | 215 | static int set_professional_spdif(struct echoaudio *chip, char prof) |
213 | { | 216 | { |
214 | DE_ACT(("set_professional_spdif %d\n", prof)); | 217 | dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof); |
215 | if (prof) | 218 | if (prof) |
216 | chip->comm_page->flags |= | 219 | chip->comm_page->flags |= |
217 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); | 220 | cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF); |
diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c index 7f4dfae0323a..8d43c5a4976b 100644 --- a/sound/pci/echoaudio/midi.c +++ b/sound/pci/echoaudio/midi.c | |||
@@ -36,7 +36,7 @@ | |||
36 | /* Start and stop Midi input */ | 36 | /* Start and stop Midi input */ |
37 | static int enable_midi_input(struct echoaudio *chip, char enable) | 37 | static int enable_midi_input(struct echoaudio *chip, char enable) |
38 | { | 38 | { |
39 | DE_MID(("enable_midi_input(%d)\n", enable)); | 39 | dev_dbg(chip->card->dev, "enable_midi_input(%d)\n", enable); |
40 | 40 | ||
41 | if (wait_handshake(chip)) | 41 | if (wait_handshake(chip)) |
42 | return -EIO; | 42 | return -EIO; |
@@ -74,7 +74,7 @@ static int write_midi(struct echoaudio *chip, u8 *data, int bytes) | |||
74 | chip->comm_page->midi_out_free_count = 0; | 74 | chip->comm_page->midi_out_free_count = 0; |
75 | clear_handshake(chip); | 75 | clear_handshake(chip); |
76 | send_vector(chip, DSP_VC_MIDI_WRITE); | 76 | send_vector(chip, DSP_VC_MIDI_WRITE); |
77 | DE_MID(("write_midi: %d\n", bytes)); | 77 | dev_dbg(chip->card->dev, "write_midi: %d\n", bytes); |
78 | return bytes; | 78 | return bytes; |
79 | } | 79 | } |
80 | 80 | ||
@@ -157,7 +157,7 @@ static int snd_echo_midi_input_open(struct snd_rawmidi_substream *substream) | |||
157 | struct echoaudio *chip = substream->rmidi->private_data; | 157 | struct echoaudio *chip = substream->rmidi->private_data; |
158 | 158 | ||
159 | chip->midi_in = substream; | 159 | chip->midi_in = substream; |
160 | DE_MID(("rawmidi_iopen\n")); | 160 | dev_dbg(chip->card->dev, "rawmidi_iopen\n"); |
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | 163 | ||
@@ -183,7 +183,7 @@ static int snd_echo_midi_input_close(struct snd_rawmidi_substream *substream) | |||
183 | struct echoaudio *chip = substream->rmidi->private_data; | 183 | struct echoaudio *chip = substream->rmidi->private_data; |
184 | 184 | ||
185 | chip->midi_in = NULL; | 185 | chip->midi_in = NULL; |
186 | DE_MID(("rawmidi_iclose\n")); | 186 | dev_dbg(chip->card->dev, "rawmidi_iclose\n"); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
@@ -196,7 +196,7 @@ static int snd_echo_midi_output_open(struct snd_rawmidi_substream *substream) | |||
196 | chip->tinuse = 0; | 196 | chip->tinuse = 0; |
197 | chip->midi_full = 0; | 197 | chip->midi_full = 0; |
198 | chip->midi_out = substream; | 198 | chip->midi_out = substream; |
199 | DE_MID(("rawmidi_oopen\n")); | 199 | dev_dbg(chip->card->dev, "rawmidi_open\n"); |
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
@@ -209,7 +209,7 @@ static void snd_echo_midi_output_write(unsigned long data) | |||
209 | int bytes, sent, time; | 209 | int bytes, sent, time; |
210 | unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; | 210 | unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; |
211 | 211 | ||
212 | DE_MID(("snd_echo_midi_output_write\n")); | 212 | dev_dbg(chip->card->dev, "snd_echo_midi_output_write\n"); |
213 | /* No interrupts are involved: we have to check at regular intervals | 213 | /* No interrupts are involved: we have to check at regular intervals |
214 | if the card's output buffer has room for new data. */ | 214 | if the card's output buffer has room for new data. */ |
215 | sent = bytes = 0; | 215 | sent = bytes = 0; |
@@ -218,7 +218,7 @@ static void snd_echo_midi_output_write(unsigned long data) | |||
218 | if (!snd_rawmidi_transmit_empty(chip->midi_out)) { | 218 | if (!snd_rawmidi_transmit_empty(chip->midi_out)) { |
219 | bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf, | 219 | bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf, |
220 | MIDI_OUT_BUFFER_SIZE - 1); | 220 | MIDI_OUT_BUFFER_SIZE - 1); |
221 | DE_MID(("Try to send %d bytes...\n", bytes)); | 221 | dev_dbg(chip->card->dev, "Try to send %d bytes...\n", bytes); |
222 | sent = write_midi(chip, buf, bytes); | 222 | sent = write_midi(chip, buf, bytes); |
223 | if (sent < 0) { | 223 | if (sent < 0) { |
224 | dev_err(chip->card->dev, | 224 | dev_err(chip->card->dev, |
@@ -227,12 +227,12 @@ static void snd_echo_midi_output_write(unsigned long data) | |||
227 | sent = 9000; | 227 | sent = 9000; |
228 | chip->midi_full = 1; | 228 | chip->midi_full = 1; |
229 | } else if (sent > 0) { | 229 | } else if (sent > 0) { |
230 | DE_MID(("%d bytes sent\n", sent)); | 230 | dev_dbg(chip->card->dev, "%d bytes sent\n", sent); |
231 | snd_rawmidi_transmit_ack(chip->midi_out, sent); | 231 | snd_rawmidi_transmit_ack(chip->midi_out, sent); |
232 | } else { | 232 | } else { |
233 | /* Buffer is full. DSP's internal buffer is 64 (128 ?) | 233 | /* Buffer is full. DSP's internal buffer is 64 (128 ?) |
234 | bytes long. Let's wait until half of them are sent */ | 234 | bytes long. Let's wait until half of them are sent */ |
235 | DE_MID(("Full\n")); | 235 | dev_dbg(chip->card->dev, "Full\n"); |
236 | sent = 32; | 236 | sent = 32; |
237 | chip->midi_full = 1; | 237 | chip->midi_full = 1; |
238 | } | 238 | } |
@@ -244,7 +244,8 @@ static void snd_echo_midi_output_write(unsigned long data) | |||
244 | sent */ | 244 | sent */ |
245 | time = (sent << 3) / 25 + 1; /* 8/25=0.32ms to send a byte */ | 245 | time = (sent << 3) / 25 + 1; /* 8/25=0.32ms to send a byte */ |
246 | mod_timer(&chip->timer, jiffies + (time * HZ + 999) / 1000); | 246 | mod_timer(&chip->timer, jiffies + (time * HZ + 999) / 1000); |
247 | DE_MID(("Timer armed(%d)\n", ((time * HZ + 999) / 1000))); | 247 | dev_dbg(chip->card->dev, |
248 | "Timer armed(%d)\n", ((time * HZ + 999) / 1000)); | ||
248 | } | 249 | } |
249 | spin_unlock_irqrestore(&chip->lock, flags); | 250 | spin_unlock_irqrestore(&chip->lock, flags); |
250 | } | 251 | } |
@@ -256,7 +257,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream | |||
256 | { | 257 | { |
257 | struct echoaudio *chip = substream->rmidi->private_data; | 258 | struct echoaudio *chip = substream->rmidi->private_data; |
258 | 259 | ||
259 | DE_MID(("snd_echo_midi_output_trigger(%d)\n", up)); | 260 | dev_dbg(chip->card->dev, "snd_echo_midi_output_trigger(%d)\n", up); |
260 | spin_lock_irq(&chip->lock); | 261 | spin_lock_irq(&chip->lock); |
261 | if (up) { | 262 | if (up) { |
262 | if (!chip->tinuse) { | 263 | if (!chip->tinuse) { |
@@ -270,7 +271,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream | |||
270 | chip->tinuse = 0; | 271 | chip->tinuse = 0; |
271 | spin_unlock_irq(&chip->lock); | 272 | spin_unlock_irq(&chip->lock); |
272 | del_timer_sync(&chip->timer); | 273 | del_timer_sync(&chip->timer); |
273 | DE_MID(("Timer removed\n")); | 274 | dev_dbg(chip->card->dev, "Timer removed\n"); |
274 | return; | 275 | return; |
275 | } | 276 | } |
276 | } | 277 | } |
@@ -287,7 +288,7 @@ static int snd_echo_midi_output_close(struct snd_rawmidi_substream *substream) | |||
287 | struct echoaudio *chip = substream->rmidi->private_data; | 288 | struct echoaudio *chip = substream->rmidi->private_data; |
288 | 289 | ||
289 | chip->midi_out = NULL; | 290 | chip->midi_out = NULL; |
290 | DE_MID(("rawmidi_oclose\n")); | 291 | dev_dbg(chip->card->dev, "rawmidi_oclose\n"); |
291 | return 0; | 292 | return 0; |
292 | } | 293 | } |
293 | 294 | ||
@@ -327,6 +328,6 @@ static int snd_echo_midi_create(struct snd_card *card, | |||
327 | 328 | ||
328 | chip->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | | 329 | chip->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | |
329 | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX; | 330 | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX; |
330 | DE_INIT(("MIDI ok\n")); | 331 | dev_dbg(chip->card->dev, "MIDI ok\n"); |
331 | return 0; | 332 | return 0; |
332 | } | 333 | } |
diff --git a/sound/pci/echoaudio/mona_dsp.c b/sound/pci/echoaudio/mona_dsp.c index 6e6a7eb555b8..cc46a8c8e3dd 100644 --- a/sound/pci/echoaudio/mona_dsp.c +++ b/sound/pci/echoaudio/mona_dsp.c | |||
@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
41 | { | 41 | { |
42 | int err; | 42 | int err; |
43 | 43 | ||
44 | DE_INIT(("init_hw() - Mona\n")); | 44 | dev_dbg(chip->card->dev, "init_hw() - Mona\n"); |
45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != MONA)) | 45 | if (snd_BUG_ON((subdevice_id & 0xfff0) != MONA)) |
46 | return -ENODEV; | 46 | return -ENODEV; |
47 | 47 | ||
48 | if ((err = init_dsp_comm_page(chip))) { | 48 | if ((err = init_dsp_comm_page(chip))) { |
49 | DE_INIT(("init_hw - could not initialize DSP comm page\n")); | 49 | dev_err(chip->card->dev, |
50 | "init_hw - could not initialize DSP comm page\n"); | ||
50 | return err; | 51 | return err; |
51 | } | 52 | } |
52 | 53 | ||
@@ -71,7 +72,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
71 | return err; | 72 | return err; |
72 | chip->bad_board = FALSE; | 73 | chip->bad_board = FALSE; |
73 | 74 | ||
74 | DE_INIT(("init_hw done\n")); | 75 | dev_dbg(chip->card->dev, "init_hw done\n"); |
75 | return err; | 76 | return err; |
76 | } | 77 | } |
77 | 78 | ||
@@ -202,8 +203,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
202 | 203 | ||
203 | /* Only set the clock for internal mode. */ | 204 | /* Only set the clock for internal mode. */ |
204 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { | 205 | if (chip->input_clock != ECHO_CLOCK_INTERNAL) { |
205 | DE_ACT(("set_sample_rate: Cannot set sample rate - " | 206 | dev_dbg(chip->card->dev, |
206 | "clock not set to CLK_CLOCKININTERNAL\n")); | 207 | "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); |
207 | /* Save the rate anyhow */ | 208 | /* Save the rate anyhow */ |
208 | chip->comm_page->sample_rate = cpu_to_le32(rate); | 209 | chip->comm_page->sample_rate = cpu_to_le32(rate); |
209 | chip->sample_rate = rate; | 210 | chip->sample_rate = rate; |
@@ -279,7 +280,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
279 | clock = GML_8KHZ; | 280 | clock = GML_8KHZ; |
280 | break; | 281 | break; |
281 | default: | 282 | default: |
282 | DE_ACT(("set_sample_rate: %d invalid!\n", rate)); | 283 | dev_err(chip->card->dev, |
284 | "set_sample_rate: %d invalid!\n", rate); | ||
283 | return -EINVAL; | 285 | return -EINVAL; |
284 | } | 286 | } |
285 | 287 | ||
@@ -287,7 +289,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
287 | 289 | ||
288 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ | 290 | chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ |
289 | chip->sample_rate = rate; | 291 | chip->sample_rate = rate; |
290 | DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock)); | 292 | dev_dbg(chip->card->dev, |
293 | "set_sample_rate: %d clock %d\n", rate, clock); | ||
291 | 294 | ||
292 | return write_control_reg(chip, control_reg, force_write); | 295 | return write_control_reg(chip, control_reg, force_write); |
293 | } | 296 | } |
@@ -299,7 +302,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
299 | u32 control_reg, clocks_from_dsp; | 302 | u32 control_reg, clocks_from_dsp; |
300 | int err; | 303 | int err; |
301 | 304 | ||
302 | DE_ACT(("set_input_clock:\n")); | 305 | dev_dbg(chip->card->dev, "set_input_clock:\n"); |
303 | 306 | ||
304 | /* Prevent two simultaneous calls to switch_asic() */ | 307 | /* Prevent two simultaneous calls to switch_asic() */ |
305 | if (atomic_read(&chip->opencount)) | 308 | if (atomic_read(&chip->opencount)) |
@@ -312,7 +315,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
312 | 315 | ||
313 | switch (clock) { | 316 | switch (clock) { |
314 | case ECHO_CLOCK_INTERNAL: | 317 | case ECHO_CLOCK_INTERNAL: |
315 | DE_ACT(("Set Mona clock to INTERNAL\n")); | 318 | dev_dbg(chip->card->dev, "Set Mona clock to INTERNAL\n"); |
316 | chip->input_clock = ECHO_CLOCK_INTERNAL; | 319 | chip->input_clock = ECHO_CLOCK_INTERNAL; |
317 | return set_sample_rate(chip, chip->sample_rate); | 320 | return set_sample_rate(chip, chip->sample_rate); |
318 | case ECHO_CLOCK_SPDIF: | 321 | case ECHO_CLOCK_SPDIF: |
@@ -324,7 +327,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
324 | spin_lock_irq(&chip->lock); | 327 | spin_lock_irq(&chip->lock); |
325 | if (err < 0) | 328 | if (err < 0) |
326 | return err; | 329 | return err; |
327 | DE_ACT(("Set Mona clock to SPDIF\n")); | 330 | dev_dbg(chip->card->dev, "Set Mona clock to SPDIF\n"); |
328 | control_reg |= GML_SPDIF_CLOCK; | 331 | control_reg |= GML_SPDIF_CLOCK; |
329 | if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96) | 332 | if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96) |
330 | control_reg |= GML_DOUBLE_SPEED_MODE; | 333 | control_reg |= GML_DOUBLE_SPEED_MODE; |
@@ -332,7 +335,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
332 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 335 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
333 | break; | 336 | break; |
334 | case ECHO_CLOCK_WORD: | 337 | case ECHO_CLOCK_WORD: |
335 | DE_ACT(("Set Mona clock to WORD\n")); | 338 | dev_dbg(chip->card->dev, "Set Mona clock to WORD\n"); |
336 | spin_unlock_irq(&chip->lock); | 339 | spin_unlock_irq(&chip->lock); |
337 | err = switch_asic(chip, clocks_from_dsp & | 340 | err = switch_asic(chip, clocks_from_dsp & |
338 | GML_CLOCK_DETECT_BIT_WORD96); | 341 | GML_CLOCK_DETECT_BIT_WORD96); |
@@ -346,14 +349,15 @@ static int set_input_clock(struct echoaudio *chip, u16 clock) | |||
346 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 349 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
347 | break; | 350 | break; |
348 | case ECHO_CLOCK_ADAT: | 351 | case ECHO_CLOCK_ADAT: |
349 | DE_ACT(("Set Mona clock to ADAT\n")); | 352 | dev_dbg(chip->card->dev, "Set Mona clock to ADAT\n"); |
350 | if (chip->digital_mode != DIGITAL_MODE_ADAT) | 353 | if (chip->digital_mode != DIGITAL_MODE_ADAT) |
351 | return -EAGAIN; | 354 | return -EAGAIN; |
352 | control_reg |= GML_ADAT_CLOCK; | 355 | control_reg |= GML_ADAT_CLOCK; |
353 | control_reg &= ~GML_DOUBLE_SPEED_MODE; | 356 | control_reg &= ~GML_DOUBLE_SPEED_MODE; |
354 | break; | 357 | break; |
355 | default: | 358 | default: |
356 | DE_ACT(("Input clock 0x%x not supported for Mona\n", clock)); | 359 | dev_err(chip->card->dev, |
360 | "Input clock 0x%x not supported for Mona\n", clock); | ||
357 | return -EINVAL; | 361 | return -EINVAL; |
358 | } | 362 | } |
359 | 363 | ||
@@ -381,7 +385,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
381 | incompatible_clock = TRUE; | 385 | incompatible_clock = TRUE; |
382 | break; | 386 | break; |
383 | default: | 387 | default: |
384 | DE_ACT(("Digital mode not supported: %d\n", mode)); | 388 | dev_err(chip->card->dev, |
389 | "Digital mode not supported: %d\n", mode); | ||
385 | return -EINVAL; | 390 | return -EINVAL; |
386 | } | 391 | } |
387 | 392 | ||
@@ -422,6 +427,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode) | |||
422 | return err; | 427 | return err; |
423 | chip->digital_mode = mode; | 428 | chip->digital_mode = mode; |
424 | 429 | ||
425 | DE_ACT(("set_digital_mode to %d\n", mode)); | 430 | dev_dbg(chip->card->dev, "set_digital_mode to %d\n", mode); |
426 | return incompatible_clock; | 431 | return incompatible_clock; |
427 | } | 432 | } |