~ubuntu-branches/ubuntu/gutsy/alevt/gutsy

« back to all changes in this revision

Viewing changes to contrib/patch-bttv-0.6.4

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Schoepf
  • Date: 2002-03-17 15:09:36 UTC
  • Revision ID: james.westby@ubuntu.com-20020317150936-yglzziwcc0luz55k
Tags: upstream-1.6.0
ImportĀ upstreamĀ versionĀ 1.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ru -x *.o driver-orig/bttv.c driver/bttv.c
 
2
--- driver-orig/bttv.c  Mon May  3 01:01:05 1999
 
3
+++ driver/bttv.c       Wed Jun  2 00:39:18 1999
 
4
@@ -74,6 +74,15 @@
 
5
 #define ioremap vremap 
 
6
 #define iounmap vfree
 
7
 #endif
 
8
+#if LINUX_VERSION_CODE < 0x02017f
 
9
+static void schedule_timeout(int j)
 
10
+{
 
11
+       current->state   = TASK_INTERRUPTIBLE;
 
12
+       current->timeout = jiffies + j;
 
13
+       schedule();
 
14
+}
 
15
+#endif
 
16
+
 
17
 
 
18
 #ifdef V4L2
 
19
 #include "videodev2.h"
 
20
@@ -673,6 +682,19 @@
 
21
 }
 
22
 
 
23
 
 
24
+static void reset_vbi_seq(struct bttv *btv)
 
25
+{
 
26
+    if (btv->vbibuf)
 
27
+       (*(u32 *)(btv->vbibuf + VBIBUF_SIZE - 4)) = 0;
 
28
+}
 
29
+
 
30
+static void increment_vbi_seq(struct bttv *btv)
 
31
+{
 
32
+    if (btv->vbibuf)
 
33
+       (*(u32 *)(btv->vbibuf + VBIBUF_SIZE - 4))++;
 
34
+}
 
35
+
 
36
+
 
37
 /* If Bt848a or Bt849, use PLL for PAL/SECAM and crystal for NTSC*/
 
38
 
 
39
 /* Frequency = (F_input / PLL_X) * PLL_I.PLL_F/PLL_C 
 
40
@@ -791,6 +813,7 @@
 
41
               AUDIO_EXTERN : AUDIO_TUNER);
 
42
        btaor(tvcards[btv->type].muxsel[input]>>4,
 
43
                ~tvcards[btv->type].gpiomask2, BT848_GPIO_DATA);
 
44
+       reset_vbi_seq(btv);
 
45
 }
 
46
 
 
47
 
 
48
@@ -907,6 +930,8 @@
 
49
        *(pe++)=FIX_BE(virt_to_bus(btv->risc_jmp+10));
 
50
        DEBUG(printk(KERN_DEBUG "po: 0x%08x\n",(int)po));
 
51
        DEBUG(printk(KERN_DEBUG "pe: 0x%08x\n",(int)pe));
 
52
+
 
53
+       reset_vbi_seq(btv);
 
54
 }
 
55
 
 
56
 int fmtbppx2[16] = {
 
57
@@ -1665,6 +1690,7 @@
 
58
                        i2c_control_device(&(btv->i2c), I2C_DRIVERID_TUNER,
 
59
                                           TUNER_SET_RADIOFREQ,&fixme);
 
60
                 } else {
 
61
+                       reset_vbi_seq(btv);
 
62
                        i2c_control_device(&(btv->i2c), I2C_DRIVERID_TUNER,
 
63
                                           TUNER_SET_TVFREQ,&fixme);
 
64
                 }
 
65
@@ -2728,6 +2754,7 @@
 
66
        btv->vbip=VBIBUF_SIZE;
 
67
        btv->cap|=0x0c;
 
68
        bt848_set_risc_jmps(btv);
 
69
+       reset_vbi_seq(btv);
 
70
 
 
71
        MOD_INC_USE_COUNT;
 
72
        return 0;   
 
73
@@ -2746,6 +2773,13 @@
 
74
 
 
75
 static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
 
76
 {
 
77
+       switch (cmd)
 
78
+       {
 
79
+               case BTTV_VERSION:
 
80
+                       return BTTV_VERSION_CODE;
 
81
+               case BTTV_VBISIZE:
 
82
+                       return VBIBUF_SIZE;
 
83
+       }
 
84
        return -EINVAL;
 
85
 }
 
86
 
 
87
@@ -2855,6 +2889,8 @@
 
88
        case VIDIOCSAUDIO:
 
89
                bttv_ioctl((struct video_device *)btv,cmd,arg);
 
90
                break;
 
91
+       case BTTV_VERSION:
 
92
+               return BTTV_VERSION_CODE;
 
93
        default:
 
94
                return -ENOIOCTLCMD;
 
95
        }
 
96
@@ -3886,8 +3922,7 @@
 
97
                        if (stat&(1<<28)) 
 
98
                        {
 
99
                                btv->vbip=0;
 
100
-                               /* inc vbi frame count for detecting drops */
 
