Commit a6676811 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: gus: Use standard print API

Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Some commented-out debug prints and dead code are dropped as well.
Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-27-tiwai@suse.de
parent 12174dfe
...@@ -30,7 +30,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus, ...@@ -30,7 +30,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
unsigned char dma_cmd; unsigned char dma_cmd;
unsigned int address_high; unsigned int address_high;
snd_printdd("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", dev_dbg(gus->card->dev,
"dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n",
addr, buf_addr, count); addr, buf_addr, count);
if (gus->gf1.dma1 > 3) { if (gus->gf1.dma1 > 3) {
...@@ -38,7 +39,9 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus, ...@@ -38,7 +39,9 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
address = addr >> 1; address = addr >> 1;
} else { } else {
if (addr & 0x1f) { if (addr & 0x1f) {
snd_printd("snd_gf1_dma_transfer: unaligned address (0x%x)?\n", addr); dev_dbg(gus->card->dev,
"%s: unaligned address (0x%x)?\n",
__func__, addr);
return; return;
} }
address = (addr & 0x000c0000) | ((addr & 0x0003ffff) >> 1); address = (addr & 0x000c0000) | ((addr & 0x0003ffff) >> 1);
...@@ -63,7 +66,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus, ...@@ -63,7 +66,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
snd_gf1_dma_ack(gus); snd_gf1_dma_ack(gus);
snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE); snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
#if 0 #if 0
snd_printk(KERN_DEBUG "address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", dev_dbg(gus->card->dev,
"address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n",
address << 1, count, dma_cmd); address << 1, count, dma_cmd);
#endif #endif
spin_lock_irqsave(&gus->reg_lock, flags); spin_lock_irqsave(&gus->reg_lock, flags);
...@@ -131,8 +135,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus) ...@@ -131,8 +135,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block); kfree(block);
#if 0 #if 0
snd_printd(KERN_DEBUG "program dma (IRQ) - " dev_dbg(gus->card->dev,
"addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", "program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
block->addr, block->buf_addr, block->count, block->cmd); block->addr, block->buf_addr, block->count, block->cmd);
#endif #endif
} }
...@@ -194,13 +198,16 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus, ...@@ -194,13 +198,16 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
*block = *__block; *block = *__block;
block->next = NULL; block->next = NULL;
snd_printdd("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", dev_dbg(gus->card->dev,
"addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
block->addr, (long) block->buffer, block->count, block->addr, (long) block->buffer, block->count,
block->cmd); block->cmd);
snd_printdd("gus->gf1.dma_data_pcm_last = 0x%lx\n", dev_dbg(gus->card->dev,
"gus->gf1.dma_data_pcm_last = 0x%lx\n",
(long)gus->gf1.dma_data_pcm_last); (long)gus->gf1.dma_data_pcm_last);
snd_printdd("gus->gf1.dma_data_pcm = 0x%lx\n", dev_dbg(gus->card->dev,
"gus->gf1.dma_data_pcm = 0x%lx\n",
(long)gus->gf1.dma_data_pcm); (long)gus->gf1.dma_data_pcm);
spin_lock_irqsave(&gus->dma_lock, flags); spin_lock_irqsave(&gus->dma_lock, flags);
......
This diff is collapsed.
...@@ -26,7 +26,6 @@ irqreturn_t snd_gus_interrupt(int irq, void *dev_id) ...@@ -26,7 +26,6 @@ irqreturn_t snd_gus_interrupt(int irq, void *dev_id)
if (status == 0) if (status == 0)
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
handled = 1; handled = 1;
/* snd_printk(KERN_DEBUG "IRQ: status = 0x%x\n", status); */
if (status & 0x02) { if (status & 0x02) {
STAT_ADD(gus->gf1.interrupt_stat_midi_in); STAT_ADD(gus->gf1.interrupt_stat_midi_in);
if (gus->gf1.interrupt_handler_midi_in) if (gus->gf1.interrupt_handler_midi_in)
...@@ -50,8 +49,8 @@ irqreturn_t snd_gus_interrupt(int irq, void *dev_id) ...@@ -50,8 +49,8 @@ irqreturn_t snd_gus_interrupt(int irq, void *dev_id)
continue; /* multi request */ continue; /* multi request */
already |= _current_; /* mark request */ already |= _current_; /* mark request */
#if 0 #if 0
printk(KERN_DEBUG "voice = %i, voice_status = 0x%x, " dev_dbg(gus->card->dev,
"voice_verify = %i\n", "voice = %i, voice_status = 0x%x, voice_verify = %i\n",
voice, voice_status, inb(GUSP(gus, GF1PAGE))); voice, voice_status, inb(GUSP(gus, GF1PAGE)));
#endif #endif
pvoice = &gus->gf1.voices[voice]; pvoice = &gus->gf1.voices[voice];
......
...@@ -158,32 +158,32 @@ int snd_gus_create(struct snd_card *card, ...@@ -158,32 +158,32 @@ int snd_gus_create(struct snd_card *card,
/* allocate resources */ /* allocate resources */
gus->gf1.res_port1 = request_region(port, 16, "GUS GF1 (Adlib/SB)"); gus->gf1.res_port1 = request_region(port, 16, "GUS GF1 (Adlib/SB)");
if (!gus->gf1.res_port1) { if (!gus->gf1.res_port1) {
snd_printk(KERN_ERR "gus: can't grab SB port 0x%lx\n", port); dev_err(card->dev, "gus: can't grab SB port 0x%lx\n", port);
snd_gus_free(gus); snd_gus_free(gus);
return -EBUSY; return -EBUSY;
} }
gus->gf1.res_port2 = request_region(port + 0x100, 12, "GUS GF1 (Synth)"); gus->gf1.res_port2 = request_region(port + 0x100, 12, "GUS GF1 (Synth)");
if (!gus->gf1.res_port2) { if (!gus->gf1.res_port2) {
snd_printk(KERN_ERR "gus: can't grab synth port 0x%lx\n", port + 0x100); dev_err(card->dev, "gus: can't grab synth port 0x%lx\n", port + 0x100);
snd_gus_free(gus); snd_gus_free(gus);
return -EBUSY; return -EBUSY;
} }
if (irq >= 0 && request_irq(irq, snd_gus_interrupt, 0, "GUS GF1", (void *) gus)) { if (irq >= 0 && request_irq(irq, snd_gus_interrupt, 0, "GUS GF1", (void *) gus)) {
snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq); dev_err(card->dev, "gus: can't grab irq %d\n", irq);
snd_gus_free(gus); snd_gus_free(gus);
return -EBUSY; return -EBUSY;
} }
gus->gf1.irq = irq; gus->gf1.irq = irq;
card->sync_irq = irq; card->sync_irq = irq;
if (request_dma(dma1, "GUS - 1")) { if (request_dma(dma1, "GUS - 1")) {
snd_printk(KERN_ERR "gus: can't grab DMA1 %d\n", dma1); dev_err(card->dev, "gus: can't grab DMA1 %d\n", dma1);
snd_gus_free(gus); snd_gus_free(gus);
return -EBUSY; return -EBUSY;
} }
gus->gf1.dma1 = dma1; gus->gf1.dma1 = dma1;
if (dma2 >= 0 && dma1 != dma2) { if (dma2 >= 0 && dma1 != dma2) {
if (request_dma(dma2, "GUS - 2")) { if (request_dma(dma2, "GUS - 2")) {
snd_printk(KERN_ERR "gus: can't grab DMA2 %d\n", dma2); dev_err(card->dev, "gus: can't grab DMA2 %d\n", dma2);
snd_gus_free(gus); snd_gus_free(gus);
return -EBUSY; return -EBUSY;
} }
...@@ -229,7 +229,9 @@ static int snd_gus_detect_memory(struct snd_gus_card * gus) ...@@ -229,7 +229,9 @@ static int snd_gus_detect_memory(struct snd_gus_card * gus)
snd_gf1_poke(gus, 0L, 0xaa); snd_gf1_poke(gus, 0L, 0xaa);
snd_gf1_poke(gus, 1L, 0x55); snd_gf1_poke(gus, 1L, 0x55);
if (snd_gf1_peek(gus, 0L) != 0xaa || snd_gf1_peek(gus, 1L) != 0x55) { if (snd_gf1_peek(gus, 0L) != 0xaa || snd_gf1_peek(gus, 1L) != 0x55) {
snd_printk(KERN_ERR "plain GF1 card at 0x%lx without onboard DRAM?\n", gus->gf1.port); dev_err(gus->card->dev,
"plain GF1 card at 0x%lx without onboard DRAM?\n",
gus->gf1.port);
return -ENOMEM; return -ENOMEM;
} }
for (idx = 1, d = 0xab; idx < 4; idx++, d++) { for (idx = 1, d = 0xab; idx < 4; idx++, d++) {
...@@ -287,14 +289,14 @@ static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches) ...@@ -287,14 +289,14 @@ static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches)
dma1 |= gus->equal_dma ? 0x40 : (dma2 << 3); dma1 |= gus->equal_dma ? 0x40 : (dma2 << 3);
if ((dma1 & 7) == 0 || (dma2 & 7) == 0) { if ((dma1 & 7) == 0 || (dma2 & 7) == 0) {
snd_printk(KERN_ERR "Error! DMA isn't defined.\n"); dev_err(gus->card->dev, "Error! DMA isn't defined.\n");
return -EINVAL; return -EINVAL;
} }
irq = gus->gf1.irq; irq = gus->gf1.irq;
irq = abs(irq); irq = abs(irq);
irq = irqs[irq & 0x0f]; irq = irqs[irq & 0x0f];
if (irq == 0) { if (irq == 0) {
snd_printk(KERN_ERR "Error! IRQ isn't defined.\n"); dev_err(gus->card->dev, "Error! IRQ isn't defined.\n");
return -EINVAL; return -EINVAL;
} }
irq |= 0x40; irq |= 0x40;
...@@ -357,7 +359,7 @@ static int snd_gus_check_version(struct snd_gus_card * gus) ...@@ -357,7 +359,7 @@ static int snd_gus_check_version(struct snd_gus_card * gus)
val = inb(GUSP(gus, REGCNTRLS)); val = inb(GUSP(gus, REGCNTRLS));
rev = inb(GUSP(gus, BOARDVERSION)); rev = inb(GUSP(gus, BOARDVERSION));
spin_unlock_irqrestore(&gus->reg_lock, flags); spin_unlock_irqrestore(&gus->reg_lock, flags);
snd_printdd("GF1 [0x%lx] init - val = 0x%x, rev = 0x%x\n", gus->gf1.port, val, rev); dev_dbg(card->dev, "GF1 [0x%lx] init - val = 0x%x, rev = 0x%x\n", gus->gf1.port, val, rev);
strcpy(card->driver, "GUS"); strcpy(card->driver, "GUS");
strcpy(card->longname, "Gravis UltraSound Classic (2.4)"); strcpy(card->longname, "Gravis UltraSound Classic (2.4)");
if ((val != 255 && (val & 0x06)) || (rev >= 5 && rev != 255)) { if ((val != 255 && (val & 0x06)) || (rev >= 5 && rev != 255)) {
...@@ -382,8 +384,11 @@ static int snd_gus_check_version(struct snd_gus_card * gus) ...@@ -382,8 +384,11 @@ static int snd_gus_check_version(struct snd_gus_card * gus)
strcpy(card->longname, "Gravis UltraSound Extreme"); strcpy(card->longname, "Gravis UltraSound Extreme");
gus->ess_flag = 1; gus->ess_flag = 1;
} else { } else {
snd_printk(KERN_ERR "unknown GF1 revision number at 0x%lx - 0x%x (0x%x)\n", gus->gf1.port, rev, val); dev_err(card->dev,
snd_printk(KERN_ERR " please - report to <perex@perex.cz>\n"); "unknown GF1 revision number at 0x%lx - 0x%x (0x%x)\n",
gus->gf1.port, rev, val);
dev_err(card->dev,
" please - report to <perex@perex.cz>\n");
} }
} }
} }
...@@ -400,7 +405,7 @@ int snd_gus_initialize(struct snd_gus_card *gus) ...@@ -400,7 +405,7 @@ int snd_gus_initialize(struct snd_gus_card *gus)
if (!gus->interwave) { if (!gus->interwave) {
err = snd_gus_check_version(gus); err = snd_gus_check_version(gus);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR "version check failed\n"); dev_err(gus->card->dev, "version check failed\n");
return err; return err;
} }
err = snd_gus_detect_memory(gus); err = snd_gus_detect_memory(gus);
......
...@@ -189,7 +189,7 @@ struct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem * alloc, int owne ...@@ -189,7 +189,7 @@ struct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem * alloc, int owne
if (nblock != NULL) { if (nblock != NULL) {
if (size != (int)nblock->size) { if (size != (int)nblock->size) {
/* TODO: remove in the future */ /* TODO: remove in the future */
snd_printk(KERN_ERR "snd_gf1_mem_alloc - share: sizes differ\n"); pr_err("%s - share: sizes differ\n", __func__);
goto __std; goto __std;
} }
nblock->share++; nblock->share++;
......
...@@ -67,10 +67,6 @@ static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream, ...@@ -67,10 +67,6 @@ static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream,
count += offset & 31; count += offset & 31;
offset &= ~31; offset &= ~31;
/*
snd_printk(KERN_DEBUG "block change - offset = 0x%x, count = 0x%x\n",
offset, count);
*/
memset(&block, 0, sizeof(block)); memset(&block, 0, sizeof(block));
block.cmd = SNDRV_GF1_DMA_IRQ; block.cmd = SNDRV_GF1_DMA_IRQ;
if (snd_pcm_format_unsigned(runtime->format)) if (snd_pcm_format_unsigned(runtime->format))
...@@ -123,11 +119,6 @@ static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream) ...@@ -123,11 +119,6 @@ static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream)
curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels; curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels;
end = curr + (pcmp->block_size / runtime->channels); end = curr + (pcmp->block_size / runtime->channels);
end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1; end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1;
/*
snd_printk(KERN_DEBUG "init: curr=0x%x, begin=0x%x, end=0x%x, "
"ctrl=0x%x, ramp=0x%x, rate=0x%x\n",
curr, begin, end, voice_ctrl, ramp_ctrl, rate);
*/
pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8; pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8;
vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
spin_lock_irqsave(&gus->reg_lock, flags); spin_lock_irqsave(&gus->reg_lock, flags);
...@@ -178,13 +169,13 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus, ...@@ -178,13 +169,13 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus,
unsigned int end, step; unsigned int end, step;
if (!pvoice->private_data) { if (!pvoice->private_data) {
snd_printd("snd_gf1_pcm: unknown wave irq?\n"); dev_dbg(gus->card->dev, "%s: unknown wave irq?\n", __func__);
snd_gf1_smart_stop_voice(gus, pvoice->number); snd_gf1_smart_stop_voice(gus, pvoice->number);
return; return;
} }
pcmp = pvoice->private_data; pcmp = pvoice->private_data;
if (pcmp == NULL) { if (pcmp == NULL) {
snd_printd("snd_gf1_pcm: unknown wave irq?\n"); dev_dbg(gus->card->dev, "%s: unknown wave irq?\n", __func__);
snd_gf1_smart_stop_voice(gus, pvoice->number); snd_gf1_smart_stop_voice(gus, pvoice->number);
return; return;
} }
...@@ -197,10 +188,10 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus, ...@@ -197,10 +188,10 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus,
ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03; ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03;
#if 0 #if 0
snd_gf1_select_voice(gus, pvoice->number); snd_gf1_select_voice(gus, pvoice->number);
printk(KERN_DEBUG "position = 0x%x\n", dev_dbg(gus->card->dev, "position = 0x%x\n",
(snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
snd_gf1_select_voice(gus, pcmp->pvoices[1]->number); snd_gf1_select_voice(gus, pcmp->pvoices[1]->number);
printk(KERN_DEBUG "position = 0x%x\n", dev_dbg(gus->card->dev, "position = 0x%x\n",
(snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
snd_gf1_select_voice(gus, pvoice->number); snd_gf1_select_voice(gus, pvoice->number);
#endif #endif
...@@ -293,11 +284,6 @@ static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf, ...@@ -293,11 +284,6 @@ static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf,
unsigned int len; unsigned int len;
unsigned long flags; unsigned long flags;
/*
printk(KERN_DEBUG
"poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n",
(int)buf, pos, count, gus->gf1.port);
*/
while (count > 0) { while (count > 0) {
len = count; len = count;
if (len > 512) /* limit, to allow IRQ */ if (len > 512) /* limit, to allow IRQ */
...@@ -673,7 +659,8 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream) ...@@ -673,7 +659,8 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream)
runtime->private_free = snd_gf1_pcm_playback_free; runtime->private_free = snd_gf1_pcm_playback_free;
#if 0 #if 0
printk(KERN_DEBUG "playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", dev_dbg(gus->card->dev,
"playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n",
(long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer); (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer);
#endif #endif
err = snd_gf1_dma_init(gus); err = snd_gf1_dma_init(gus);
...@@ -695,7 +682,7 @@ static int snd_gf1_pcm_playback_close(struct snd_pcm_substream *substream) ...@@ -695,7 +682,7 @@ static int snd_gf1_pcm_playback_close(struct snd_pcm_substream *substream)
struct gus_pcm_private *pcmp = runtime->private_data; struct gus_pcm_private *pcmp = runtime->private_data;
if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ)) if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ))
snd_printk(KERN_ERR "gf1 pcm - serious DMA problem\n"); dev_err(gus->card->dev, "gf1 pcm - serious DMA problem\n");
snd_gf1_dma_done(gus); snd_gf1_dma_done(gus);
return 0; return 0;
......
...@@ -116,7 +116,9 @@ void snd_gf1_smart_stop_voice(struct snd_gus_card * gus, unsigned short voice) ...@@ -116,7 +116,9 @@ void snd_gf1_smart_stop_voice(struct snd_gus_card * gus, unsigned short voice)
spin_lock_irqsave(&gus->reg_lock, flags); spin_lock_irqsave(&gus->reg_lock, flags);
snd_gf1_select_voice(gus, voice); snd_gf1_select_voice(gus, voice);
#if 0 #if 0
printk(KERN_DEBUG " -%i- smart stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME)); dev_dbg(gus->card->dev,
" -%i- smart stop voice - volume = 0x%x\n",
voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME));
#endif #endif
snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL); snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL);
snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
...@@ -130,7 +132,9 @@ void snd_gf1_stop_voice(struct snd_gus_card * gus, unsigned short voice) ...@@ -130,7 +132,9 @@ void snd_gf1_stop_voice(struct snd_gus_card * gus, unsigned short voice)
spin_lock_irqsave(&gus->reg_lock, flags); spin_lock_irqsave(&gus->reg_lock, flags);
snd_gf1_select_voice(gus, voice); snd_gf1_select_voice(gus, voice);
#if 0 #if 0
printk(KERN_DEBUG " -%i- stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME)); dev_dbg(gus->card->dev,
" -%i- stop voice - volume = 0x%x\n",
voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME));
#endif #endif
snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL); snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL);
snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
......
...@@ -89,7 +89,9 @@ static int snd_gf1_uart_output_open(struct snd_rawmidi_substream *substream) ...@@ -89,7 +89,9 @@ static int snd_gf1_uart_output_open(struct snd_rawmidi_substream *substream)
gus->midi_substream_output = substream; gus->midi_substream_output = substream;
spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
#if 0 #if 0
snd_printk(KERN_DEBUG "write init - cmd = 0x%x, stat = 0x%x\n", gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); dev_dbg(gus->card->dev,
"write init - cmd = 0x%x, stat = 0x%x\n",
gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
#endif #endif
return 0; return 0;
} }
...@@ -111,16 +113,15 @@ static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream) ...@@ -111,16 +113,15 @@ static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream)
for (i = 0; i < 1000 && (snd_gf1_uart_stat(gus) & 0x01); i++) for (i = 0; i < 1000 && (snd_gf1_uart_stat(gus) & 0x01); i++)
snd_gf1_uart_get(gus); /* clean Rx */ snd_gf1_uart_get(gus); /* clean Rx */
if (i >= 1000) if (i >= 1000)
snd_printk(KERN_ERR "gus midi uart init read - cleanup error\n"); dev_err(gus->card->dev, "gus midi uart init read - cleanup error\n");
} }
spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
#if 0 #if 0
snd_printk(KERN_DEBUG dev_dbg(gus->card->dev,
"read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", "read init - enable = %i, cmd = 0x%x, stat = 0x%x\n",
gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
snd_printk(KERN_DEBUG dev_dbg(gus->card->dev,
"[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x " "[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x (page = 0x%x)\n",
"(page = 0x%x)\n",
gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100),
inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102)); inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102));
#endif #endif
......
...@@ -104,7 +104,8 @@ unsigned short snd_gf1_translate_freq(struct snd_gus_card * gus, unsigned int fr ...@@ -104,7 +104,8 @@ unsigned short snd_gf1_translate_freq(struct snd_gus_card * gus, unsigned int fr
freq16 = 50; freq16 = 50;
if (freq16 & 0xf8000000) { if (freq16 & 0xf8000000) {
freq16 = ~0xf8000000; freq16 = ~0xf8000000;
snd_printk(KERN_ERR "snd_gf1_translate_freq: overflow - freq = 0x%x\n", freq16); dev_err(gus->card->dev, "%s: overflow - freq = 0x%x\n",
__func__, freq16);
} }
return ((freq16 << 9) + (gus->gf1.playback_freq >> 1)) / gus->gf1.playback_freq; return ((freq16 << 9) + (gus->gf1.playback_freq >> 1)) / gus->gf1.playback_freq;
} }
...@@ -189,14 +190,14 @@ unsigned short snd_gf1_compute_freq(unsigned int freq, ...@@ -189,14 +190,14 @@ unsigned short snd_gf1_compute_freq(unsigned int freq,
fc = (freq << 10) / rate; fc = (freq << 10) / rate;
if (fc > 97391L) { if (fc > 97391L) {
fc = 97391; fc = 97391;
snd_printk(KERN_ERR "patch: (1) fc frequency overflow - %u\n", fc); pr_err("patch: (1) fc frequency overflow - %u\n", fc);
} }
fc = (fc * 44100UL) / mix_rate; fc = (fc * 44100UL) / mix_rate;
while (scale--) while (scale--)
fc <<= 1; fc <<= 1;
if (fc > 65535L) { if (fc > 65535L) {
fc = 65535; fc = 65535;
snd_printk(KERN_ERR "patch: (2) fc frequency overflow - %u\n", fc); pr_err("patch: (2) fc frequency overflow - %u\n", fc);
} }
return (unsigned short) fc; return (unsigned short) fc;
} }
......
...@@ -115,7 +115,7 @@ static int snd_gusclassic_detect(struct snd_gus_card *gus) ...@@ -115,7 +115,7 @@ static int snd_gusclassic_detect(struct snd_gus_card *gus)
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 0) { if ((d & 0x07) != 0) {
snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
udelay(160); udelay(160);
...@@ -123,7 +123,7 @@ static int snd_gusclassic_detect(struct snd_gus_card *gus) ...@@ -123,7 +123,7 @@ static int snd_gusclassic_detect(struct snd_gus_card *gus)
udelay(160); udelay(160);
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 1) { if ((d & 0x07) != 1) {
snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
......
...@@ -179,7 +179,7 @@ static int snd_gusextreme_detect(struct snd_gus_card *gus, ...@@ -179,7 +179,7 @@ static int snd_gusextreme_detect(struct snd_gus_card *gus,
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 0) { if ((d & 0x07) != 0) {
snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
return -EIO; return -EIO;
} }
udelay(160); udelay(160);
...@@ -187,7 +187,7 @@ static int snd_gusextreme_detect(struct snd_gus_card *gus, ...@@ -187,7 +187,7 @@ static int snd_gusextreme_detect(struct snd_gus_card *gus,
udelay(160); udelay(160);
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 1) { if ((d & 0x07) != 1) {
snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
return -EIO; return -EIO;
} }
......
...@@ -64,8 +64,6 @@ struct snd_gusmax { ...@@ -64,8 +64,6 @@ struct snd_gusmax {
unsigned short pcm_status_reg; unsigned short pcm_status_reg;
}; };
#define PFX "gusmax: "
static int snd_gusmax_detect(struct snd_gus_card *gus) static int snd_gusmax_detect(struct snd_gus_card *gus)
{ {
unsigned char d; unsigned char d;
...@@ -73,7 +71,7 @@ static int snd_gusmax_detect(struct snd_gus_card *gus) ...@@ -73,7 +71,7 @@ static int snd_gusmax_detect(struct snd_gus_card *gus)
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 0) { if ((d & 0x07) != 0) {
snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
udelay(160); udelay(160);
...@@ -81,7 +79,7 @@ static int snd_gusmax_detect(struct snd_gus_card *gus) ...@@ -81,7 +79,7 @@ static int snd_gusmax_detect(struct snd_gus_card *gus)
udelay(160); udelay(160);
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 1) { if ((d & 0x07) != 1) {
snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
...@@ -206,7 +204,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) ...@@ -206,7 +204,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
if (xirq == SNDRV_AUTO_IRQ) { if (xirq == SNDRV_AUTO_IRQ) {
xirq = snd_legacy_find_free_irq(possible_irqs); xirq = snd_legacy_find_free_irq(possible_irqs);
if (xirq < 0) { if (xirq < 0) {
snd_printk(KERN_ERR PFX "unable to find a free IRQ\n"); dev_err(pdev, "unable to find a free IRQ\n");
return -EBUSY; return -EBUSY;
} }
} }
...@@ -214,7 +212,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) ...@@ -214,7 +212,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
if (xdma1 == SNDRV_AUTO_DMA) { if (xdma1 == SNDRV_AUTO_DMA) {
xdma1 = snd_legacy_find_free_dma(possible_dmas); xdma1 = snd_legacy_find_free_dma(possible_dmas);
if (xdma1 < 0) { if (xdma1 < 0) {
snd_printk(KERN_ERR PFX "unable to find a free DMA1\n"); dev_err(pdev, "unable to find a free DMA1\n");
return -EBUSY; return -EBUSY;
} }
} }
...@@ -222,7 +220,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) ...@@ -222,7 +220,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
if (xdma2 == SNDRV_AUTO_DMA) { if (xdma2 == SNDRV_AUTO_DMA) {
xdma2 = snd_legacy_find_free_dma(possible_dmas); xdma2 = snd_legacy_find_free_dma(possible_dmas);
if (xdma2 < 0) { if (xdma2 < 0) {
snd_printk(KERN_ERR PFX "unable to find a free DMA2\n"); dev_err(pdev, "unable to find a free DMA2\n");
return -EBUSY; return -EBUSY;
} }
} }
...@@ -267,13 +265,13 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) ...@@ -267,13 +265,13 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
return err; return err;
if (!gus->max_flag) { if (!gus->max_flag) {
snd_printk(KERN_ERR PFX "GUS MAX soundcard was not detected at 0x%lx\n", gus->gf1.port); dev_err(pdev, "GUS MAX soundcard was not detected at 0x%lx\n", gus->gf1.port);
return -ENODEV; return -ENODEV;
} }
if (devm_request_irq(card->dev, xirq, snd_gusmax_interrupt, 0, if (devm_request_irq(card->dev, xirq, snd_gusmax_interrupt, 0,
"GUS MAX", (void *)maxcard)) { "GUS MAX", (void *)maxcard)) {
snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq); dev_err(pdev, "unable to grab IRQ %d\n", xirq);
return -EBUSY; return -EBUSY;
} }
maxcard->irq = xirq; maxcard->irq = xirq;
......
...@@ -52,11 +52,9 @@ static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; ...@@ -52,11 +52,9 @@ static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
static int effect[SNDRV_CARDS]; static int effect[SNDRV_CARDS];
#ifdef SNDRV_STB #ifdef SNDRV_STB
#define PFX "interwave-stb: "
#define INTERWAVE_DRIVER "snd_interwave_stb" #define INTERWAVE_DRIVER "snd_interwave_stb"
#define INTERWAVE_PNP_DRIVER "interwave-stb" #define INTERWAVE_PNP_DRIVER "interwave-stb"
#else #else
#define PFX "interwave: "
#define INTERWAVE_DRIVER "snd_interwave" #define INTERWAVE_DRIVER "snd_interwave"
#define INTERWAVE_PNP_DRIVER "interwave" #define INTERWAVE_PNP_DRIVER "interwave"
#endif #endif
...@@ -148,7 +146,7 @@ static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl, int da ...@@ -148,7 +146,7 @@ static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl, int da
unsigned long port = bus->private_value; unsigned long port = bus->private_value;
#if 0 #if 0
printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); dev_dbg(bus->card->dev, "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
#endif #endif
outb((data << 1) | ctrl, port); outb((data << 1) | ctrl, port);
udelay(10); udelay(10);
...@@ -161,7 +159,7 @@ static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus) ...@@ -161,7 +159,7 @@ static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus)
res = inb(port) & 1; res = inb(port) & 1;
#if 0 #if 0
printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res); dev_dbg(bus->card->dev, "i2c_getclockline - 0x%lx -> %i\n", port, res);
#endif #endif
return res; return res;
} }
...@@ -175,7 +173,7 @@ static int snd_interwave_i2c_getdataline(struct snd_i2c_bus *bus, int ack) ...@@ -175,7 +173,7 @@ static int snd_interwave_i2c_getdataline(struct snd_i2c_bus *bus, int ack)
udelay(10); udelay(10);
res = (inb(port) & 2) >> 1; res = (inb(port) & 2) >> 1;
#if 0 #if 0
printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res); dev_dbg(bus->card->dev, "i2c_getdataline - 0x%lx -> %i\n", port, res);
#endif #endif
return res; return res;
} }
...@@ -215,7 +213,7 @@ static int snd_interwave_detect_stb(struct snd_interwave *iwcard, ...@@ -215,7 +213,7 @@ static int snd_interwave_detect_stb(struct snd_interwave *iwcard,
"InterWave (I2C bus)"); "InterWave (I2C bus)");
} }
if (iwcard->i2c_res == NULL) { if (iwcard->i2c_res == NULL) {
snd_printk(KERN_ERR "interwave: can't grab i2c bus port\n"); dev_err(card->dev, "interwave: can't grab i2c bus port\n");
return -ENODEV; return -ENODEV;
} }
...@@ -248,7 +246,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard, ...@@ -248,7 +246,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard,
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 0) { if ((d & 0x07) != 0) {
snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
udelay(160); udelay(160);
...@@ -256,7 +254,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard, ...@@ -256,7 +254,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard,
udelay(160); udelay(160);
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET);
if ((d & 0x07) != 1) { if ((d & 0x07) != 1) {
snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
return -ENODEV; return -ENODEV;
} }
spin_lock_irqsave(&gus->reg_lock, flags); spin_lock_irqsave(&gus->reg_lock, flags);
...@@ -265,10 +263,13 @@ static int snd_interwave_detect(struct snd_interwave *iwcard, ...@@ -265,10 +263,13 @@ static int snd_interwave_detect(struct snd_interwave *iwcard,
rev2 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); rev2 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER);
snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, rev1); snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, rev1);
spin_unlock_irqrestore(&gus->reg_lock, flags); spin_unlock_irqrestore(&gus->reg_lock, flags);
snd_printdd("[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", gus->gf1.port, rev1, rev2); dev_dbg(gus->card->dev,
"[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n",
gus->gf1.port, rev1, rev2);
if ((rev1 & 0xf0) == (rev2 & 0xf0) && if ((rev1 & 0xf0) == (rev2 & 0xf0) &&
(rev1 & 0x0f) != (rev2 & 0x0f)) { (rev1 & 0x0f) != (rev2 & 0x0f)) {
snd_printdd("[0x%lx] InterWave check - passed\n", gus->gf1.port); dev_dbg(gus->card->dev,
"[0x%lx] InterWave check - passed\n", gus->gf1.port);
gus->interwave = 1; gus->interwave = 1;
strcpy(gus->card->shortname, "AMD InterWave"); strcpy(gus->card->shortname, "AMD InterWave");
gus->revision = rev1 >> 4; gus->revision = rev1 >> 4;
...@@ -278,7 +279,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard, ...@@ -278,7 +279,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard,
return snd_interwave_detect_stb(iwcard, gus, dev, rbus); return snd_interwave_detect_stb(iwcard, gus, dev, rbus);
#endif #endif
} }
snd_printdd("[0x%lx] InterWave check - failed\n", gus->gf1.port); dev_dbg(gus->card->dev, "[0x%lx] InterWave check - failed\n", gus->gf1.port);
return -ENODEV; return -ENODEV;
} }
...@@ -327,7 +328,7 @@ static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes) ...@@ -327,7 +328,7 @@ static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes)
snd_gf1_poke(gus, local, d); snd_gf1_poke(gus, local, d);
snd_gf1_poke(gus, local + 1, d + 1); snd_gf1_poke(gus, local + 1, d + 1);
#if 0 #if 0
printk(KERN_DEBUG "d = 0x%x, local = 0x%x, " dev_dbg(gus->card->dev, "d = 0x%x, local = 0x%x, "
"local + 1 = 0x%x, idx << 22 = 0x%x\n", "local + 1 = 0x%x, idx << 22 = 0x%x\n",
d, d,
snd_gf1_peek(gus, local), snd_gf1_peek(gus, local),
...@@ -342,7 +343,7 @@ static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes) ...@@ -342,7 +343,7 @@ static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes)
} }
} }
#if 0 #if 0
printk(KERN_DEBUG "sizes: %i %i %i %i\n", dev_dbg(gus->card->dev, "sizes: %i %i %i %i\n",
sizes[0], sizes[1], sizes[2], sizes[3]); sizes[0], sizes[1], sizes[2], sizes[3]);
#endif #endif
} }
...@@ -397,12 +398,12 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus) ...@@ -397,12 +398,12 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus)
lmct = (psizes[3] << 24) | (psizes[2] << 16) | lmct = (psizes[3] << 24) | (psizes[2] << 16) |
(psizes[1] << 8) | psizes[0]; (psizes[1] << 8) | psizes[0];
#if 0 #if 0
printk(KERN_DEBUG "lmct = 0x%08x\n", lmct); dev_dbg(gus->card->dev, "lmct = 0x%08x\n", lmct);
#endif #endif
for (i = 0; i < ARRAY_SIZE(lmc); i++) for (i = 0; i < ARRAY_SIZE(lmc); i++)
if (lmct == lmc[i]) { if (lmct == lmc[i]) {
#if 0 #if 0
printk(KERN_DEBUG "found !!! %i\n", i); dev_dbg(gus->card->dev, "found !!! %i\n", i);
#endif #endif
snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i); snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i);
snd_interwave_bank_sizes(gus, psizes); snd_interwave_bank_sizes(gus, psizes);
...@@ -566,12 +567,12 @@ static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard, ...@@ -566,12 +567,12 @@ static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard,
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR "InterWave PnP configure failure (out of resources?)\n"); dev_err(&pdev->dev, "InterWave PnP configure failure (out of resources?)\n");
return err; return err;
} }
if (pnp_port_start(pdev, 0) + 0x100 != pnp_port_start(pdev, 1) || if (pnp_port_start(pdev, 0) + 0x100 != pnp_port_start(pdev, 1) ||
pnp_port_start(pdev, 0) + 0x10c != pnp_port_start(pdev, 2)) { pnp_port_start(pdev, 0) + 0x10c != pnp_port_start(pdev, 2)) {
snd_printk(KERN_ERR "PnP configure failure (wrong ports)\n"); dev_err(&pdev->dev, "PnP configure failure (wrong ports)\n");
return -ENOENT; return -ENOENT;
} }
port[dev] = pnp_port_start(pdev, 0); port[dev] = pnp_port_start(pdev, 0);
...@@ -579,22 +580,26 @@ static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard, ...@@ -579,22 +580,26 @@ static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard,
if (dma2[dev] >= 0) if (dma2[dev] >= 0)
dma2[dev] = pnp_dma(pdev, 1); dma2[dev] = pnp_dma(pdev, 1);
irq[dev] = pnp_irq(pdev, 0); irq[dev] = pnp_irq(pdev, 0);
snd_printdd("isapnp IW: sb port=0x%llx, gf1 port=0x%llx, codec port=0x%llx\n", dev_dbg(&pdev->dev,
"isapnp IW: sb port=0x%llx, gf1 port=0x%llx, codec port=0x%llx\n",
(unsigned long long)pnp_port_start(pdev, 0), (unsigned long long)pnp_port_start(pdev, 0),
(unsigned long long)pnp_port_start(pdev, 1), (unsigned long long)pnp_port_start(pdev, 1),
(unsigned long long)pnp_port_start(pdev, 2)); (unsigned long long)pnp_port_start(pdev, 2));
snd_printdd("isapnp IW: dma1=%i, dma2=%i, irq=%i\n", dma1[dev], dma2[dev], irq[dev]); dev_dbg(&pdev->dev,
"isapnp IW: dma1=%i, dma2=%i, irq=%i\n",
dma1[dev], dma2[dev], irq[dev]);
#ifdef SNDRV_STB #ifdef SNDRV_STB
/* Tone Control initialization */ /* Tone Control initialization */
pdev = iwcard->devtc; pdev = iwcard->devtc;
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR "InterWave ToneControl PnP configure failure (out of resources?)\n"); dev_err(&pdev->dev,
"InterWave ToneControl PnP configure failure (out of resources?)\n");
return err; return err;
} }
port_tc[dev] = pnp_port_start(pdev, 0); port_tc[dev] = pnp_port_start(pdev, 0);
snd_printdd("isapnp IW: tone control port=0x%lx\n", port_tc[dev]); dev_dbg(&pdev->dev, "isapnp IW: tone control port=0x%lx\n", port_tc[dev]);
#endif #endif
return 0; return 0;
} }
...@@ -660,7 +665,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev, ...@@ -660,7 +665,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev,
if (devm_request_irq(card->dev, xirq, snd_interwave_interrupt, 0, if (devm_request_irq(card->dev, xirq, snd_interwave_interrupt, 0,
"InterWave", iwcard)) { "InterWave", iwcard)) {
snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq); dev_err(card->dev, "unable to grab IRQ %d\n", xirq);
return -EBUSY; return -EBUSY;
} }
iwcard->irq = xirq; iwcard->irq = xirq;
...@@ -780,21 +785,21 @@ static int snd_interwave_isa_probe(struct device *pdev, ...@@ -780,21 +785,21 @@ static int snd_interwave_isa_probe(struct device *pdev,
if (irq[dev] == SNDRV_AUTO_IRQ) { if (irq[dev] == SNDRV_AUTO_IRQ) {
irq[dev] = snd_legacy_find_free_irq(possible_irqs); irq[dev] = snd_legacy_find_free_irq(possible_irqs);
if (irq[dev] < 0) { if (irq[dev] < 0) {
snd_printk(KERN_ERR PFX "unable to find a free IRQ\n"); dev_err(pdev, "unable to find a free IRQ\n");
return -EBUSY; return -EBUSY;
} }
} }
if (dma1[dev] == SNDRV_AUTO_DMA) { if (dma1[dev] == SNDRV_AUTO_DMA) {
dma1[dev] = snd_legacy_find_free_dma(possible_dmas); dma1[dev] = snd_legacy_find_free_dma(possible_dmas);
if (dma1[dev] < 0) { if (dma1[dev] < 0) {
snd_printk(KERN_ERR PFX "unable to find a free DMA1\n"); dev_err(pdev, "unable to find a free DMA1\n");
return -EBUSY; return -EBUSY;
} }
} }
if (dma2[dev] == SNDRV_AUTO_DMA) { if (dma2[dev] == SNDRV_AUTO_DMA) {
dma2[dev] = snd_legacy_find_free_dma(possible_dmas); dma2[dev] = snd_legacy_find_free_dma(possible_dmas);
if (dma2[dev] < 0) { if (dma2[dev] < 0) {
snd_printk(KERN_ERR PFX "unable to find a free DMA2\n"); dev_err(pdev, "unable to find a free DMA2\n");
return -EBUSY; return -EBUSY;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment