openvortex-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openvortex-dev] [Fwd: [PATCH] printk KERN_xxx]


From: Manuel Jander
Subject: [Openvortex-dev] [Fwd: [PATCH] printk KERN_xxx]
Date: Tue, 13 May 2003 23:28:52 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030430 Debian/1.3-5

Hi All OpenVortex devs,

I received this, but i'm 100% busy with Numerical Analisis for know
and i dont have a AU8810 either, so please could someone check this,
ask for more info etc ???

I would suggest using a macro instead for the printk stuff...

Thanks.

-------- Original Message --------
Subject:        [PATCH] printk KERN_xxx
Date:   Tue, 13 May 2003 13:48:35 +0200
From:   Philipp Matthias Hahn <address@hidden>
Organization:   UUCP-Freunde Lahn e.V.
To:     Manuel Jander <address@hidden>



Hi!

First of all, thank you for the work, ALSA kind of works with my au8810
in my notebook. The problem is: After some time I head noise, which gets
worse. If I'm luck, it cures itself after some time, but usually I gets
noisy again later.

Here's a patch you might want to commit to CVS. It adds the missing
KERN_xxx classifiers to prink() calls.

--- alsa/pci/au88x0/au88x0.c    5 May 2003 05:52:37 -0000       1.12
+++ alsa/pci/au88x0/au88x0.c    13 May 2003 11:43:30 -0000
@@ -287,7 +287,7 @@
        // Free Vortex struct.
        pci_set_drvdata(pci, NULL);
    } else
-        printk("snd_vortex_remove called more than one time!\n");
+        printk(KERN_ERR "snd_vortex_remove called more than one time!\n");
}

// pci_driver definition
--- alsa/pci/au88x0/au88x0_core.c       13 May 2003 02:39:28 -0000      1.11
+++ alsa/pci/au88x0/au88x0_core.c       13 May 2003 11:43:30 -0000
@@ -195,9 +195,9 @@
    while (temp & 0x10) {
            prev = VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2);
            temp = hwread(vortex->mmio, prev);
-               //printk("vortex: mixAddWTD: while addr=%x, val=%x\n", prev, 
temp);
+               //printk(KERN_DEBUG "vortex: mixAddWTD: while addr=%x, 
val=%x\n", prev, temp);
            if ((++lifeboat) > 0xf) {
-           printk("vortex_mixer_addWTD: lifeboat overflow\n");
+           printk(KERN_ERR "vortex_mixer_addWTD: lifeboat overflow\n");
                return 0;
            }
    }
@@ -212,7 +212,7 @@

    eax = hwread(vortex->mmio, VORTEX_MIXER_SR);
    if (((1 << ch) & eax) == 0) {
-               printk("mix ALARM %x\n", eax);
+               printk(KERN_INFO "mix ALARM %x\n", eax);
                return 0;
        }
        ebp = VORTEX_MIXER_CHNBASE + (ch << 2);