101
-                               (*(u32 *)&(btv->vbibuf[VBIBUF_SIZE - 4]))++;
 
102
+                               increment_vbi_seq(btv);
 
103
                                wake_up_interruptible(&btv->vbiq);
 
104
                        }
 
105
 
 
106
@@ -3961,6 +3996,7 @@
 
107
                }
 
108
                if (astat&BT848_INT_HLOCK) 
 
109
                {
 
110
+                       reset_vbi_seq(btv);
 
111
                        if ((dstat&BT848_DSTATUS_HLOC) || (btv->radio))
 
112
                                audio(btv, AUDIO_ON);
 
113
                        else
 
114
@@ -4142,7 +4178,9 @@
 
115
        int result;
 
116
        unsigned char bus, devfn;
 
117
        struct bttv *btv;
 
118
+#if defined(__powerpc__)
 
119
         u_int32_t cmd; 
 
120
+#endif
 
121
 
 
122
        bttv_num=0;
 
123
 
 
124
diff -ru -x *.o driver-orig/bttv.h driver/bttv.h
 
125
--- driver-orig/bttv.h  Mon May  3 00:32:49 1999
 
126
+++ driver/bttv.h       Tue Jun  1 22:20:48 1999
 
127
@@ -229,6 +229,7 @@
 
128
 #define BTTV_BURST_OFF         _IOR('v' , BASE_VIDIOCPRIVATE+5, int)
 
129
 #define BTTV_VERSION           _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
 
130
 #define BTTV_PICNR             _IOR('v' , BASE_VIDIOCPRIVATE+7, int)
 
131
+#define BTTV_VBISIZE           _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
 
132
 
 
133
 
 
134
 #define BTTV_UNKNOWN       0x00
 
135
diff -ru -x *.o driver-orig/msp3400.c driver/msp3400.c
 
136
--- driver-orig/msp3400.c       Fri Apr 16 08:25:45 1999
 
137
+++ driver/msp3400.c    Tue Jun  1 22:36:24 1999
 
138
@@ -112,7 +112,7 @@
 
139
 #endif
 
140
 
 
141
 #if LINUX_VERSION_CODE < 0x02017f
 
142
-void schedule_timeout(int j)
 
143
+static void schedule_timeout(int j)
 
144
 {
 
145
        current->timeout = jiffies + j;
 
146
        schedule();
 
147
diff -ru -x *.o driver-orig/tuner.c driver/tuner.c
 
148
--- driver-orig/tuner.c Sat May  1 01:29:08 1999
 
149
+++ driver/tuner.c      Tue Jun  1 22:36:49 1999
 
150
@@ -23,12 +23,15 @@
 
151
 #endif
 
152
 
 
153
 #if LINUX_VERSION_CODE < 0x02017f
 
154
-void schedule_timeout(int j)
 
155
+static void schedule_timeout(int j)
 
156
 {
 
157
        current->state   = TASK_INTERRUPTIBLE;
 
158
        current->timeout = jiffies + j;
 
159
        schedule();
 
160
 }
 
161
+#endif
 
162
+#ifndef EXPORT_NO_SYMBOLS
 
163
+#define EXPORT_NO_SYMBOLS
 
164
 #endif
 
165
 
 
166
 struct tuner