]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/emu10k1/irq.c
Merge branch 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6
[linux-2.6-omap-h63xx.git] / sound / pci / emu10k1 / irq.c
index a8b31286b6db773de31d7157f5df84683d0779b3..30bfed6f83398d5f9b17fdf776ce2ab6ebac7a4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *                   Creative Labs, Inc.
  *  Routines for IRQ control of EMU10K1 chips
  *
  *
  */
 
-#include <sound/driver.h>
 #include <linux/time.h>
 #include <sound/core.h>
 #include <sound/emu10k1.h>
 
-irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
 {
        struct snd_emu10k1 *emu = dev_id;
        unsigned int status, status2, orig_status, orig_status2;
        int handled = 0;
+       int timeout = 0;
 
-       while ((status = inl(emu->port + IPR)) != 0) {
-               //printk("emu10k1 irq - status = 0x%x\n", status);
+       while (((status = inl(emu->port + IPR)) != 0) && (timeout < 1000)) {
+               timeout++;
                orig_status = status;
                handled = 1;
+               if ((status & 0xffffffff) == 0xffffffff) {
+                       snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n");
+                       break;
+               }
                if (status & IPR_PCIERROR) {
                        snd_printk(KERN_ERR "interrupt: PCI error\n");
                        snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
@@ -197,5 +201,8 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                }
                outl(orig_status, emu->port + IPR); /* ack all */
        }
+       if (timeout == 1000)
+               snd_printk(KERN_INFO "emu10k1 irq routine failure\n");
+
        return IRQ_RETVAL(handled);
 }