@@ -228,17 +228,17 @@
                } else {
                        //7ad3
                        edx = hwread(vortex->mmio, VORTEX_MIXER_RTBASE + (ebx 
<< 2));
-                       //printk("vortex: mixdelWTD: 1 addr=%x, val=%x, 
src=%x\n", ebx, edx, src);
+                       //printk(KERN_DEBUG "vortex: mixdelWTD: 1 addr=%x, val=%x, 
src=%x\n", ebx, edx, src);
                        while ((edx & 0xf) != mix) {
                                if ((esi) > 0xf) {
-                                       printk("vortex: mixdelWTD: error lifeboat 
overflow\n");
+                                       printk(KERN_ERR "vortex: mixdelWTD: error 
lifeboat overflow\n");
                                        return 0;
                                }
                                esp14 = ebx;
                                ebx = edx & 0xf;
                                ebp = ebx << 2;
                                edx = hwread(vortex->mmio, VORTEX_MIXER_RTBASE 
+ ebp);
-                               //printk("vortex: mixdelWTD: while addr=%x, 
val=%x\n", ebp, edx);
+                               //printk(KERN_DEBUG "vortex: mixdelWTD: while 
addr=%x, val=%x\n", ebp, edx);
                                esi++;
                        }
                        //7b30
@@ -249,7 +249,7 @@
                                //7b60
                                hwwrite(vortex->mmio, VORTEX_MIXER_RTBASE + 
ebp, edx);
                                hwwrite(vortex->mmio, ebx, 0);
-                               //printk("vortex mixdelWTD between addr= 0x%x, val= 
0x%x\n", ebp, edx);
+                               //printk(KERN_DEBUG "vortex mixdelWTD between addr= 
0x%x, val= 0x%x\n", ebp, edx);
                        } else {                        /* Delete last entry */
                                //7b83
                                if (esp14 == -1)
@@ -257,14 +257,14 @@
                                else {
                                        ebx = (0xffffffe0 & edx) | (0xf & ebx);
                                        hwwrite(vortex->mmio, VORTEX_MIXER_RTBASE + 
(esp14 << 2), ebx);
-                                       //printk("vortex mixdelWTD last addr= 0x%x, 
val= 0x%x\n", esp14, ebx);
+                                       //printk(KERN_DEBUG "vortex mixdelWTD last 
addr= 0x%x, val= 0x%x\n", esp14, ebx);
                                }
                                hwwrite(vortex->mmio, VORTEX_MIXER_RTBASE + 
ebp, 0);
                                return 1;
                        }
            }
    } else {
-               printk("removed last mix\n");
+               printk(KERN_NOTICE "removed last mix\n");
                //7be0
                vortex_mixer_dis_sr(vortex, ch);
                hwwrite(vortex->mmio, ebp, 0);
@@ -498,7 +498,7 @@
    hwwrite(card->mmio, VORTEX_SRC_U1 + (src << 2), b & 0xffff);
    hwwrite(card->mmio, VORTEX_SRC_U3 + (src << 2), (g << 0x11) | (e << 0x10) | (ebp 
<< 0x8) | esp10);

-       //printk("vortex: SRC %d, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, esi, 
esp10, ebp);
+       //printk(KERN_DEBUG "vortex: SRC %d, esi=0x%x, esp10=0x%x, ebp=0x%x\n", 
src, esi, esp10, ebp);
}

void vortex_srcblock_init(vortex_t *vortex) {
@@ -543,9 +543,9 @@
            prev = VORTEX_SRC_RTBASE + ((temp & 0xf) << 2); /*esp12*/
                //prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); 
/*esp12*/
            temp = hwread(vortex->mmio, prev);
-               //printk("vortex: srcAddWTD: while addr=%x, val=%x\n", prev, 
temp);
+               //printk(KERN_DEBUG "vortex: srcAddWTD: while addr=%x, 
val=%x\n", prev, temp);
            if ((++lifeboat) > 0xf) {
-           printk("vortex_src_addWTD: lifeboat overflow\n");
+           printk(KERN_ERR "vortex_src_addWTD: lifeboat overflow\n");
                return 0;
            }
    }
@@ -561,7 +561,7 @@

    eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
    if (((1 << ch) & eax) == 0) {
-               printk("src alarm\n");
+               printk(KERN_DEBUG "src alarm\n");
                return 0;
        }
        ebp = VORTEX_SRC_CHNBASE + (ch << 2);
@@ -577,17 +577,17 @@
                } else {
                        //7ad3
                        edx = hwread(vortex->mmio, VORTEX_SRC_RTBASE + (ebx << 
2));
-                       //printk("vortex: srcdelWTD: 1 addr=%x, val=%x, 
src=%x\n", ebx, edx, src);
+                       //printk(KERN_DEBUG "vortex: srcdelWTD: 1 addr=%x, val=%x, 
src=%x\n", ebx, edx, src);
                        while ((edx & 0xf) != src) {
                                if ((esi) > 0xf) {
-                                       printk("vortex: srcdelWTD: error, lifeboat 
overflow\n");
+                                       printk(KERN_ERR "vortex: srcdelWTD: error, 
lifeboat overflow\n");
                                        return 0;
                                }
                                esp14 = ebx;
                                ebx = edx & 0xf;
                                ebp = ebx << 2;
                                edx = hwread(vortex->mmio, VORTEX_SRC_RTBASE + 
ebp);
-                               //printk("vortex: srcdelWTD: while addr=%x, 
val=%x\n", ebp, edx);
+                               //printk(KERN_DEBUG "vortex: srcdelWTD: while 
addr=%x, val=%x\n", ebp, edx);
                                esi++;
                        }
                        //7b30
@@ -598,7 +598,7 @@
                                //7b60
                                hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + ebp, 
edx);
                                hwwrite(vortex->mmio, ebx, 0);
-                               //printk("vortex srcdelWTD between addr= 0x%x, val= 
0x%x\n", ebp, edx);
+                               //printk(KERN_DEBUG "vortex srcdelWTD between addr= 
0x%x, val= 0x%x\n", ebp, edx);
                        } else {                        /* Delete last entry */
                                //7b83
                                if (esp14 == -1)
@@ -606,7 +606,7 @@
                                else {
                                        ebx = (0xffffffe0 & edx) | (0xf & ebx);
                                        hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + 
(esp14 << 2), ebx);
-                                       //printk("vortex srcdelWTD last addr= 0x%x, 
val= 0x%x\n", esp14, ebx);
+                                       //printk(KERN_DEBUG "vortex srcdelWTD last 
addr= 0x%x, val= 0x%x\n", esp14, ebx);
                                }
                                hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + ebp, 
0);
                                return 1;
