  
  int init_module(void)
  {
-@@ -3864,6 +3959,12 @@
- 			release_bttv();
- 			return -EIO;
- 		} 
-+#ifdef BTTV_GPIOMON
-+                else 
-+		{
-+            		setup_gpio_irq(i);
-+                }
-+#endif
- 	}
- 
- 	return 0;
-@@ -3875,6 +3976,13 @@
- 
- void cleanup_module(void)
- {
-+#ifdef BTTV_GPIOMON
-+	{
-+              int i;
-+              for (i=0; i<bttv_num; i++) 
-+		    reset_gpio_irq(i);
-+	}
-+#endif
-         release_bttv();
- }
- 
-diff -u --recursive --new-file linux/drivers/char/bttv.h linux-irctl/drivers/char/bttv.h
+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	Mon Jul 26 23:44:53 1999
-@@ -22,6 +22,8 @@
- #define _BTTV_H_
- 
- #define BTTV_VERSION_CODE 0x000523
-+#define BTTV_GPIOMON 
-+#define VIDEODAT
- 
- #include <linux/types.h>
- #include <linux/wait.h>
-@@ -164,6 +166,11 @@
++++ linux-irctl/drivers/char/bttv.h	Sun Aug  1 11:12:10 1999
+@@ -164,6 +165,11 @@
  	int i2c_command;
  	int triton1;
  };

   if [ "$CONFIG_PARPORT" != "n" ]; then
     dep_tristate 'Quickcam BW Video For Linux' CONFIG_VIDEO_BWQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
     dep_tristate 'Colour QuickCam Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_CQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
diff -u --recursive --new-file linux/drivers/char/Makefile linux-irctl/drivers/char/Makefile
--- linux/drivers/char/Makefile	Fri May  7 20:05:30 1999
+++ linux-irctl/drivers/char/Makefile	Tue Jul 27 01:57:40 1999
@@ -317,6 +317,9 @@
   ifeq ($(CONFIG_VIDEO_BT848),m)
     M_OBJS += bttv.o msp3400.o tuner.o
     M_I2C=y
+    ifeq ($(CONFIG_BTTV_REMOTE),m)
+	M_OBJS += remote.o
+    endif
   endif
 endif
 
diff -u --recursive --new-file linux/drivers/char/bttv.c linux-irctl/drivers/char/bttv.c
--- linux/drivers/char/bttv.c	Tue Jun  8 01:18:17 1999
+++ linux-irctl/drivers/char/bttv.c	Tue Jul 27 02:04:46 1999
@@ -20,6 +20,11 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

 	make_vbitab(btv);
 	bt848_set_risc_jmps(btv);
   
@@ -3336,6 +3378,17 @@
 		/* 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;
+		}
+#endif
 		if (astat&BT848_INT_FMTCHG) 
 		{
 			IDEBUG(printk ("bttv%d: IRQ_FMTCHG\n", btv->nr));
@@ -3840,9 +3893,17 @@
 	}
 }
 
-#ifdef MODULE
-
+#ifdef BTTV_GPIOMON
+#if LINUX_VERSION_CODE >= 0x020100
+EXPORT_SYMBOL(bttv_set_gpio_monitor);
+#endif
+#else
 EXPORT_NO_SYMBOLS;
+#endif
