]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/common/saa7146_vbi.c
Pull fujitsu into release branch
[linux-2.6-omap-h63xx.git] / drivers / media / common / saa7146_vbi.c
index 468d3c9590755bfa44bc7ec7fdcf2d20b3756071..6103484e4442bb4564809ddb33be6a3a838e2c2c 100644 (file)
@@ -165,7 +165,7 @@ static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf
        /* we don't wait here for the first field anymore. this is different from the video
           capture and might cause that the first buffer is only half filled (with only
           one field). but since this is some sort of streaming data, this is not that negative.
-          but by doing this, we can use the whole engine from video-buf.c... */
+          but by doing this, we can use the whole engine from videobuf-dma-sg.c... */
 
 /*
        WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait);
@@ -236,9 +236,11 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
        }
 
        if (buf->vb.size != size)
-               saa7146_dma_free(dev,buf);
+               saa7146_dma_free(dev,q,buf);
 
        if (STATE_NEEDS_INIT == buf->vb.state) {
+               struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
+
                buf->vb.width  = llength;
                buf->vb.height = lines;
                buf->vb.size   = size;
@@ -247,10 +249,11 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
                saa7146_pgtable_free(dev->pci, &buf->pt[2]);
                saa7146_pgtable_alloc(dev->pci, &buf->pt[2]);
 
-               err = videobuf_iolock(dev->pci,&buf->vb, NULL);
+               err = videobuf_iolock(q,&buf->vb, NULL);
                if (err)
                        goto oops;
-               err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], buf->vb.dma.sglist, buf->vb.dma.sglen);
+               err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2],
+                                                dma->sglist, dma->sglen);
                if (0 != err)
                        return err;
        }
@@ -261,7 +264,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
 
  oops:
        DEB_VBI(("error out.\n"));
-       saa7146_dma_free(dev,buf);
+       saa7146_dma_free(dev,q,buf);
 
        return err;
 }
@@ -301,7 +304,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
        struct saa7146_buf *buf = (struct saa7146_buf *)vb;
 
        DEB_VBI(("vb:%p\n",vb));
-       saa7146_dma_free(dev,buf);
+       saa7146_dma_free(dev,q,buf);
 }
 
 static struct videobuf_queue_ops vbi_qops = {
@@ -404,13 +407,13 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file)
        fh->vbi_fmt.start[1] = 312;
        fh->vbi_fmt.count[1] = 16;
 
-       videobuf_queue_init(&fh->vbi_q, &vbi_qops,
+       videobuf_queue_pci_init(&fh->vbi_q, &vbi_qops,
                            dev->pci, &dev->slock,
                            V4L2_BUF_TYPE_VBI_CAPTURE,
                            V4L2_FIELD_SEQ_TB, // FIXME: does this really work?
                            sizeof(struct saa7146_buf),
                            file);
-       init_MUTEX(&fh->vbi_q.lock);
+       mutex_init(&fh->vbi_q.lock);
 
        init_timer(&fh->vbi_read_timeout);
        fh->vbi_read_timeout.function = vbi_read_timeout;