@@ -643,7 +643,7 @@
    for (x = NR_ADB-1; x >= 0; x--) {
            hwwrite(vortex->mmio, addr, (FIFO_U0 | FIFO_U1));
            if (hwread(vortex->mmio, addr) != (FIFO_U0 | FIFO_U1))
-               printk("bad adb fifo reset!");
+               printk(KERN_WARNING "bad adb fifo reset!");
            vortex_fifo_clearadbdata(vortex, x, FIFO_SIZE);
            addr -= 4;
    }
@@ -652,7 +652,7 @@
    for (x = NR_WT-1; x >= 0; x--) {
            hwwrite(vortex->mmio, addr, FIFO_U0);
            if (hwread(vortex->mmio, addr) != FIFO_U0)
-           printk("bad wt fifo reset (0x%08lx, 0x%08x)!\n", addr, 
hwread(vortex->mmio, addr));
+           printk(KERN_WARNING "bad wt fifo reset (0x%08lx, 0x%08x)!\n", addr, 
hwread(vortex->mmio, addr));
            vortex_fifo_clearwtdata(vortex, x, FIFO_SIZE);
            addr -= 4;
    }
@@ -900,7 +900,7 @@
        if (dma->period_virt >= dma->nr_periods)
                dma->period_virt -= dma->nr_periods;
        if (delta != 1)
-               printk("vortex: % d virt=0x%d, real=0x%x, delta = %d\n", dma->dma, 
dma->period_virt, dma->period_real, delta);
+               printk(KERN_DEBUG "vortex: % d virt=0x%d, real=0x%x, delta = %d\n", 
dma->dma, dma->period_virt, dma->period_real, delta);
}

void vortex_adbdma_setctrl(vortex_t *vortex, int a, int b, int c, int d, int e, 
int f) {
@@ -1181,7 +1181,7 @@
        size--;
        dma->cfg0 |= (size << 0xc) | size;
        dma->cfg1 |= (size << 0xc) | size;
-       //printk("vortex: wt buffer cfg: 0x%8x  0x%8x\n", dma->cfg0, dma->cfg1);
+       //printk(KERN_DEBUG "vortex: wt buffer cfg: 0x%8x  0x%8x\n", dma->cfg0, 
dma->cfg1);
        hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG0 + (wtdma << 3), dma->cfg0);
        hwwrite(vortex->mmio, VORTEX_WTDMA_BUFCFG1 + (wtdma << 3), dma->cfg1);

@@ -1225,7 +1225,7 @@
        dma->period_real = page;

        if (delta != 1)
-               printk("vortex: wt page = %d, delta = %d\n", dma->period_virt, 
delta);
+               printk(KERN_DEBUG "vortex: wt page = %d, delta = %d\n", 
dma->period_virt, delta);
}

void vortex_wtdma_getposition(vortex_t *vortex, int wtdma, int *subbuf, int 
*pos) {
@@ -1430,7 +1430,7 @@
                prev = temp;
            temp = hwread(vortex->mmio, VORTEX_ADB_RTBASE + (temp << 2)) & 
ADB_MASK;
            if ((lifeboat++) > ADB_MASK) {
-               printk("vortex_adb_addroutes: unending route!\n");
+               printk(KERN_ERR "vortex_adb_addroutes: unending route!\n");
                return;
            }
    } while (temp != ADB_MASK);
@@ -1453,7 +1453,7 @@
            prev = temp;
            temp = hwread(vortex->mmio, VORTEX_ADB_RTBASE + (prev << 2)) & 
ADB_MASK;
            if (((lifeboat++) > ADB_MASK) || (temp == ADB_MASK)) {
-           printk("vortex_adb_delroutes: route not found!\n");
+           printk(KERN_ERR "vortex_adb_delroutes: route not found!\n");
                return;
            }
    } while (temp != (route0 & ADB_MASK));
