This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / media / video / bttv-vbi.c
index ecdd9bf..ad655c8 100644 (file)
@@ -1,21 +1,19 @@
 /*
-    $Id: bttv-vbi.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $
-
     bttv - Bt848 frame grabber driver
     vbi interface
-
+    
     (c) 2002 Gerd Knorr <kraxel@bytesex.org>
-
+    
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
-
+    
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-
+    
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -37,9 +35,9 @@
 static unsigned int vbibufs = 4;
 static unsigned int vbi_debug = 0;
 
-module_param(vbibufs,   int, 0444);
-module_param(vbi_debug, int, 0644);
+MODULE_PARM(vbibufs,"i");
 MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32, default 4");
+MODULE_PARM(vbi_debug,"i");
 MODULE_PARM_DESC(vbi_debug,"vbi code debug messages, default is 0 (no)");
 
 #ifdef dprintk
@@ -63,10 +61,10 @@ vbi_buffer_risc(struct bttv *btv, struct bttv_buffer *buf, int lines)
        return 0;
 }
 
-static int vbi_buffer_setup(struct videobuf_queue *q,
+static int vbi_buffer_setup(struct file *file,
                            unsigned int *count, unsigned int *size)
 {
-       struct bttv_fh *fh = q->priv_data;
+       struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
 
        if (0 == *count)
@@ -76,15 +74,14 @@ static int vbi_buffer_setup(struct videobuf_queue *q,
        return 0;
 }
 
-static int vbi_buffer_prepare(struct videobuf_queue *q,
-                             struct videobuf_buffer *vb,
+static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb,
                              enum v4l2_field field)
 {
-       struct bttv_fh *fh = q->priv_data;
+       struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
-       struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
+       struct bttv_buffer *buf = (struct bttv_buffer*)vb;
        int rc;
-
+       
        buf->vb.size = fh->lines * 2 * 2048;
        if (0 != buf->vb.baddr  &&  buf->vb.bsize < buf->vb.size)
                return -EINVAL;
@@ -108,27 +105,27 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
 }
 
 static void
-vbi_buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
+vbi_buffer_queue(struct file *file, struct videobuf_buffer *vb)
 {
-       struct bttv_fh *fh = q->priv_data;
+       struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
-       struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
-
+       struct bttv_buffer *buf = (struct bttv_buffer*)vb;
+       
        dprintk("queue %p\n",vb);
        buf->vb.state = STATE_QUEUED;
        list_add_tail(&buf->vb.queue,&btv->vcapture);
        if (NULL == btv->cvbi) {
-               fh->btv->loop_irq |= 4;
-               bttv_set_dma(btv,0x0c);
+               fh->btv->curr.irqflags |= 4;
+               bttv_set_dma(btv,0x0c,fh->btv->curr.irqflags);
        }
 }
 
-static void vbi_buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
+static void vbi_buffer_release(struct file *file, struct videobuf_buffer *vb)
 {
-       struct bttv_fh *fh = q->priv_data;
+       struct bttv_fh *fh = file->private_data;
        struct bttv *btv = fh->btv;
-       struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
-
+       struct bttv_buffer *buf = (struct bttv_buffer*)vb;
+       
        dprintk("free %p\n",vb);
        bttv_dma_free(fh->btv,buf);
 }