static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs){	u32 stat,astat;	u32 dstat;	int count;	struct bttv *btv;	int handled = 0;	btv=(struct bttv *)dev_id;	count=0;	while (1) {		/* get/clear interrupt status bits */		stat=btread(BT848_INT_STAT);		astat=stat&btread(BT848_INT_MASK);		if (!astat)			break;		handled = 1;		btwrite(stat,BT848_INT_STAT);		/* get device status bits */		dstat=btread(BT848_DSTATUS);		if (irq_debug) {			printk(KERN_DEBUG "bttv%d: irq loop=%d fc=%d "			       "riscs=%x, riscc=%08x, ",			       btv->c.nr, count, btv->field_count,			       stat>>28, btread(BT848_RISC_COUNT));			bttv_print_irqbits(stat,astat);			if (stat & BT848_INT_HLOCK)				printk("   HLOC => %s", (dstat & BT848_DSTATUS_HLOC)				       ? "yes" : "no");			if (stat & BT848_INT_VPRES)				printk("   PRES => %s", (dstat & BT848_DSTATUS_PRES)				       ? "yes" : "no");			if (stat & BT848_INT_FMTCHG)				printk("   NUML => %s", (dstat & BT848_DSTATUS_NUML)				       ? "625" : "525");			printk("\n");		}		if (astat&BT848_INT_VSYNC)                        btv->field_count++;		if (astat & BT848_INT_GPINT) {			wake_up(&btv->gpioq);			bttv_gpio_irq(&btv->c);		}		if (astat & BT848_INT_I2CDONE) {			btv->i2c_done = stat;			wake_up(&btv->i2c_queue);		}                if ((astat & BT848_INT_RISCI)  &&  (stat & (4<<28)))			bttv_irq_switch_vbi(btv);                if ((astat & BT848_INT_RISCI)  &&  (stat & (2<<28)))			bttv_irq_wakeup_top(btv);                if ((astat & BT848_INT_RISCI)  &&  (stat & (1<<28)))			bttv_irq_switch_video(btv);		if ((astat & BT848_INT_HLOCK)  &&  btv->opt_automute)			audio_mux(btv, -1);		if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) {			printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->c.nr,			       (astat & BT848_INT_SCERR) ? "SCERR" : "",			       (astat & BT848_INT_OCERR) ? "OCERR" : "",			       btread(BT848_RISC_COUNT));			bttv_print_irqbits(stat,astat);			printk("\n");			if (bttv_debug)				bttv_print_riscaddr(btv);		}		if (fdsr && astat & BT848_INT_FDSR) {			printk(KERN_INFO "bttv%d: FDSR @ %08x\n",			       btv->c.nr,btread(BT848_RISC_COUNT));			if (bttv_debug)				bttv_print_riscaddr(btv);		}		count++;		if (count > 4) {			btwrite(0, BT848_INT_MASK);			printk(KERN_ERR			       "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr);			bttv_print_irqbits(stat,astat);			printk("]\n");		}	}	btv->irq_total++;	if (handled)		btv->irq_me++;	return IRQ_RETVAL(handled);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c58c21c7a2ef7d1eb45231d5c1bb24d88a9666b8/bttv-driver.c/clean/drivers/media/video/bttv-driver.c