@@ -1689,7 +1689,7 @@
        if (nr_ch == 0) {
                if (dma->nr_ch <= 0)
                        return -EBUSY;
-               printk("vortex: de alloc %d\n", adbdma);
+               printk(KERN_DEBUG "vortex: de alloc %d\n", adbdma);
                en = 0;
                nr_ch = dma->nr_ch;
                dma->nr_ch = -1;
@@ -1697,7 +1697,7 @@
        } else {
                if (dma->nr_ch > 0)
                        return -EBUSY;
-               printk("vortex: alloc %d\n", adbdma);
+               printk(KERN_DEBUG "vortex: alloc %d\n", adbdma);
                en = 1;
                dma->nr_ch = nr_ch;
                vortex_fifo_adbinitialize(vortex, adbdma, FIFO_SIZE-1);
@@ -1801,7 +1801,7 @@
        // Is at least one IRQ flag set?
        if (source == 0)
                return;
-       //printk("IRQ: 0x%x\n", source);
+       //printk(KERN_DEBUG "IRQ: 0x%x\n", source);

        // Attend every interrupt source.
        if (source & IRQ_FATAL)
@@ -1933,7 +1933,7 @@

int vortex_core_init(vortex_t *vortex) {

-       printk("Vortex: hardware init.... ");
+       printk(KERN_INFO "Vortex: hardware init.... ");
        /* Hardware Init. */
        hwwrite(vortex->mmio, VORTEX_CTRL, 0xffffffff);
    udelay(5000);
@@ -1972,7 +1972,7 @@

int vortex_core_shutdown(vortex_t *vortex) {

-    printk("Vortex: hardware shutdown...");
+    printk(KERN_INFO "Vortex: hardware shutdown...");

    vortex_disable_timer_int(vortex);
        vortex_disable_int(vortex);
@@ -2014,7 +2014,7 @@
        case SNDRV_PCM_FORMAT_S16_LE: fmt = 0x8;
            break;
        default: fmt = 0x8;
-            printk("vortex: format unsupported %d\n", alsafmt);
+            printk(KERN_WARNING "vortex: format unsupported %d\n", alsafmt);
            break;
    }
    return fmt;
--- alsa/pci/au88x0/au88x0_pcm.c        23 Apr 2003 02:15:53 -0000      1.3
+++ alsa/pci/au88x0/au88x0_pcm.c        13 May 2003 11:43:30 -0000
@@ -101,11 +101,11 @@
        // Alloc buffer memory.
        err = snd_pcm_lib_malloc_pages(substream, 
params_buffer_bytes(hw_params));
        if (err < 0) {
-               printk("Vortex: pcm page alloc failed!\n");
+               printk(KERN_ERR "Vortex: pcm page alloc failed!\n");
                return err;
        }

-       printk("Vortex: periods %d, period_bytes %d, channels = %d\n", 
params_periods(hw_params),
+       printk(KERN_DEBUG "Vortex: periods %d, period_bytes %d, channels = 
%d\n", params_periods(hw_params),
                params_period_bytes(hw_params), params_channels(hw_params));

        // Make audio routes and config buffer DMA.
@@ -181,7 +181,7 @@
    switch (cmd) {
    case SNDRV_PCM_TRIGGER_START:
        // do something to start the PCM engine
-        printk("vortex: start %d\n", dma->dma);
+        printk(KERN_DEBUG "vortex: start %d\n", dma->dma);
        if (substream->pcm == chip->pcm_adb) {
            dma->fifo_enabled = 1;
            vortex_adbdma_startfifo(chip, dma->dma);
@@ -192,7 +192,7 @@
        break;
    case SNDRV_PCM_TRIGGER_STOP:
        // do something to stop the PCM engine
-        printk("vortex: stop %d\n", dma->dma);
+        printk(KERN_DEBUG "vortex: stop %d\n", dma->dma);
        if (substream->pcm == chip->pcm_adb) {
            dma->fifo_enabled = 0;
            vortex_adbdma_stopfifo(chip, dma->dma);
@@ -231,7 +231,7 @@
        current_ptr = vortex_adbdma_getlinearpos(chip, dma->dma);
    else
        current_ptr = vortex_wtdma_getlinearpos(chip, dma->dma);
-    //printk("vortex: pointer = 0x%x\n", current_ptr);
+    //printk(KERN_DEBUG "vortex: pointer = 0x%x\n", current_ptr);
        spin_unlock(chip->lock);
    return (bytes_to_frames(substream->runtime, current_ptr));
}

BYtE
Philipp
--
 / /  (_)__  __ ____  __ Philipp Hahn
/ /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ address@hidden







reply via email to

[Prev in Thread] Current Thread [Next in Thread]