-diff -u --recursive --new-file linux/drivers/char/Config.in linux-irctl/drivers/char/Config.in
+diff -u --recursive linux/drivers/char/Config.in linux-irctl/drivers/char/Config.in
 --- linux/drivers/char/Config.in	Fri May  7 20:05:30 1999
 +++ linux-irctl/drivers/char/Config.in	Mon Jul 26 22:14:40 1999
 @@ -132,6 +132,9 @@

 	make_vbitab(btv);
 	bt848_set_risc_jmps(btv);
   
@@ -3336,6 +3370,18 @@
 		/* get device status bits */
 		dstat=btread(BT848_DSTATUS);
     
+#ifdef BTTV_GPIOMON
+                if ( (astat&BT848_INT_GPINT) )
+        	{
+            		unsigned long b;
+                    
+                	b=btread(BT848_GPIO_DATA);
+                	IDEBUG(printk("bttv%d: GPIO: %04lx INT_STAT: %04lx \n", 
+                    		btv->nr, b&0x1ff, (long)stat));
+            		(gpio_monitor) ? gpio_monitor(btv->nr, b) : 0;
+			return;
+		}
+#endif
 		if (astat&BT848_INT_FMTCHG) 
 		{
 			IDEBUG(printk ("bttv%d: IRQ_FMTCHG\n", btv->nr));
@@ -3840,9 +3886,58 @@
 	}
 }
 
-#ifdef MODULE
+#ifdef BTTV_GPIOMON
+#if LINUX_VERSION_CODE >= 0x020100
+EXPORT_SYMBOL(bttv_set_gpio_monitor);
+#endif
+
+static void setup_gpio_irq(int nr)
+{
+	/* Set up GPIOINT mask */
+	struct bttv *btv;                                                       
+  
+	btv = &bttvs[nr];
+	printk("bttv%d: setup_gpio_irq\n",nr);
+	if(btv == NULL) {                                                       
+		printk("bttv%d: setup_gpio_irq: *btv == NULL\n",nr);
+		return;                                                         
+	};
+    
+    /**/
+	btwrite(btread(BT848_GPIO_DMA_CTL)
+    	    |BT848_GPIO_DMA_CTL_GPINTC
+    	    ,BT848_GPIO_DMA_CTL);
+	btwrite(btread(BT848_GPIO_DMA_CTL)
+	    |BT848_GPIO_DMA_CTL_GPINTI
+	    ,BT848_GPIO_DMA_CTL);
+	  
+	btwrite(btread(BT848_INT_STAT)|BT848_INT_GPINT,BT848_INT_STAT);
+	btwrite(btread(BT848_INT_MASK)|BT848_INT_GPINT,BT848_INT_MASK);
+    /**/
+
+};
+
+static void reset_gpio_irq(int nr)
+{
+  /* Reset GPIOINT mask */
+  struct bttv *btv;                                                       
+  
+  btv = &bttvs[nr];
+  if(btv == NULL) {                                                       
+    printk("bttv%d: reset_gpio_irq: *btv == NULL\n",nr);
+    return;                                                         
+  };
+  btwrite(btread(BT848_INT_MASK)&(~BT848_INT_GPINT)
+          ,BT848_INT_MASK);
+};
 
+#else
 EXPORT_NO_SYMBOLS;
+#endif

 
 int init_module(void)
 {
diff -u --recursive linux/drivers/char/bttv.h linux-irctl/drivers/char/bttv.h
--- linux/drivers/char/bttv.h	Tue Jun  8 01:18:17 1999
+++ linux-irctl/drivers/char/bttv.h	Sun Aug  1 11:12:10 1999
@@ -164,6 +165,11 @@
 	int i2c_command;
 	int triton1;
 };
