Commit 7592eefc authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] saa7134-alsa: use pr_debug() instead of printk

On saa7134-alsa, there is just one printk macro that use a
different debug level.

It should be easy to enable/disable this one using dynamic_printk,
if one need to individually control it.

So, this module can easily use pr_debug() instead of using its
own macros.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent bea8630e
...@@ -32,10 +32,6 @@ ...@@ -32,10 +32,6 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages [alsa]");
/* /*
* Configuration macros * Configuration macros
*/ */
...@@ -57,11 +53,6 @@ module_param_array(enable, int, NULL, 0444); ...@@ -57,11 +53,6 @@ module_param_array(enable, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s)."); MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s).");
#define dprintk(fmt, arg...) if (debug) \
printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
/* /*
* Main chip structure * Main chip structure
*/ */
...@@ -149,11 +140,11 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, ...@@ -149,11 +140,11 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
spin_lock(&dev->slock); spin_lock(&dev->slock);
if (UNSET == dev->dmasound.dma_blk) { if (UNSET == dev->dmasound.dma_blk) {
dprintk("irq: recording stopped\n"); pr_debug("irq: recording stopped\n");
goto done; goto done;
} }
if (0 != (status & 0x0f000000)) if (0 != (status & 0x0f000000))
dprintk("irq: lost %ld\n", (status >> 24) & 0x0f); pr_debug("irq: lost %ld\n", (status >> 24) & 0x0f);
if (0 == (status & 0x10000000)) { if (0 == (status & 0x10000000)) {
/* odd */ /* odd */
if (0 == (dev->dmasound.dma_blk & 0x01)) if (0 == (dev->dmasound.dma_blk & 0x01))
...@@ -164,13 +155,13 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, ...@@ -164,13 +155,13 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
reg = SAA7134_RS_BA2(6); reg = SAA7134_RS_BA2(6);
} }
if (0 == reg) { if (0 == reg) {
dprintk("irq: field oops [%s]\n", pr_debug("irq: field oops [%s]\n",
(status & 0x10000000) ? "even" : "odd"); (status & 0x10000000) ? "even" : "odd");
goto done; goto done;
} }
if (dev->dmasound.read_count >= dev->dmasound.blksize * (dev->dmasound.blocks-2)) { if (dev->dmasound.read_count >= dev->dmasound.blksize * (dev->dmasound.blocks-2)) {
dprintk("irq: overrun [full=%d/%d] - Blocks in %d\n",dev->dmasound.read_count, pr_debug("irq: overrun [full=%d/%d] - Blocks in %d\n",dev->dmasound.read_count,
dev->dmasound.bufsize, dev->dmasound.blocks); dev->dmasound.bufsize, dev->dmasound.blocks);
spin_unlock(&dev->slock); spin_unlock(&dev->slock);
snd_pcm_stop_xrun(dev->dmasound.substream); snd_pcm_stop_xrun(dev->dmasound.substream);
...@@ -180,10 +171,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, ...@@ -180,10 +171,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
/* next block addr */ /* next block addr */
next_blk = (dev->dmasound.dma_blk + 2) % dev->dmasound.blocks; next_blk = (dev->dmasound.dma_blk + 2) % dev->dmasound.blocks;
saa_writel(reg,next_blk * dev->dmasound.blksize); saa_writel(reg,next_blk * dev->dmasound.blksize);
if (debug > 2) pr_debug("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n",
dprintk("irq: ok, %s, next_blk=%d, addr=%x, blocks=%u, size=%u, read=%u\n", (status & 0x10000000) ? "even" : "odd ", next_blk,
(status & 0x10000000) ? "even" : "odd ", next_blk, next_blk * dev->dmasound.blksize, dev->dmasound.blocks, dev->dmasound.blksize, dev->dmasound.read_count);
next_blk * dev->dmasound.blksize, dev->dmasound.blocks, dev->dmasound.blksize, dev->dmasound.read_count);
/* update status & wake waiting readers */ /* update status & wake waiting readers */
dev->dmasound.dma_blk = (dev->dmasound.dma_blk + 1) % dev->dmasound.blocks; dev->dmasound.dma_blk = (dev->dmasound.dma_blk + 1) % dev->dmasound.blocks;
...@@ -233,7 +223,7 @@ static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id) ...@@ -233,7 +223,7 @@ static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id)
} }
if (loop == 10) { if (loop == 10) {
dprintk("error! looping IRQ!"); pr_debug("error! looping IRQ!");
} }
out: out:
...@@ -281,11 +271,11 @@ static int saa7134_alsa_dma_init(struct saa7134_dev *dev, int nr_pages) ...@@ -281,11 +271,11 @@ static int saa7134_alsa_dma_init(struct saa7134_dev *dev, int nr_pages)
dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
if (NULL == dma->vaddr) { if (NULL == dma->vaddr) {
dprintk("vmalloc_32(%d pages) failed\n", nr_pages); pr_debug("vmalloc_32(%d pages) failed\n", nr_pages);
return -ENOMEM; return -ENOMEM;
} }
dprintk("vmalloc is at addr 0x%08lx, size=%d\n", pr_debug("vmalloc is at addr 0x%08lx, size=%d\n",
(unsigned long)dma->vaddr, (unsigned long)dma->vaddr,
nr_pages << PAGE_SHIFT); nr_pages << PAGE_SHIFT);
...@@ -572,7 +562,7 @@ static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream ...@@ -572,7 +562,7 @@ static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream
break; break;
} }
dprintk("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n", pr_debug("rec_start: afmt=%d ch=%d => fmt=0x%x swap=%c\n",
runtime->format, runtime->channels, fmt, runtime->format, runtime->channels, fmt,
bswap ? 'b' : '-'); bswap ? 'b' : '-');
/* dma: setup channel 6 (= AUDIO) */ /* dma: setup channel 6 (= AUDIO) */
......
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