"Fossies" - the Fresh Open Source Software archive

Member "alevt-1.6.3/contrib/patch-bttv-0.6.4" of archive alevt-1.6.3.tar.gz:


diff -ru -x *.o driver-orig/bttv.c driver/bttv.c
--- driver-orig/bttv.c	Mon May  3 01:01:05 1999
+++ driver/bttv.c	Wed Jun  2 00:39:18 1999
@@ -74,6 +74,15 @@
 #define ioremap vremap 
 #define iounmap vfree
 #endif
+#if LINUX_VERSION_CODE < 0x02017f
+static void schedule_timeout(int j)
+{
+	current->state   = TASK_INTERRUPTIBLE;
+	current->timeout = jiffies + j;
+	schedule();
+}
+#endif
+
 
 #ifdef V4L2
 #include "videodev2.h"
@@ -673,6 +682,19 @@
 }
 
 
+static void reset_vbi_seq(struct bttv *btv)
+{
+    if (btv->vbibuf)
+	(*(u32 *)(btv->vbibuf + VBIBUF_SIZE - 4)) = 0;
+}
+
+static void increment_vbi_seq(struct bttv *btv)
+{
+    if (btv->vbibuf)
+	(*(u32 *)(btv->vbibuf + VBIBUF_SIZE - 4))++;
+}
+
+
 /* If Bt848a or Bt849, use PLL for PAL/SECAM and crystal for NTSC*/
 
 /* Frequency = (F_input / PLL_X) * PLL_I.PLL_F/PLL_C 
@@ -791,6 +813,7 @@
               AUDIO_EXTERN : AUDIO_TUNER);
 	btaor(tvcards[btv->type].muxsel[input]>>4,
 		~tvcards[btv->type].gpiomask2, BT848_GPIO_DATA);
+	reset_vbi_seq(btv);
 }
 
 
@@ -907,6 +930,8 @@
 	*(pe++)=FIX_BE(virt_to_bus(btv->risc_jmp+10));
 	DEBUG(printk(KERN_DEBUG "po: 0x%08x\n",(int)po));
 	DEBUG(printk(KERN_DEBUG "pe: 0x%08x\n",(int)pe));
+
+	reset_vbi_seq(btv);
 }
 
 int fmtbppx2[16] = {
@@ -1665,6 +1690,7 @@
 			i2c_control_device(&(btv->i2c), I2C_DRIVERID_TUNER,
 					   TUNER_SET_RADIOFREQ,&fixme);
                 } else {
+			reset_vbi_seq(btv);
 			i2c_control_device(&(btv->i2c), I2C_DRIVERID_TUNER,
 					   TUNER_SET_TVFREQ,&fixme);
                 }
@@ -2728,6 +2754,7 @@
 	btv->vbip=VBIBUF_SIZE;
 	btv->cap|=0x0c;
 	bt848_set_risc_jmps(btv);
+	reset_vbi_seq(btv);
 
 	MOD_INC_USE_COUNT;
 	return 0;   
@@ -2746,6 +2773,13 @@
 
 static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 {
+	switch (cmd)
+	{
+	    	case BTTV_VERSION:
+			return BTTV_VERSION_CODE;
+		case BTTV_VBISIZE:
+			return VBIBUF_SIZE;
+	}
 	return -EINVAL;
 }
 
@@ -2855,6 +2889,8 @@
 	case VIDIOCSAUDIO:
 		bttv_ioctl((struct video_device *)btv,cmd,arg);
 		break;
+	case BTTV_VERSION:
+		return BTTV_VERSION_CODE;
 	default:
 		return -ENOIOCTLCMD;
 	}
@@ -3886,8 +3922,7 @@
 			if (stat&(1<<28)) 
 			{
 				btv->vbip=0;
-				/* inc vbi frame count for detecting drops */
-				(*(u32 *)&(btv->vbibuf[VBIBUF_SIZE - 4]))++;
+				increment_vbi_seq(btv);
 				wake_up_interruptible(&btv->vbiq);
 			}
 
@@ -3961,6 +3996,7 @@
 		}
 		if (astat&BT848_INT_HLOCK) 
 		{
+			reset_vbi_seq(btv);
 			if ((dstat&BT848_DSTATUS_HLOC) || (btv->radio))
 				audio(btv, AUDIO_ON);
 			else
@@ -4142,7 +4178,9 @@
 	int result;
 	unsigned char bus, devfn;
 	struct bttv *btv;
+#if defined(__powerpc__)
         u_int32_t cmd; 
+#endif
 
 	bttv_num=0;
 
diff -ru -x *.o driver-orig/bttv.h driver/bttv.h
--- driver-orig/bttv.h	Mon May  3 00:32:49 1999
+++ driver/bttv.h	Tue Jun  1 22:20:48 1999
@@ -229,6 +229,7 @@
 #define BTTV_BURST_OFF     	_IOR('v' , BASE_VIDIOCPRIVATE+5, int)
 #define BTTV_VERSION  	        _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
 #define BTTV_PICNR		_IOR('v' , BASE_VIDIOCPRIVATE+7, int)
+#define BTTV_VBISIZE		_IOR('v' , BASE_VIDIOCPRIVATE+8, int)
 
 
 #define BTTV_UNKNOWN       0x00
diff -ru -x *.o driver-orig/msp3400.c driver/msp3400.c
--- driver-orig/msp3400.c	Fri Apr 16 08:25:45 1999
+++ driver/msp3400.c	Tue Jun  1 22:36:24 1999
@@ -112,7 +112,7 @@
 #endif
 
 #if LINUX_VERSION_CODE < 0x02017f
-void schedule_timeout(int j)
+static void schedule_timeout(int j)
 {
 	current->timeout = jiffies + j;
 	schedule();
diff -ru -x *.o driver-orig/tuner.c driver/tuner.c
--- driver-orig/tuner.c	Sat May  1 01:29:08 1999
+++ driver/tuner.c	Tue Jun  1 22:36:49 1999
@@ -23,12 +23,15 @@
 #endif
 
 #if LINUX_VERSION_CODE < 0x02017f
-void schedule_timeout(int j)
+static void schedule_timeout(int j)
 {
 	current->state   = TASK_INTERRUPTIBLE;
 	current->timeout = jiffies + j;
 	schedule();
 }
+#endif
+#ifndef EXPORT_NO_SYMBOLS
+#define EXPORT_NO_SYMBOLS
 #endif
 
 struct tuner