diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-25 10:36:51 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-26 10:45:25 -0500 |
commit | 2b96a7f1fe6678e92850d5a150f1bf361ae1cb8e (patch) | |
tree | 5fe9c8ef698943e12e4995834b58b3fbf1dd4232 | |
parent | 00980aa9c7ce2b5b54a5a7e7cf259f36fabdb249 (diff) |
ALSA: cs46xx: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 143 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.c | 126 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos_scb_lib.c | 57 |
3 files changed, 203 insertions, 123 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 28766478f81c..32b44f25b5c8 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -116,7 +116,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip, | |||
116 | 116 | ||
117 | tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL); | 117 | tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL); |
118 | if ((tmp & ACCTL_VFRM) == 0) { | 118 | if ((tmp & ACCTL_VFRM) == 0) { |
119 | snd_printk(KERN_WARNING "cs46xx: ACCTL_VFRM not set 0x%x\n",tmp); | 119 | dev_warn(chip->card->dev, "ACCTL_VFRM not set 0x%x\n", tmp); |
120 | snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM ); | 120 | snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM ); |
121 | msleep(50); | 121 | msleep(50); |
122 | tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL + offset); | 122 | tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL + offset); |
@@ -168,7 +168,8 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip, | |||
168 | goto ok1; | 168 | goto ok1; |
169 | } | 169 | } |
170 | 170 | ||
171 | snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg); | 171 | dev_err(chip->card->dev, |
172 | "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg); | ||
172 | result = 0xffff; | 173 | result = 0xffff; |
173 | goto end; | 174 | goto end; |
174 | 175 | ||
@@ -187,7 +188,9 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip, | |||
187 | udelay(10); | 188 | udelay(10); |
188 | } | 189 | } |
189 | 190 | ||
190 | snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), codec_index %d, reg = 0x%x\n", codec_index, reg); | 191 | dev_err(chip->card->dev, |
192 | "AC'97 read problem (ACSTS_VSTS), codec_index %d, reg = 0x%x\n", | ||
193 | codec_index, reg); | ||
191 | result = 0xffff; | 194 | result = 0xffff; |
192 | goto end; | 195 | goto end; |
193 | 196 | ||
@@ -197,7 +200,8 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip, | |||
197 | * ACSDA = Status Data Register = 474h | 200 | * ACSDA = Status Data Register = 474h |
198 | */ | 201 | */ |
199 | #if 0 | 202 | #if 0 |
200 | printk(KERN_DEBUG "e) reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n", reg, | 203 | dev_dbg(chip->card->dev, |
204 | "e) reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n", reg, | ||
201 | snd_cs46xx_peekBA0(chip, BA0_ACSDA), | 205 | snd_cs46xx_peekBA0(chip, BA0_ACSDA), |
202 | snd_cs46xx_peekBA0(chip, BA0_ACCAD)); | 206 | snd_cs46xx_peekBA0(chip, BA0_ACCAD)); |
203 | #endif | 207 | #endif |
@@ -286,7 +290,9 @@ static void snd_cs46xx_codec_write(struct snd_cs46xx *chip, | |||
286 | goto end; | 290 | goto end; |
287 | } | 291 | } |
288 | } | 292 | } |
289 | snd_printk(KERN_ERR "AC'97 write problem, codec_index = %d, reg = 0x%x, val = 0x%x\n", codec_index, reg, val); | 293 | dev_err(chip->card->dev, |
294 | "AC'97 write problem, codec_index = %d, reg = 0x%x, val = 0x%x\n", | ||
295 | codec_index, reg, val); | ||
290 | end: | 296 | end: |
291 | chip->active_ctrl(chip, -1); | 297 | chip->active_ctrl(chip, -1); |
292 | } | 298 | } |
@@ -608,8 +614,8 @@ static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout) | |||
608 | } | 614 | } |
609 | 615 | ||
610 | if(status & SERBST_WBSY) { | 616 | if(status & SERBST_WBSY) { |
611 | snd_printk(KERN_ERR "cs46xx: failure waiting for " | 617 | dev_err(chip->card->dev, |
612 | "FIFO command to complete\n"); | 618 | "failure waiting for FIFO command to complete\n"); |
613 | return -EINVAL; | 619 | return -EINVAL; |
614 | } | 620 | } |
615 | 621 | ||
@@ -646,7 +652,9 @@ static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip) | |||
646 | * Make sure the previous FIFO write operation has completed. | 652 | * Make sure the previous FIFO write operation has completed. |
647 | */ | 653 | */ |
648 | if (cs46xx_wait_for_fifo(chip,1)) { | 654 | if (cs46xx_wait_for_fifo(chip,1)) { |
649 | snd_printdd ("failed waiting for FIFO at addr (%02X)\n",idx); | 655 | dev_dbg(chip->card->dev, |
656 | "failed waiting for FIFO at addr (%02X)\n", | ||
657 | idx); | ||
650 | 658 | ||
651 | if (powerdown) | 659 | if (powerdown) |
652 | snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp); | 660 | snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp); |
@@ -694,7 +702,7 @@ static void snd_cs46xx_proc_start(struct snd_cs46xx *chip) | |||
694 | } | 702 | } |
695 | 703 | ||
696 | if (snd_cs46xx_peek(chip, BA1_SPCR) & SPCR_RUNFR) | 704 | if (snd_cs46xx_peek(chip, BA1_SPCR) & SPCR_RUNFR) |
697 | snd_printk(KERN_ERR "SPCR_RUNFR never reset\n"); | 705 | dev_err(chip->card->dev, "SPCR_RUNFR never reset\n"); |
698 | } | 706 | } |
699 | 707 | ||
700 | static void snd_cs46xx_proc_stop(struct snd_cs46xx *chip) | 708 | static void snd_cs46xx_proc_stop(struct snd_cs46xx *chip) |
@@ -1054,7 +1062,8 @@ static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46x | |||
1054 | cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, | 1062 | cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, |
1055 | cpcm, cpcm->hw_buf.addr,cpcm->pcm_channel_id); | 1063 | cpcm, cpcm->hw_buf.addr,cpcm->pcm_channel_id); |
1056 | if (cpcm->pcm_channel == NULL) { | 1064 | if (cpcm->pcm_channel == NULL) { |
1057 | snd_printk(KERN_ERR "cs46xx: failed to create virtual PCM channel\n"); | 1065 | dev_err(chip->card->dev, |
1066 | "failed to create virtual PCM channel\n"); | ||
1058 | return -ENOMEM; | 1067 | return -ENOMEM; |
1059 | } | 1068 | } |
1060 | cpcm->pcm_channel->sample_rate = sample_rate; | 1069 | cpcm->pcm_channel->sample_rate = sample_rate; |
@@ -1067,7 +1076,8 @@ static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46x | |||
1067 | if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm, | 1076 | if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm, |
1068 | cpcm->hw_buf.addr, | 1077 | cpcm->hw_buf.addr, |
1069 | cpcm->pcm_channel_id)) == NULL) { | 1078 | cpcm->pcm_channel_id)) == NULL) { |
1070 | snd_printk(KERN_ERR "cs46xx: failed to re-create virtual PCM channel\n"); | 1079 | dev_err(chip->card->dev, |
1080 | "failed to re-create virtual PCM channel\n"); | ||
1071 | return -ENOMEM; | 1081 | return -ENOMEM; |
1072 | } | 1082 | } |
1073 | 1083 | ||
@@ -1116,7 +1126,8 @@ static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, | |||
1116 | return -EINVAL; | 1126 | return -EINVAL; |
1117 | } | 1127 | } |
1118 | 1128 | ||
1119 | snd_printdd ("period_size (%d), periods (%d) buffer_size(%d)\n", | 1129 | dev_dbg(chip->card->dev, |
1130 | "period_size (%d), periods (%d) buffer_size(%d)\n", | ||
1120 | period_size, params_periods(hw_params), | 1131 | period_size, params_periods(hw_params), |
1121 | params_buffer_bytes(hw_params)); | 1132 | params_buffer_bytes(hw_params)); |
1122 | #endif | 1133 | #endif |
@@ -1531,22 +1542,20 @@ static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,in | |||
1531 | 1542 | ||
1532 | static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream) | 1543 | static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream) |
1533 | { | 1544 | { |
1534 | snd_printdd("open front channel\n"); | 1545 | dev_dbg(substream->pcm->card->dev, "open front channel\n"); |
1535 | return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); | 1546 | return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); |
1536 | } | 1547 | } |
1537 | 1548 | ||
1538 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 1549 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
1539 | static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream) | 1550 | static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream) |
1540 | { | 1551 | { |
1541 | snd_printdd("open rear channel\n"); | 1552 | dev_dbg(substream->pcm->card->dev, "open rear channel\n"); |
1542 | |||
1543 | return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); | 1553 | return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); |
1544 | } | 1554 | } |
1545 | 1555 | ||
1546 | static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream) | 1556 | static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream) |
1547 | { | 1557 | { |
1548 | snd_printdd("open center - LFE channel\n"); | 1558 | dev_dbg(substream->pcm->card->dev, "open center - LFE channel\n"); |
1549 | |||
1550 | return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); | 1559 | return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); |
1551 | } | 1560 | } |
1552 | 1561 | ||
@@ -1554,7 +1563,7 @@ static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream) | |||
1554 | { | 1563 | { |
1555 | struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); | 1564 | struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); |
1556 | 1565 | ||
1557 | snd_printdd("open raw iec958 channel\n"); | 1566 | dev_dbg(chip->card->dev, "open raw iec958 channel\n"); |
1558 | 1567 | ||
1559 | mutex_lock(&chip->spos_mutex); | 1568 | mutex_lock(&chip->spos_mutex); |
1560 | cs46xx_iec958_pre_open (chip); | 1569 | cs46xx_iec958_pre_open (chip); |
@@ -1570,7 +1579,7 @@ static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream) | |||
1570 | int err; | 1579 | int err; |
1571 | struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); | 1580 | struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); |
1572 | 1581 | ||
1573 | snd_printdd("close raw iec958 channel\n"); | 1582 | dev_dbg(chip->card->dev, "close raw iec958 channel\n"); |
1574 | 1583 | ||
1575 | err = snd_cs46xx_playback_close(substream); | 1584 | err = snd_cs46xx_playback_close(substream); |
1576 | 1585 | ||
@@ -2421,10 +2430,10 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97) | |||
2421 | 2430 | ||
2422 | /* set the desired CODEC mode */ | 2431 | /* set the desired CODEC mode */ |
2423 | if (ac97->num == CS46XX_PRIMARY_CODEC_INDEX) { | 2432 | if (ac97->num == CS46XX_PRIMARY_CODEC_INDEX) { |
2424 | snd_printdd("cs46xx: CODEC1 mode %04x\n", 0x0); | 2433 | dev_dbg(ac97->bus->card->dev, "CODEC1 mode %04x\n", 0x0); |
2425 | snd_cs46xx_ac97_write(ac97, AC97_CSR_ACMODE, 0x0); | 2434 | snd_cs46xx_ac97_write(ac97, AC97_CSR_ACMODE, 0x0); |
2426 | } else if (ac97->num == CS46XX_SECONDARY_CODEC_INDEX) { | 2435 | } else if (ac97->num == CS46XX_SECONDARY_CODEC_INDEX) { |
2427 | snd_printdd("cs46xx: CODEC2 mode %04x\n", 0x3); | 2436 | dev_dbg(ac97->bus->card->dev, "CODEC2 mode %04x\n", 0x3); |
2428 | snd_cs46xx_ac97_write(ac97, AC97_CSR_ACMODE, 0x3); | 2437 | snd_cs46xx_ac97_write(ac97, AC97_CSR_ACMODE, 0x3); |
2429 | } else { | 2438 | } else { |
2430 | snd_BUG(); /* should never happen ... */ | 2439 | snd_BUG(); /* should never happen ... */ |
@@ -2456,7 +2465,8 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97) | |||
2456 | msleep(10); | 2465 | msleep(10); |
2457 | } while (time_after_eq(end_time, jiffies)); | 2466 | } while (time_after_eq(end_time, jiffies)); |
2458 | 2467 | ||
2459 | snd_printk(KERN_ERR "CS46xx secondary codec doesn't respond!\n"); | 2468 | dev_err(ac97->bus->card->dev, |
2469 | "CS46xx secondary codec doesn't respond!\n"); | ||
2460 | } | 2470 | } |
2461 | #endif | 2471 | #endif |
2462 | 2472 | ||
@@ -2476,7 +2486,8 @@ static int cs46xx_detect_codec(struct snd_cs46xx *chip, int codec) | |||
2476 | snd_cs46xx_codec_write(chip, AC97_RESET, 0, codec); | 2486 | snd_cs46xx_codec_write(chip, AC97_RESET, 0, codec); |
2477 | udelay(10); | 2487 | udelay(10); |
2478 | if (snd_cs46xx_codec_read(chip, AC97_RESET, codec) & 0x8000) { | 2488 | if (snd_cs46xx_codec_read(chip, AC97_RESET, codec) & 0x8000) { |
2479 | snd_printdd("snd_cs46xx: seconadry codec not present\n"); | 2489 | dev_dbg(chip->card->dev, |
2490 | "seconadry codec not present\n"); | ||
2480 | return -ENXIO; | 2491 | return -ENXIO; |
2481 | } | 2492 | } |
2482 | } | 2493 | } |
@@ -2489,7 +2500,7 @@ static int cs46xx_detect_codec(struct snd_cs46xx *chip, int codec) | |||
2489 | } | 2500 | } |
2490 | msleep(10); | 2501 | msleep(10); |
2491 | } | 2502 | } |
2492 | snd_printdd("snd_cs46xx: codec %d detection timeout\n", codec); | 2503 | dev_dbg(chip->card->dev, "codec %d detection timeout\n", codec); |
2493 | return -ENXIO; | 2504 | return -ENXIO; |
2494 | } | 2505 | } |
2495 | 2506 | ||
@@ -2509,7 +2520,7 @@ int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device) | |||
2509 | 2520 | ||
2510 | /* detect primary codec */ | 2521 | /* detect primary codec */ |
2511 | chip->nr_ac97_codecs = 0; | 2522 | chip->nr_ac97_codecs = 0; |
2512 | snd_printdd("snd_cs46xx: detecting primary codec\n"); | 2523 | dev_dbg(chip->card->dev, "detecting primary codec\n"); |
2513 | if ((err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus)) < 0) | 2524 | if ((err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus)) < 0) |
2514 | return err; | 2525 | return err; |
2515 | chip->ac97_bus->private_free = snd_cs46xx_mixer_free_ac97_bus; | 2526 | chip->ac97_bus->private_free = snd_cs46xx_mixer_free_ac97_bus; |
@@ -2519,7 +2530,7 @@ int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device) | |||
2519 | chip->nr_ac97_codecs = 1; | 2530 | chip->nr_ac97_codecs = 1; |
2520 | 2531 | ||
2521 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 2532 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
2522 | snd_printdd("snd_cs46xx: detecting seconadry codec\n"); | 2533 | dev_dbg(chip->card->dev, "detecting seconadry codec\n"); |
2523 | /* try detect a secondary codec */ | 2534 | /* try detect a secondary codec */ |
2524 | if (! cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX)) | 2535 | if (! cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX)) |
2525 | chip->nr_ac97_codecs = 2; | 2536 | chip->nr_ac97_codecs = 2; |
@@ -2554,7 +2565,7 @@ int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device) | |||
2554 | } | 2565 | } |
2555 | /* do soundcard specific mixer setup */ | 2566 | /* do soundcard specific mixer setup */ |
2556 | if (chip->mixer_init) { | 2567 | if (chip->mixer_init) { |
2557 | snd_printdd ("calling chip->mixer_init(chip);\n"); | 2568 | dev_dbg(chip->card->dev, "calling chip->mixer_init(chip);\n"); |
2558 | chip->mixer_init(chip); | 2569 | chip->mixer_init(chip); |
2559 | } | 2570 | } |
2560 | #endif | 2571 | #endif |
@@ -2801,7 +2812,8 @@ int snd_cs46xx_gameport(struct snd_cs46xx *chip) | |||
2801 | 2812 | ||
2802 | chip->gameport = gp = gameport_allocate_port(); | 2813 | chip->gameport = gp = gameport_allocate_port(); |
2803 | if (!gp) { | 2814 | if (!gp) { |
2804 | printk(KERN_ERR "cs46xx: cannot allocate memory for gameport\n"); | 2815 | dev_err(chip->card->dev, |
2816 | "cannot allocate memory for gameport\n"); | ||
2805 | return -ENOMEM; | 2817 | return -ENOMEM; |
2806 | } | 2818 | } |
2807 | 2819 | ||
@@ -3138,8 +3150,10 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip) | |||
3138 | } | 3150 | } |
3139 | 3151 | ||
3140 | 3152 | ||
3141 | snd_printk(KERN_ERR "create - never read codec ready from AC'97\n"); | 3153 | dev_err(chip->card->dev, |
3142 | snd_printk(KERN_ERR "it is not probably bug, try to use CS4236 driver\n"); | 3154 | "create - never read codec ready from AC'97\n"); |
3155 | dev_err(chip->card->dev, | ||
3156 | "it is not probably bug, try to use CS4236 driver\n"); | ||
3143 | return -EIO; | 3157 | return -EIO; |
3144 | ok1: | 3158 | ok1: |
3145 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 3159 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
@@ -3157,7 +3171,8 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip) | |||
3157 | * Make sure CODEC is READY. | 3171 | * Make sure CODEC is READY. |
3158 | */ | 3172 | */ |
3159 | if (!(snd_cs46xx_peekBA0(chip, BA0_ACSTS2) & ACSTS_CRDY)) | 3173 | if (!(snd_cs46xx_peekBA0(chip, BA0_ACSTS2) & ACSTS_CRDY)) |
3160 | snd_printdd("cs46xx: never read card ready from secondary AC'97\n"); | 3174 | dev_dbg(chip->card->dev, |
3175 | "never read card ready from secondary AC'97\n"); | ||
3161 | } | 3176 | } |
3162 | #endif | 3177 | #endif |
3163 | 3178 | ||
@@ -3187,17 +3202,21 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip) | |||
3187 | } | 3202 | } |
3188 | 3203 | ||
3189 | #ifndef CONFIG_SND_CS46XX_NEW_DSP | 3204 | #ifndef CONFIG_SND_CS46XX_NEW_DSP |
3190 | snd_printk(KERN_ERR "create - never read ISV3 & ISV4 from AC'97\n"); | 3205 | dev_err(chip->card->dev, |
3206 | "create - never read ISV3 & ISV4 from AC'97\n"); | ||
3191 | return -EIO; | 3207 | return -EIO; |
3192 | #else | 3208 | #else |
3193 | /* This may happen on a cold boot with a Terratec SiXPack 5.1. | 3209 | /* This may happen on a cold boot with a Terratec SiXPack 5.1. |
3194 | Reloading the driver may help, if there's other soundcards | 3210 | Reloading the driver may help, if there's other soundcards |
3195 | with the same problem I would like to know. (Benny) */ | 3211 | with the same problem I would like to know. (Benny) */ |
3196 | 3212 | ||
3197 | snd_printk(KERN_ERR "ERROR: snd-cs46xx: never read ISV3 & ISV4 from AC'97\n"); | 3213 | dev_err(chip->card->dev, "never read ISV3 & ISV4 from AC'97\n"); |
3198 | snd_printk(KERN_ERR " Try reloading the ALSA driver, if you find something\n"); | 3214 | dev_err(chip->card->dev, |
3199 | snd_printk(KERN_ERR " broken or not working on your soundcard upon\n"); | 3215 | "Try reloading the ALSA driver, if you find something\n"); |
3200 | snd_printk(KERN_ERR " this message please report to alsa-devel@alsa-project.org\n"); | 3216 | dev_err(chip->card->dev, |
3217 | "broken or not working on your soundcard upon\n"); | ||
3218 | dev_err(chip->card->dev, | ||
3219 | "this message please report to alsa-devel@alsa-project.org\n"); | ||
3201 | 3220 | ||
3202 | return -EIO; | 3221 | return -EIO; |
3203 | #endif | 3222 | #endif |
@@ -3266,13 +3285,13 @@ int snd_cs46xx_start_dsp(struct snd_cs46xx *chip) | |||
3266 | for (i = 0; i < CS46XX_DSP_MODULES; i++) { | 3285 | for (i = 0; i < CS46XX_DSP_MODULES; i++) { |
3267 | err = load_firmware(chip, &chip->modules[i], module_names[i]); | 3286 | err = load_firmware(chip, &chip->modules[i], module_names[i]); |
3268 | if (err < 0) { | 3287 | if (err < 0) { |
3269 | snd_printk(KERN_ERR "firmware load error [%s]\n", | 3288 | dev_err(chip->card->dev, "firmware load error [%s]\n", |
3270 | module_names[i]); | 3289 | module_names[i]); |
3271 | return err; | 3290 | return err; |
3272 | } | 3291 | } |
3273 | err = cs46xx_dsp_load_module(chip, chip->modules[i]); | 3292 | err = cs46xx_dsp_load_module(chip, chip->modules[i]); |
3274 | if (err < 0) { | 3293 | if (err < 0) { |
3275 | snd_printk(KERN_ERR "image download error [%s]\n", | 3294 | dev_err(chip->card->dev, "image download error [%s]\n", |
3276 | module_names[i]); | 3295 | module_names[i]); |
3277 | return err; | 3296 | return err; |
3278 | } | 3297 | } |
@@ -3288,7 +3307,7 @@ int snd_cs46xx_start_dsp(struct snd_cs46xx *chip) | |||
3288 | /* old image */ | 3307 | /* old image */ |
3289 | err = snd_cs46xx_download_image(chip); | 3308 | err = snd_cs46xx_download_image(chip); |
3290 | if (err < 0) { | 3309 | if (err < 0) { |
3291 | snd_printk(KERN_ERR "image download error\n"); | 3310 | dev_err(chip->card->dev, "image download error\n"); |
3292 | return err; | 3311 | return err; |
3293 | } | 3312 | } |
3294 | 3313 | ||
@@ -3341,7 +3360,7 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip) | |||
3341 | u32 idx, valid_slots,tmp,powerdown = 0; | 3360 | u32 idx, valid_slots,tmp,powerdown = 0; |
3342 | u16 modem_power,pin_config,logic_type; | 3361 | u16 modem_power,pin_config,logic_type; |
3343 | 3362 | ||
3344 | snd_printdd ("cs46xx: cs46xx_setup_eapd_slot()+\n"); | 3363 | dev_dbg(chip->card->dev, "cs46xx_setup_eapd_slot()+\n"); |
3345 | 3364 | ||
3346 | /* | 3365 | /* |
3347 | * See if the devices are powered down. If so, we must power them up first | 3366 | * See if the devices are powered down. If so, we must power them up first |
@@ -3359,7 +3378,8 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip) | |||
3359 | * stuff. | 3378 | * stuff. |
3360 | */ | 3379 | */ |
3361 | if(chip->nr_ac97_codecs != 2) { | 3380 | if(chip->nr_ac97_codecs != 2) { |
3362 | snd_printk (KERN_ERR "cs46xx: cs46xx_setup_eapd_slot() - no secondary codec configured\n"); | 3381 | dev_err(chip->card->dev, |
3382 | "cs46xx_setup_eapd_slot() - no secondary codec configured\n"); | ||
3363 | return -EINVAL; | 3383 | return -EINVAL; |
3364 | } | 3384 | } |
3365 | 3385 | ||
@@ -3400,7 +3420,7 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip) | |||
3400 | snd_cs46xx_pokeBA0(chip, BA0_ACOSV, valid_slots); | 3420 | snd_cs46xx_pokeBA0(chip, BA0_ACOSV, valid_slots); |
3401 | 3421 | ||
3402 | if ( cs46xx_wait_for_fifo(chip,1) ) { | 3422 | if ( cs46xx_wait_for_fifo(chip,1) ) { |
3403 | snd_printdd("FIFO is busy\n"); | 3423 | dev_dbg(chip->card->dev, "FIFO is busy\n"); |
3404 | 3424 | ||
3405 | return -EINVAL; | 3425 | return -EINVAL; |
3406 | } | 3426 | } |
@@ -3421,7 +3441,9 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip) | |||
3421 | * Wait for command to complete | 3441 | * Wait for command to complete |
3422 | */ | 3442 | */ |
3423 | if ( cs46xx_wait_for_fifo(chip,200) ) { | 3443 | if ( cs46xx_wait_for_fifo(chip,200) ) { |
3424 | snd_printdd("failed waiting for FIFO at addr (%02X)\n",idx); | 3444 | dev_dbg(chip->card->dev, |
3445 | "failed waiting for FIFO at addr (%02X)\n", | ||
3446 | idx); | ||
3425 | 3447 | ||
3426 | return -EINVAL; | 3448 | return -EINVAL; |
3427 | } | 3449 | } |
@@ -3510,14 +3532,14 @@ static void amp_hercules(struct snd_cs46xx *chip, int change) | |||
3510 | 3532 | ||
3511 | chip->amplifier += change; | 3533 | chip->amplifier += change; |
3512 | if (chip->amplifier && !old) { | 3534 | if (chip->amplifier && !old) { |
3513 | snd_printdd ("Hercules amplifier ON\n"); | 3535 | dev_dbg(chip->card->dev, "Hercules amplifier ON\n"); |
3514 | 3536 | ||
3515 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, | 3537 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, |
3516 | EGPIODR_GPOE2 | val1); /* enable EGPIO2 output */ | 3538 | EGPIODR_GPOE2 | val1); /* enable EGPIO2 output */ |
3517 | snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, | 3539 | snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, |
3518 | EGPIOPTR_GPPT2 | val2); /* open-drain on output */ | 3540 | EGPIOPTR_GPPT2 | val2); /* open-drain on output */ |
3519 | } else if (old && !chip->amplifier) { | 3541 | } else if (old && !chip->amplifier) { |
3520 | snd_printdd ("Hercules amplifier OFF\n"); | 3542 | dev_dbg(chip->card->dev, "Hercules amplifier OFF\n"); |
3521 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, val1 & ~EGPIODR_GPOE2); /* disable */ | 3543 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, val1 & ~EGPIODR_GPOE2); /* disable */ |
3522 | snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, val2 & ~EGPIOPTR_GPPT2); /* disable */ | 3544 | snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, val2 & ~EGPIOPTR_GPPT2); /* disable */ |
3523 | } | 3545 | } |
@@ -3525,7 +3547,7 @@ static void amp_hercules(struct snd_cs46xx *chip, int change) | |||
3525 | 3547 | ||
3526 | static void voyetra_mixer_init (struct snd_cs46xx *chip) | 3548 | static void voyetra_mixer_init (struct snd_cs46xx *chip) |
3527 | { | 3549 | { |
3528 | snd_printdd ("initializing Voyetra mixer\n"); | 3550 | dev_dbg(chip->card->dev, "initializing Voyetra mixer\n"); |
3529 | 3551 | ||
3530 | /* Enable SPDIF out */ | 3552 | /* Enable SPDIF out */ |
3531 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0); | 3553 | snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0); |
@@ -3543,7 +3565,7 @@ static void hercules_mixer_init (struct snd_cs46xx *chip) | |||
3543 | /* set EGPIO to default */ | 3565 | /* set EGPIO to default */ |
3544 | hercules_init(chip); | 3566 | hercules_init(chip); |
3545 | 3567 | ||
3546 | snd_printdd ("initializing Hercules mixer\n"); | 3568 | dev_dbg(chip->card->dev, "initializing Hercules mixer\n"); |
3547 | 3569 | ||
3548 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 3570 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
3549 | if (chip->in_suspend) | 3571 | if (chip->in_suspend) |
@@ -3554,7 +3576,9 @@ static void hercules_mixer_init (struct snd_cs46xx *chip) | |||
3554 | 3576 | ||
3555 | kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip); | 3577 | kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip); |
3556 | if ((err = snd_ctl_add(card, kctl)) < 0) { | 3578 | if ((err = snd_ctl_add(card, kctl)) < 0) { |
3557 | printk (KERN_ERR "cs46xx: failed to initialize Hercules mixer (%d)\n",err); | 3579 | dev_err(card->dev, |
3580 | "failed to initialize Hercules mixer (%d)\n", | ||
3581 | err); | ||
3558 | break; | 3582 | break; |
3559 | } | 3583 | } |
3560 | } | 3584 | } |
@@ -3826,8 +3850,7 @@ static int snd_cs46xx_resume(struct device *dev) | |||
3826 | pci_set_power_state(pci, PCI_D0); | 3850 | pci_set_power_state(pci, PCI_D0); |
3827 | pci_restore_state(pci); | 3851 | pci_restore_state(pci); |
3828 | if (pci_enable_device(pci) < 0) { | 3852 | if (pci_enable_device(pci) < 0) { |
3829 | printk(KERN_ERR "cs46xx: pci_enable_device failed, " | 3853 | dev_err(dev, "pci_enable_device failed, disabling device\n"); |
3830 | "disabling device\n"); | ||
3831 | snd_card_disconnect(card); | 3854 | snd_card_disconnect(card); |
3832 | return -EIO; | 3855 | return -EIO; |
3833 | } | 3856 | } |
@@ -3932,7 +3955,8 @@ int snd_cs46xx_create(struct snd_card *card, | |||
3932 | chip->ba1_addr = pci_resource_start(pci, 1); | 3955 | chip->ba1_addr = pci_resource_start(pci, 1); |
3933 | if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 || | 3956 | if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 || |
3934 | chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) { | 3957 | chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) { |
3935 | snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", | 3958 | dev_err(chip->card->dev, |
3959 | "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", | ||
3936 | chip->ba0_addr, chip->ba1_addr); | 3960 | chip->ba0_addr, chip->ba1_addr); |
3937 | snd_cs46xx_free(chip); | 3961 | snd_cs46xx_free(chip); |
3938 | return -ENOMEM; | 3962 | return -ENOMEM; |
@@ -3969,7 +3993,8 @@ int snd_cs46xx_create(struct snd_card *card, | |||
3969 | 3993 | ||
3970 | for (cp = &cards[0]; cp->name; cp++) { | 3994 | for (cp = &cards[0]; cp->name; cp++) { |
3971 | if (cp->vendor == ss_vendor && cp->id == ss_card) { | 3995 | if (cp->vendor == ss_vendor && cp->id == ss_card) { |
3972 | snd_printdd ("hack for %s enabled\n", cp->name); | 3996 | dev_dbg(chip->card->dev, "hack for %s enabled\n", |
3997 | cp->name); | ||
3973 | 3998 | ||
3974 | chip->amplifier_ctrl = cp->amp; | 3999 | chip->amplifier_ctrl = cp->amp; |
3975 | chip->active_ctrl = cp->active; | 4000 | chip->active_ctrl = cp->active; |
@@ -3982,12 +4007,14 @@ int snd_cs46xx_create(struct snd_card *card, | |||
3982 | } | 4007 | } |
3983 | 4008 | ||
3984 | if (external_amp) { | 4009 | if (external_amp) { |
3985 | snd_printk(KERN_INFO "Crystal EAPD support forced on.\n"); | 4010 | dev_info(chip->card->dev, |
4011 | "Crystal EAPD support forced on.\n"); | ||
3986 | chip->amplifier_ctrl = amp_voyetra; | 4012 | chip->amplifier_ctrl = amp_voyetra; |
3987 | } | 4013 | } |
3988 | 4014 | ||
3989 | if (thinkpad) { | 4015 | if (thinkpad) { |
3990 | snd_printk(KERN_INFO "Activating CLKRUN hack for Thinkpad.\n"); | 4016 | dev_info(chip->card->dev, |
4017 | "Activating CLKRUN hack for Thinkpad.\n"); | ||
3991 | chip->active_ctrl = clkrun_hack; | 4018 | chip->active_ctrl = clkrun_hack; |
3992 | clkrun_init(chip); | 4019 | clkrun_init(chip); |
3993 | } | 4020 | } |
@@ -4005,14 +4032,16 @@ int snd_cs46xx_create(struct snd_card *card, | |||
4005 | region = &chip->region.idx[idx]; | 4032 | region = &chip->region.idx[idx]; |
4006 | if ((region->resource = request_mem_region(region->base, region->size, | 4033 | if ((region->resource = request_mem_region(region->base, region->size, |
4007 | region->name)) == NULL) { | 4034 | region->name)) == NULL) { |
4008 | snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", | 4035 | dev_err(chip->card->dev, |
4036 | "unable to request memory region 0x%lx-0x%lx\n", | ||
4009 | region->base, region->base + region->size - 1); | 4037 | region->base, region->base + region->size - 1); |
4010 | snd_cs46xx_free(chip); | 4038 | snd_cs46xx_free(chip); |
4011 | return -EBUSY; | 4039 | return -EBUSY; |
4012 | } | 4040 | } |
4013 | region->remap_addr = ioremap_nocache(region->base, region->size); | 4041 | region->remap_addr = ioremap_nocache(region->base, region->size); |
4014 | if (region->remap_addr == NULL) { | 4042 | if (region->remap_addr == NULL) { |
4015 | snd_printk(KERN_ERR "%s ioremap problem\n", region->name); | 4043 | dev_err(chip->card->dev, |
4044 | "%s ioremap problem\n", region->name); | ||
4016 | snd_cs46xx_free(chip); | 4045 | snd_cs46xx_free(chip); |
4017 | return -ENOMEM; | 4046 | return -ENOMEM; |
4018 | } | 4047 | } |
@@ -4020,7 +4049,7 @@ int snd_cs46xx_create(struct snd_card *card, | |||
4020 | 4049 | ||
4021 | if (request_irq(pci->irq, snd_cs46xx_interrupt, IRQF_SHARED, | 4050 | if (request_irq(pci->irq, snd_cs46xx_interrupt, IRQF_SHARED, |
4022 | KBUILD_MODNAME, chip)) { | 4051 | KBUILD_MODNAME, chip)) { |
4023 | snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | 4052 | dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq); |
4024 | snd_cs46xx_free(chip); | 4053 | snd_cs46xx_free(chip); |
4025 | return -EBUSY; | 4054 | return -EBUSY; |
4026 | } | 4055 | } |
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 1686b4f4c44f..1c4a0fb3ffef 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c | |||
@@ -85,12 +85,15 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 | |||
85 | address = (hival & 0x00FFF) << 5; | 85 | address = (hival & 0x00FFF) << 5; |
86 | address |= loval >> 15; | 86 | address |= loval >> 15; |
87 | 87 | ||
88 | snd_printdd("handle_wideop[1]: %05x:%05x addr %04x\n",hival,loval,address); | 88 | dev_dbg(chip->card->dev, |
89 | "handle_wideop[1]: %05x:%05x addr %04x\n", | ||
90 | hival, loval, address); | ||
89 | 91 | ||
90 | if ( !(address & 0x8000) ) { | 92 | if ( !(address & 0x8000) ) { |
91 | address += (ins->code.offset / 2) - overlay_begin_address; | 93 | address += (ins->code.offset / 2) - overlay_begin_address; |
92 | } else { | 94 | } else { |
93 | snd_printdd("handle_wideop[1]: ROM symbol not reallocated\n"); | 95 | dev_dbg(chip->card->dev, |
96 | "handle_wideop[1]: ROM symbol not reallocated\n"); | ||
94 | } | 97 | } |
95 | 98 | ||
96 | hival &= 0xFF000; | 99 | hival &= 0xFF000; |
@@ -102,8 +105,9 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 | |||
102 | address = (hival & 0x00FFF) << 5; | 105 | address = (hival & 0x00FFF) << 5; |
103 | address |= loval >> 15; | 106 | address |= loval >> 15; |
104 | 107 | ||
105 | snd_printdd("handle_wideop:[2] %05x:%05x addr %04x\n",hival,loval,address); | 108 | dev_dbg(chip->card->dev, |
106 | nreallocated ++; | 109 | "handle_wideop:[2] %05x:%05x addr %04x\n", |
110 | hival, loval, address); nreallocated++; | ||
107 | } /* wide_opcodes[j] == wide_op */ | 111 | } /* wide_opcodes[j] == wide_op */ |
108 | } /* for */ | 112 | } /* for */ |
109 | } /* mod_type == 0 ... */ | 113 | } /* mod_type == 0 ... */ |
@@ -113,7 +117,8 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 | |||
113 | ins->code.data[ins->code.size++] = hival; | 117 | ins->code.data[ins->code.size++] = hival; |
114 | } | 118 | } |
115 | 119 | ||
116 | snd_printdd("dsp_spos: %d instructions reallocated\n",nreallocated); | 120 | dev_dbg(chip->card->dev, |
121 | "dsp_spos: %d instructions reallocated\n", nreallocated); | ||
117 | return nreallocated; | 122 | return nreallocated; |
118 | } | 123 | } |
119 | 124 | ||
@@ -157,7 +162,8 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul | |||
157 | 162 | ||
158 | for (i = 0;i < module->symbol_table.nsymbols; ++i) { | 163 | for (i = 0;i < module->symbol_table.nsymbols; ++i) { |
159 | if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { | 164 | if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { |
160 | snd_printk(KERN_ERR "dsp_spos: symbol table is full\n"); | 165 | dev_err(chip->card->dev, |
166 | "dsp_spos: symbol table is full\n"); | ||
161 | return -ENOMEM; | 167 | return -ENOMEM; |
162 | } | 168 | } |
163 | 169 | ||
@@ -176,8 +182,11 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul | |||
176 | 182 | ||
177 | ins->symbol_table.nsymbols++; | 183 | ins->symbol_table.nsymbols++; |
178 | } else { | 184 | } else { |
179 | /* if (0) printk ("dsp_spos: symbol <%s> duplicated, probably nothing wrong with that (Cirrus?)\n", | 185 | #if 0 |
180 | module->symbol_table.symbols[i].symbol_name); */ | 186 | dev_dbg(chip->card->dev, |
187 | "dsp_spos: symbol <%s> duplicated, probably nothing wrong with that (Cirrus?)\n", | ||
188 | module->symbol_table.symbols[i].symbol_name); */ | ||
189 | #endif | ||
181 | } | 190 | } |
182 | } | 191 | } |
183 | 192 | ||
@@ -192,14 +201,15 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type) | |||
192 | int index; | 201 | int index; |
193 | 202 | ||
194 | if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { | 203 | if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { |
195 | snd_printk(KERN_ERR "dsp_spos: symbol table is full\n"); | 204 | dev_err(chip->card->dev, "dsp_spos: symbol table is full\n"); |
196 | return NULL; | 205 | return NULL; |
197 | } | 206 | } |
198 | 207 | ||
199 | if (cs46xx_dsp_lookup_symbol(chip, | 208 | if (cs46xx_dsp_lookup_symbol(chip, |
200 | symbol_name, | 209 | symbol_name, |
201 | type) != NULL) { | 210 | type) != NULL) { |
202 | snd_printk(KERN_ERR "dsp_spos: symbol <%s> duplicated\n", symbol_name); | 211 | dev_err(chip->card->dev, |
212 | "dsp_spos: symbol <%s> duplicated\n", symbol_name); | ||
203 | return NULL; | 213 | return NULL; |
204 | } | 214 | } |
205 | 215 | ||
@@ -305,19 +315,20 @@ static int dsp_load_parameter(struct snd_cs46xx *chip, | |||
305 | u32 doffset, dsize; | 315 | u32 doffset, dsize; |
306 | 316 | ||
307 | if (!parameter) { | 317 | if (!parameter) { |
308 | snd_printdd("dsp_spos: module got no parameter segment\n"); | 318 | dev_dbg(chip->card->dev, |
319 | "dsp_spos: module got no parameter segment\n"); | ||
309 | return 0; | 320 | return 0; |
310 | } | 321 | } |
311 | 322 | ||
312 | doffset = (parameter->offset * 4 + DSP_PARAMETER_BYTE_OFFSET); | 323 | doffset = (parameter->offset * 4 + DSP_PARAMETER_BYTE_OFFSET); |
313 | dsize = parameter->size * 4; | 324 | dsize = parameter->size * 4; |
314 | 325 | ||
315 | snd_printdd("dsp_spos: " | 326 | dev_dbg(chip->card->dev, |
316 | "downloading parameter data to chip (%08x-%08x)\n", | 327 | "dsp_spos: downloading parameter data to chip (%08x-%08x)\n", |
317 | doffset,doffset + dsize); | 328 | doffset,doffset + dsize); |
318 | if (snd_cs46xx_download (chip, parameter->data, doffset, dsize)) { | 329 | if (snd_cs46xx_download (chip, parameter->data, doffset, dsize)) { |
319 | snd_printk(KERN_ERR "dsp_spos: " | 330 | dev_err(chip->card->dev, |
320 | "failed to download parameter data to DSP\n"); | 331 | "dsp_spos: failed to download parameter data to DSP\n"); |
321 | return -EINVAL; | 332 | return -EINVAL; |
322 | } | 333 | } |
323 | return 0; | 334 | return 0; |
@@ -329,18 +340,21 @@ static int dsp_load_sample(struct snd_cs46xx *chip, | |||
329 | u32 doffset, dsize; | 340 | u32 doffset, dsize; |
330 | 341 | ||
331 | if (!sample) { | 342 | if (!sample) { |
332 | snd_printdd("dsp_spos: module got no sample segment\n"); | 343 | dev_dbg(chip->card->dev, |
344 | "dsp_spos: module got no sample segment\n"); | ||
333 | return 0; | 345 | return 0; |
334 | } | 346 | } |
335 | 347 | ||
336 | doffset = (sample->offset * 4 + DSP_SAMPLE_BYTE_OFFSET); | 348 | doffset = (sample->offset * 4 + DSP_SAMPLE_BYTE_OFFSET); |
337 | dsize = sample->size * 4; | 349 | dsize = sample->size * 4; |
338 | 350 | ||
339 | snd_printdd("dsp_spos: downloading sample data to chip (%08x-%08x)\n", | 351 | dev_dbg(chip->card->dev, |
352 | "dsp_spos: downloading sample data to chip (%08x-%08x)\n", | ||
340 | doffset,doffset + dsize); | 353 | doffset,doffset + dsize); |
341 | 354 | ||
342 | if (snd_cs46xx_download (chip,sample->data,doffset,dsize)) { | 355 | if (snd_cs46xx_download (chip,sample->data,doffset,dsize)) { |
343 | snd_printk(KERN_ERR "dsp_spos: failed to sample data to DSP\n"); | 356 | dev_err(chip->card->dev, |
357 | "dsp_spos: failed to sample data to DSP\n"); | ||
344 | return -EINVAL; | 358 | return -EINVAL; |
345 | } | 359 | } |
346 | return 0; | 360 | return 0; |
@@ -354,14 +368,16 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m | |||
354 | int err; | 368 | int err; |
355 | 369 | ||
356 | if (ins->nmodules == DSP_MAX_MODULES - 1) { | 370 | if (ins->nmodules == DSP_MAX_MODULES - 1) { |
357 | snd_printk(KERN_ERR "dsp_spos: to many modules loaded into DSP\n"); | 371 | dev_err(chip->card->dev, |
372 | "dsp_spos: to many modules loaded into DSP\n"); | ||
358 | return -ENOMEM; | 373 | return -ENOMEM; |
359 | } | 374 | } |
360 | 375 | ||
361 | snd_printdd("dsp_spos: loading module %s into DSP\n", module->module_name); | 376 | dev_dbg(chip->card->dev, |
377 | "dsp_spos: loading module %s into DSP\n", module->module_name); | ||
362 | 378 | ||
363 | if (ins->nmodules == 0) { | 379 | if (ins->nmodules == 0) { |
364 | snd_printdd("dsp_spos: clearing parameter area\n"); | 380 | dev_dbg(chip->card->dev, "dsp_spos: clearing parameter area\n"); |
365 | snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, DSP_PARAMETER_BYTE_SIZE); | 381 | snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, DSP_PARAMETER_BYTE_SIZE); |
366 | } | 382 | } |
367 | 383 | ||
@@ -371,7 +387,7 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m | |||
371 | return err; | 387 | return err; |
372 | 388 | ||
373 | if (ins->nmodules == 0) { | 389 | if (ins->nmodules == 0) { |
374 | snd_printdd("dsp_spos: clearing sample area\n"); | 390 | dev_dbg(chip->card->dev, "dsp_spos: clearing sample area\n"); |
375 | snd_cs46xx_clear_BA1(chip, DSP_SAMPLE_BYTE_OFFSET, DSP_SAMPLE_BYTE_SIZE); | 391 | snd_cs46xx_clear_BA1(chip, DSP_SAMPLE_BYTE_OFFSET, DSP_SAMPLE_BYTE_SIZE); |
376 | } | 392 | } |
377 | 393 | ||
@@ -381,15 +397,17 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m | |||
381 | return err; | 397 | return err; |
382 | 398 | ||
383 | if (ins->nmodules == 0) { | 399 | if (ins->nmodules == 0) { |
384 | snd_printdd("dsp_spos: clearing code area\n"); | 400 | dev_dbg(chip->card->dev, "dsp_spos: clearing code area\n"); |
385 | snd_cs46xx_clear_BA1(chip, DSP_CODE_BYTE_OFFSET, DSP_CODE_BYTE_SIZE); | 401 | snd_cs46xx_clear_BA1(chip, DSP_CODE_BYTE_OFFSET, DSP_CODE_BYTE_SIZE); |
386 | } | 402 | } |
387 | 403 | ||
388 | if (code == NULL) { | 404 | if (code == NULL) { |
389 | snd_printdd("dsp_spos: module got no code segment\n"); | 405 | dev_dbg(chip->card->dev, |
406 | "dsp_spos: module got no code segment\n"); | ||
390 | } else { | 407 | } else { |
391 | if (ins->code.offset + code->size > DSP_CODE_BYTE_SIZE) { | 408 | if (ins->code.offset + code->size > DSP_CODE_BYTE_SIZE) { |
392 | snd_printk(KERN_ERR "dsp_spos: no space available in DSP\n"); | 409 | dev_err(chip->card->dev, |
410 | "dsp_spos: no space available in DSP\n"); | ||
393 | return -ENOMEM; | 411 | return -ENOMEM; |
394 | } | 412 | } |
395 | 413 | ||
@@ -401,19 +419,22 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m | |||
401 | if (snd_BUG_ON(!module->symbol_table.symbols)) | 419 | if (snd_BUG_ON(!module->symbol_table.symbols)) |
402 | return -ENOMEM; | 420 | return -ENOMEM; |
403 | if (add_symbols(chip,module)) { | 421 | if (add_symbols(chip,module)) { |
404 | snd_printk(KERN_ERR "dsp_spos: failed to load symbol table\n"); | 422 | dev_err(chip->card->dev, |
423 | "dsp_spos: failed to load symbol table\n"); | ||
405 | return -ENOMEM; | 424 | return -ENOMEM; |
406 | } | 425 | } |
407 | 426 | ||
408 | doffset = (code->offset * 4 + ins->code.offset * 4 + DSP_CODE_BYTE_OFFSET); | 427 | doffset = (code->offset * 4 + ins->code.offset * 4 + DSP_CODE_BYTE_OFFSET); |
409 | dsize = code->size * 4; | 428 | dsize = code->size * 4; |
410 | snd_printdd("dsp_spos: downloading code to chip (%08x-%08x)\n", | 429 | dev_dbg(chip->card->dev, |
430 | "dsp_spos: downloading code to chip (%08x-%08x)\n", | ||
411 | doffset,doffset + dsize); | 431 | doffset,doffset + dsize); |
412 | 432 | ||
413 | module->nfixups = shadow_and_reallocate_code(chip,code->data,code->size,module->overlay_begin_address); | 433 | module->nfixups = shadow_and_reallocate_code(chip,code->data,code->size,module->overlay_begin_address); |
414 | 434 | ||
415 | if (snd_cs46xx_download (chip,(ins->code.data + ins->code.offset),doffset,dsize)) { | 435 | if (snd_cs46xx_download (chip,(ins->code.data + ins->code.offset),doffset,dsize)) { |
416 | snd_printk(KERN_ERR "dsp_spos: failed to download code to DSP\n"); | 436 | dev_err(chip->card->dev, |
437 | "dsp_spos: failed to download code to DSP\n"); | ||
417 | return -EINVAL; | 438 | return -EINVAL; |
418 | } | 439 | } |
419 | 440 | ||
@@ -447,7 +468,7 @@ cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symb | |||
447 | } | 468 | } |
448 | 469 | ||
449 | #if 0 | 470 | #if 0 |
450 | printk ("dsp_spos: symbol <%s> type %02x not found\n", | 471 | dev_err(chip->card->dev, "dsp_spos: symbol <%s> type %02x not found\n", |
451 | symbol_name,symbol_type); | 472 | symbol_name,symbol_type); |
452 | #endif | 473 | #endif |
453 | 474 | ||
@@ -910,7 +931,6 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) | |||
910 | } | 931 | } |
911 | #endif /* CONFIG_PROC_FS */ | 932 | #endif /* CONFIG_PROC_FS */ |
912 | 933 | ||
913 | static int debug_tree; | ||
914 | static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data, | 934 | static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data, |
915 | u32 dest, int size) | 935 | u32 dest, int size) |
916 | { | 936 | { |
@@ -919,13 +939,13 @@ static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data, | |||
919 | int i; | 939 | int i; |
920 | 940 | ||
921 | for (i = 0; i < size; ++i) { | 941 | for (i = 0; i < size; ++i) { |
922 | if (debug_tree) printk ("addr %p, val %08x\n",spdst,task_data[i]); | 942 | dev_dbg(chip->card->dev, "addr %p, val %08x\n", |
943 | spdst, task_data[i]); | ||
923 | writel(task_data[i],spdst); | 944 | writel(task_data[i],spdst); |
924 | spdst += sizeof(u32); | 945 | spdst += sizeof(u32); |
925 | } | 946 | } |
926 | } | 947 | } |
927 | 948 | ||
928 | static int debug_scb; | ||
929 | static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest) | 949 | static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest) |
930 | { | 950 | { |
931 | void __iomem *spdst = chip->region.idx[1].remap_addr + | 951 | void __iomem *spdst = chip->region.idx[1].remap_addr + |
@@ -933,7 +953,8 @@ static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest) | |||
933 | int i; | 953 | int i; |
934 | 954 | ||
935 | for (i = 0; i < 0x10; ++i) { | 955 | for (i = 0; i < 0x10; ++i) { |
936 | if (debug_scb) printk ("addr %p, val %08x\n",spdst,scb_data[i]); | 956 | dev_dbg(chip->card->dev, "addr %p, val %08x\n", |
957 | spdst, scb_data[i]); | ||
937 | writel(scb_data[i],spdst); | 958 | writel(scb_data[i],spdst); |
938 | spdst += sizeof(u32); | 959 | spdst += sizeof(u32); |
939 | } | 960 | } |
@@ -960,7 +981,8 @@ static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * nam | |||
960 | int index; | 981 | int index; |
961 | 982 | ||
962 | if (ins->nscb == DSP_MAX_SCB_DESC - 1) { | 983 | if (ins->nscb == DSP_MAX_SCB_DESC - 1) { |
963 | snd_printk(KERN_ERR "dsp_spos: got no place for other SCB\n"); | 984 | dev_err(chip->card->dev, |
985 | "dsp_spos: got no place for other SCB\n"); | ||
964 | return NULL; | 986 | return NULL; |
965 | } | 987 | } |
966 | 988 | ||
@@ -991,7 +1013,8 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size) | |||
991 | struct dsp_task_descriptor * desc = NULL; | 1013 | struct dsp_task_descriptor * desc = NULL; |
992 | 1014 | ||
993 | if (ins->ntask == DSP_MAX_TASK_DESC - 1) { | 1015 | if (ins->ntask == DSP_MAX_TASK_DESC - 1) { |
994 | snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n"); | 1016 | dev_err(chip->card->dev, |
1017 | "dsp_spos: got no place for other TASK\n"); | ||
995 | return NULL; | 1018 | return NULL; |
996 | } | 1019 | } |
997 | 1020 | ||
@@ -1031,7 +1054,7 @@ cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 | |||
1031 | desc->data = scb_data; | 1054 | desc->data = scb_data; |
1032 | _dsp_create_scb(chip,scb_data,dest); | 1055 | _dsp_create_scb(chip,scb_data,dest); |
1033 | } else { | 1056 | } else { |
1034 | snd_printk(KERN_ERR "dsp_spos: failed to map SCB\n"); | 1057 | dev_err(chip->card->dev, "dsp_spos: failed to map SCB\n"); |
1035 | #ifdef CONFIG_PM_SLEEP | 1058 | #ifdef CONFIG_PM_SLEEP |
1036 | kfree(scb_data); | 1059 | kfree(scb_data); |
1037 | #endif | 1060 | #endif |
@@ -1052,7 +1075,7 @@ cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_da | |||
1052 | desc->data = task_data; | 1075 | desc->data = task_data; |
1053 | _dsp_create_task_tree(chip,task_data,dest,size); | 1076 | _dsp_create_task_tree(chip,task_data,dest,size); |
1054 | } else { | 1077 | } else { |
1055 | snd_printk(KERN_ERR "dsp_spos: failed to map TASK\n"); | 1078 | dev_err(chip->card->dev, "dsp_spos: failed to map TASK\n"); |
1056 | } | 1079 | } |
1057 | 1080 | ||
1058 | return desc; | 1081 | return desc; |
@@ -1105,31 +1128,36 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip) | |||
1105 | 1128 | ||
1106 | null_algorithm = cs46xx_dsp_lookup_symbol(chip, "NULLALGORITHM", SYMBOL_CODE); | 1129 | null_algorithm = cs46xx_dsp_lookup_symbol(chip, "NULLALGORITHM", SYMBOL_CODE); |
1107 | if (null_algorithm == NULL) { | 1130 | if (null_algorithm == NULL) { |
1108 | snd_printk(KERN_ERR "dsp_spos: symbol NULLALGORITHM not found\n"); | 1131 | dev_err(chip->card->dev, |
1132 | "dsp_spos: symbol NULLALGORITHM not found\n"); | ||
1109 | return -EIO; | 1133 | return -EIO; |
1110 | } | 1134 | } |
1111 | 1135 | ||
1112 | fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE); | 1136 | fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE); |
1113 | if (fg_task_tree_header_code == NULL) { | 1137 | if (fg_task_tree_header_code == NULL) { |
1114 | snd_printk(KERN_ERR "dsp_spos: symbol FGTASKTREEHEADERCODE not found\n"); | 1138 | dev_err(chip->card->dev, |
1139 | "dsp_spos: symbol FGTASKTREEHEADERCODE not found\n"); | ||
1115 | return -EIO; | 1140 | return -EIO; |
1116 | } | 1141 | } |
1117 | 1142 | ||
1118 | task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE); | 1143 | task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE); |
1119 | if (task_tree_header_code == NULL) { | 1144 | if (task_tree_header_code == NULL) { |
1120 | snd_printk(KERN_ERR "dsp_spos: symbol TASKTREEHEADERCODE not found\n"); | 1145 | dev_err(chip->card->dev, |
1146 | "dsp_spos: symbol TASKTREEHEADERCODE not found\n"); | ||
1121 | return -EIO; | 1147 | return -EIO; |
1122 | } | 1148 | } |
1123 | 1149 | ||
1124 | task_tree_thread = cs46xx_dsp_lookup_symbol(chip, "TASKTREETHREAD", SYMBOL_CODE); | 1150 | task_tree_thread = cs46xx_dsp_lookup_symbol(chip, "TASKTREETHREAD", SYMBOL_CODE); |
1125 | if (task_tree_thread == NULL) { | 1151 | if (task_tree_thread == NULL) { |
1126 | snd_printk(KERN_ERR "dsp_spos: symbol TASKTREETHREAD not found\n"); | 1152 | dev_err(chip->card->dev, |
1153 | "dsp_spos: symbol TASKTREETHREAD not found\n"); | ||
1127 | return -EIO; | 1154 | return -EIO; |
1128 | } | 1155 | } |
1129 | 1156 | ||
1130 | magic_snoop_task = cs46xx_dsp_lookup_symbol(chip, "MAGICSNOOPTASK", SYMBOL_CODE); | 1157 | magic_snoop_task = cs46xx_dsp_lookup_symbol(chip, "MAGICSNOOPTASK", SYMBOL_CODE); |
1131 | if (magic_snoop_task == NULL) { | 1158 | if (magic_snoop_task == NULL) { |
1132 | snd_printk(KERN_ERR "dsp_spos: symbol MAGICSNOOPTASK not found\n"); | 1159 | dev_err(chip->card->dev, |
1160 | "dsp_spos: symbol MAGICSNOOPTASK not found\n"); | ||
1133 | return -EIO; | 1161 | return -EIO; |
1134 | } | 1162 | } |
1135 | 1163 | ||
@@ -1476,7 +1504,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip) | |||
1476 | return 0; | 1504 | return 0; |
1477 | 1505 | ||
1478 | _fail_end: | 1506 | _fail_end: |
1479 | snd_printk(KERN_ERR "dsp_spos: failed to setup SCB's in DSP\n"); | 1507 | dev_err(chip->card->dev, "dsp_spos: failed to setup SCB's in DSP\n"); |
1480 | return -EINVAL; | 1508 | return -EINVAL; |
1481 | } | 1509 | } |
1482 | 1510 | ||
@@ -1491,18 +1519,21 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, | |||
1491 | 1519 | ||
1492 | s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE); | 1520 | s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE); |
1493 | if (s16_async_codec_input_task == NULL) { | 1521 | if (s16_async_codec_input_task == NULL) { |
1494 | snd_printk(KERN_ERR "dsp_spos: symbol S16_ASYNCCODECINPUTTASK not found\n"); | 1522 | dev_err(chip->card->dev, |
1523 | "dsp_spos: symbol S16_ASYNCCODECINPUTTASK not found\n"); | ||
1495 | return -EIO; | 1524 | return -EIO; |
1496 | } | 1525 | } |
1497 | spdifo_task = cs46xx_dsp_lookup_symbol(chip, "SPDIFOTASK", SYMBOL_CODE); | 1526 | spdifo_task = cs46xx_dsp_lookup_symbol(chip, "SPDIFOTASK", SYMBOL_CODE); |
1498 | if (spdifo_task == NULL) { | 1527 | if (spdifo_task == NULL) { |
1499 | snd_printk(KERN_ERR "dsp_spos: symbol SPDIFOTASK not found\n"); | 1528 | dev_err(chip->card->dev, |
1529 | "dsp_spos: symbol SPDIFOTASK not found\n"); | ||
1500 | return -EIO; | 1530 | return -EIO; |
1501 | } | 1531 | } |
1502 | 1532 | ||
1503 | spdifi_task = cs46xx_dsp_lookup_symbol(chip, "SPDIFITASK", SYMBOL_CODE); | 1533 | spdifi_task = cs46xx_dsp_lookup_symbol(chip, "SPDIFITASK", SYMBOL_CODE); |
1504 | if (spdifi_task == NULL) { | 1534 | if (spdifi_task == NULL) { |
1505 | snd_printk(KERN_ERR "dsp_spos: symbol SPDIFITASK not found\n"); | 1535 | dev_err(chip->card->dev, |
1536 | "dsp_spos: symbol SPDIFITASK not found\n"); | ||
1506 | return -EIO; | 1537 | return -EIO; |
1507 | } | 1538 | } |
1508 | 1539 | ||
@@ -1883,7 +1914,8 @@ int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data) | |||
1883 | } | 1914 | } |
1884 | 1915 | ||
1885 | if (i == 25) { | 1916 | if (i == 25) { |
1886 | snd_printk(KERN_ERR "dsp_spos: SPIOWriteTask not responding\n"); | 1917 | dev_err(chip->card->dev, |
1918 | "dsp_spos: SPIOWriteTask not responding\n"); | ||
1887 | return -EBUSY; | 1919 | return -EBUSY; |
1888 | } | 1920 | } |
1889 | 1921 | ||
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 409e8764fbeb..8284bc9b5858 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c | |||
@@ -233,8 +233,11 @@ void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb) | |||
233 | { | 233 | { |
234 | if (scb->proc_info) { | 234 | if (scb->proc_info) { |
235 | struct proc_scb_info * scb_info = scb->proc_info->private_data; | 235 | struct proc_scb_info * scb_info = scb->proc_info->private_data; |
236 | struct snd_cs46xx *chip = scb_info->chip; | ||
236 | 237 | ||
237 | snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name); | 238 | dev_dbg(chip->card->dev, |
239 | "cs46xx_dsp_proc_free_scb_desc: freeing %s\n", | ||
240 | scb->scb_name); | ||
238 | 241 | ||
239 | snd_info_free_entry(scb->proc_info); | 242 | snd_info_free_entry(scb->proc_info); |
240 | scb->proc_info = NULL; | 243 | scb->proc_info = NULL; |
@@ -305,7 +308,7 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u | |||
305 | scb_data[SCBfuncEntryPtr] &= 0xFFFF0000; | 308 | scb_data[SCBfuncEntryPtr] &= 0xFFFF0000; |
306 | scb_data[SCBfuncEntryPtr] |= task_entry->address; | 309 | scb_data[SCBfuncEntryPtr] |= task_entry->address; |
307 | 310 | ||
308 | snd_printdd("dsp_spos: creating SCB <%s>\n",name); | 311 | dev_dbg(chip->card->dev, "dsp_spos: creating SCB <%s>\n", name); |
309 | 312 | ||
310 | scb = cs46xx_dsp_create_scb(chip,name,scb_data,dest); | 313 | scb = cs46xx_dsp_create_scb(chip,name,scb_data,dest); |
311 | 314 | ||
@@ -320,9 +323,15 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u | |||
320 | /* update parent SCB */ | 323 | /* update parent SCB */ |
321 | if (scb->parent_scb_ptr) { | 324 | if (scb->parent_scb_ptr) { |
322 | #if 0 | 325 | #if 0 |
323 | printk ("scb->parent_scb_ptr = %s\n",scb->parent_scb_ptr->scb_name); | 326 | dev_dbg(chip->card->dev, |
324 | printk ("scb->parent_scb_ptr->next_scb_ptr = %s\n",scb->parent_scb_ptr->next_scb_ptr->scb_name); | 327 | "scb->parent_scb_ptr = %s\n", |
325 | printk ("scb->parent_scb_ptr->sub_list_ptr = %s\n",scb->parent_scb_ptr->sub_list_ptr->scb_name); | 328 | scb->parent_scb_ptr->scb_name); |
329 | dev_dbg(chip->card->dev, | ||
330 | "scb->parent_scb_ptr->next_scb_ptr = %s\n", | ||
331 | scb->parent_scb_ptr->next_scb_ptr->scb_name); | ||
332 | dev_dbg(chip->card->dev, | ||
333 | "scb->parent_scb_ptr->sub_list_ptr = %s\n", | ||
334 | scb->parent_scb_ptr->sub_list_ptr->scb_name); | ||
326 | #endif | 335 | #endif |
327 | /* link to parent SCB */ | 336 | /* link to parent SCB */ |
328 | if (scb_child_type == SCB_ON_PARENT_NEXT_SCB) { | 337 | if (scb_child_type == SCB_ON_PARENT_NEXT_SCB) { |
@@ -368,7 +377,8 @@ cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_d | |||
368 | SYMBOL_CODE); | 377 | SYMBOL_CODE); |
369 | 378 | ||
370 | if (task_entry == NULL) { | 379 | if (task_entry == NULL) { |
371 | snd_printk (KERN_ERR "dsp_spos: symbol %s not found\n",task_entry_name); | 380 | dev_err(chip->card->dev, |
381 | "dsp_spos: symbol %s not found\n", task_entry_name); | ||
372 | return NULL; | 382 | return NULL; |
373 | } | 383 | } |
374 | 384 | ||
@@ -582,7 +592,8 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name, | |||
582 | SYMBOL_CODE); | 592 | SYMBOL_CODE); |
583 | 593 | ||
584 | if (ins->null_algorithm == NULL) { | 594 | if (ins->null_algorithm == NULL) { |
585 | snd_printk (KERN_ERR "dsp_spos: symbol NULLALGORITHM not found\n"); | 595 | dev_err(chip->card->dev, |
596 | "dsp_spos: symbol NULLALGORITHM not found\n"); | ||
586 | return NULL; | 597 | return NULL; |
587 | } | 598 | } |
588 | } | 599 | } |
@@ -612,7 +623,8 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name, | |||
612 | unsigned int phiIncr; | 623 | unsigned int phiIncr; |
613 | unsigned int correctionPerGOF, correctionPerSec; | 624 | unsigned int correctionPerGOF, correctionPerSec; |
614 | 625 | ||
615 | snd_printdd( "dsp_spos: setting %s rate to %u\n",scb_name,rate); | 626 | dev_dbg(chip->card->dev, "dsp_spos: setting %s rate to %u\n", |
627 | scb_name, rate); | ||
616 | 628 | ||
617 | /* | 629 | /* |
618 | * Compute the values used to drive the actual sample rate conversion. | 630 | * Compute the values used to drive the actual sample rate conversion. |
@@ -670,7 +682,8 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name, | |||
670 | SYMBOL_CODE); | 682 | SYMBOL_CODE); |
671 | 683 | ||
672 | if (ins->s16_up == NULL) { | 684 | if (ins->s16_up == NULL) { |
673 | snd_printk (KERN_ERR "dsp_spos: symbol S16_UPSRC not found\n"); | 685 | dev_err(chip->card->dev, |
686 | "dsp_spos: symbol S16_UPSRC not found\n"); | ||
674 | return NULL; | 687 | return NULL; |
675 | } | 688 | } |
676 | } | 689 | } |
@@ -1265,7 +1278,7 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1265 | the Sample Rate Converted (which could | 1278 | the Sample Rate Converted (which could |
1266 | alter the raw data stream ...) */ | 1279 | alter the raw data stream ...) */ |
1267 | if (sample_rate == 48000) { | 1280 | if (sample_rate == 48000) { |
1268 | snd_printdd ("IEC958 pass through\n"); | 1281 | dev_dbg(chip->card->dev, "IEC958 pass through\n"); |
1269 | /* Hack to bypass creating a new SRC */ | 1282 | /* Hack to bypass creating a new SRC */ |
1270 | pass_through = 1; | 1283 | pass_through = 1; |
1271 | } | 1284 | } |
@@ -1299,13 +1312,14 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1299 | } | 1312 | } |
1300 | 1313 | ||
1301 | if (pcm_index == -1) { | 1314 | if (pcm_index == -1) { |
1302 | snd_printk (KERN_ERR "dsp_spos: no free PCM channel\n"); | 1315 | dev_err(chip->card->dev, "dsp_spos: no free PCM channel\n"); |
1303 | return NULL; | 1316 | return NULL; |
1304 | } | 1317 | } |
1305 | 1318 | ||
1306 | if (src_scb == NULL) { | 1319 | if (src_scb == NULL) { |
1307 | if (ins->nsrc_scb >= DSP_MAX_SRC_NR) { | 1320 | if (ins->nsrc_scb >= DSP_MAX_SRC_NR) { |
1308 | snd_printk(KERN_ERR "dsp_spos: to many SRC instances\n!"); | 1321 | dev_err(chip->card->dev, |
1322 | "dsp_spos: to many SRC instances\n!"); | ||
1309 | return NULL; | 1323 | return NULL; |
1310 | } | 1324 | } |
1311 | 1325 | ||
@@ -1331,7 +1345,8 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1331 | 1345 | ||
1332 | snprintf (scb_name,DSP_MAX_SCB_NAME,"SrcTask_SCB%d",src_index); | 1346 | snprintf (scb_name,DSP_MAX_SCB_NAME,"SrcTask_SCB%d",src_index); |
1333 | 1347 | ||
1334 | snd_printdd( "dsp_spos: creating SRC \"%s\"\n",scb_name); | 1348 | dev_dbg(chip->card->dev, |
1349 | "dsp_spos: creating SRC \"%s\"\n", scb_name); | ||
1335 | src_scb = cs46xx_dsp_create_src_task_scb(chip,scb_name, | 1350 | src_scb = cs46xx_dsp_create_src_task_scb(chip,scb_name, |
1336 | sample_rate, | 1351 | sample_rate, |
1337 | src_output_buffer_addr[src_index], | 1352 | src_output_buffer_addr[src_index], |
@@ -1343,7 +1358,8 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1343 | pass_through); | 1358 | pass_through); |
1344 | 1359 | ||
1345 | if (!src_scb) { | 1360 | if (!src_scb) { |
1346 | snd_printk (KERN_ERR "dsp_spos: failed to create SRCtaskSCB\n"); | 1361 | dev_err(chip->card->dev, |
1362 | "dsp_spos: failed to create SRCtaskSCB\n"); | ||
1347 | return NULL; | 1363 | return NULL; |
1348 | } | 1364 | } |
1349 | 1365 | ||
@@ -1355,8 +1371,8 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1355 | 1371 | ||
1356 | snprintf (scb_name,DSP_MAX_SCB_NAME,"PCMReader_SCB%d",pcm_index); | 1372 | snprintf (scb_name,DSP_MAX_SCB_NAME,"PCMReader_SCB%d",pcm_index); |
1357 | 1373 | ||
1358 | snd_printdd( "dsp_spos: creating PCM \"%s\" (%d)\n",scb_name, | 1374 | dev_dbg(chip->card->dev, "dsp_spos: creating PCM \"%s\" (%d)\n", |
1359 | pcm_channel_id); | 1375 | scb_name, pcm_channel_id); |
1360 | 1376 | ||
1361 | pcm_scb = cs46xx_dsp_create_pcm_reader_scb(chip,scb_name, | 1377 | pcm_scb = cs46xx_dsp_create_pcm_reader_scb(chip,scb_name, |
1362 | pcm_reader_buffer_addr[pcm_index], | 1378 | pcm_reader_buffer_addr[pcm_index], |
@@ -1369,7 +1385,8 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, | |||
1369 | ); | 1385 | ); |
1370 | 1386 | ||
1371 | if (!pcm_scb) { | 1387 | if (!pcm_scb) { |
1372 | snd_printk (KERN_ERR "dsp_spos: failed to create PCMreaderSCB\n"); | 1388 | dev_err(chip->card->dev, |
1389 | "dsp_spos: failed to create PCMreaderSCB\n"); | ||
1373 | return NULL; | 1390 | return NULL; |
1374 | } | 1391 | } |
1375 | 1392 | ||
@@ -1419,7 +1436,8 @@ int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip, | |||
1419 | temp |= DMA_RQ_C1_SOURCE_MOD16; | 1436 | temp |= DMA_RQ_C1_SOURCE_MOD16; |
1420 | break; | 1437 | break; |
1421 | default: | 1438 | default: |
1422 | snd_printdd ("period size (%d) not supported by HW\n", period_size); | 1439 | dev_dbg(chip->card->dev, |
1440 | "period size (%d) not supported by HW\n", period_size); | ||
1423 | return -EINVAL; | 1441 | return -EINVAL; |
1424 | } | 1442 | } |
1425 | 1443 | ||
@@ -1457,7 +1475,8 @@ int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip, | |||
1457 | temp |= DMA_RQ_C1_DEST_MOD16; | 1475 | temp |= DMA_RQ_C1_DEST_MOD16; |
1458 | break; | 1476 | break; |
1459 | default: | 1477 | default: |
1460 | snd_printdd ("period size (%d) not supported by HW\n", period_size); | 1478 | dev_dbg(chip->card->dev, |
1479 | "period size (%d) not supported by HW\n", period_size); | ||
1461 | return -EINVAL; | 1480 | return -EINVAL; |
1462 | } | 1481 | } |
1463 | 1482 | ||