]> err.no Git - linux-2.6/blobdiff - drivers/media/video/bttv-driver.c
[PATCH] v4l: 797: more intellect on clearing in bits on irq lock
[linux-2.6] / drivers / media / video / bttv-driver.c
index d538a994ff04da1d68bcfe9ddc5023671c53d1a8..058b923b4b1360bc3278189d9316b5fcfe561d99 100644 (file)
@@ -964,7 +964,7 @@ i2c_vidiocschan(struct bttv *btv)
        c.norm    = btv->tvnorm;
        c.channel = btv->input;
        bttv_call_i2c_clients(btv,VIDIOCSCHAN,&c);
-       if (btv->c.type == BTTV_VOODOOTV_FM)
+       if (btv->c.type == BTTV_BOARD_VOODOOTV_FM)
                bttv_tda9880_setnorm(btv,c.norm);
 }
 
@@ -988,7 +988,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
        bt848A_set_timing(btv);
 
        switch (btv->c.type) {
-       case BTTV_VOODOOTV_FM:
+       case BTTV_BOARD_VOODOOTV_FM:
                bttv_tda9880_setnorm(btv,norm);
                break;
        }
@@ -3736,10 +3736,22 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
 
                count++;
                if (count > 4) {
-                       btwrite(0, BT848_INT_MASK);
-                       printk(KERN_ERR
-                              "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr);
+
+                       if (count > 8 || !(astat & BT848_INT_GPINT)) {
+                               btwrite(0, BT848_INT_MASK);
+
+                               printk(KERN_ERR
+                                          "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr);
+                       } else {
+                               printk(KERN_ERR
+                                          "bttv%d: IRQ lockup, clearing GPINT from int mask [", btv->c.nr);
+
+                               btwrite(btread(BT848_INT_MASK) & (-1 ^ BT848_INT_GPINT),
+                                               BT848_INT_MASK);
+                       };
+
                        bttv_print_irqbits(stat,astat);
+
                        printk("]\n");
                }
        }
@@ -3889,18 +3901,17 @@ static int __devinit bttv_probe(struct pci_dev *dev,
        btv->timeout.function = bttv_irq_timeout;
        btv->timeout.data     = (unsigned long)btv;
 
-        btv->i2c_rc = -1;
-        btv->tuner_type  = UNSET;
-        btv->pinnacle_id = UNSET;
+       btv->i2c_rc = -1;
+       btv->tuner_type  = UNSET;
+       btv->pinnacle_id = UNSET;
        btv->new_input   = UNSET;
-       btv->gpioirq     = 1;
        btv->has_radio=radio[btv->c.nr];
 
        /* pci stuff (init, get irq/mmio, ... */
        btv->c.pci = dev;
-        btv->id  = dev->device;
+       btv->id  = dev->device;
        if (pci_enable_device(dev)) {
-                printk(KERN_WARNING "bttv%d: Can't enable device.\n",
+               printk(KERN_WARNING "bttv%d: Can't enable device.\n",
                       btv->c.nr);
                return -EIO;
        }