]> 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 c062a017491e4bb08bf8c853d265b349ed464c59..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;
        }
@@ -1951,8 +1951,7 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv,
        }
 
        down(&fh->cap.lock);
-       if (fh->ov.clips)
-               kfree(fh->ov.clips);
+       kfree(fh->ov.clips);
        fh->ov.clips    = clips;
        fh->ov.nclips   = n;
 
@@ -2723,8 +2722,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                        fh->ov.w.height = fb->fmt.height;
                        btv->init.ov.w.width  = fb->fmt.width;
                        btv->init.ov.w.height = fb->fmt.height;
-                       if (fh->ov.clips)
-                               kfree(fh->ov.clips);
+                       kfree(fh->ov.clips);
                        fh->ov.clips = NULL;
                        fh->ov.nclips = 0;
 
@@ -3738,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");
                }
        }
@@ -3891,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;
        }