]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP1: Camera: Update videobuf utilization
authorEduardo Valentin <eduardo.valentin@indt.org.br>
Wed, 21 Nov 2007 22:23:03 +0000 (18:23 -0400)
committerTony Lindgren <tony@atomide.com>
Wed, 28 Nov 2007 02:23:15 +0000 (18:23 -0800)
This patch updates the camera_core.[c,h] to use corretly the new
v4l2 videobuf API.

Also removes VIDEO_BUF reference from Kconfig and adds the correct
dependencies.

Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/media/video/omap/Kconfig
drivers/media/video/omap/camera_core.c
drivers/media/video/omap/camera_core.h

index 0fb0686f65620170e939b42b01ae1c652e406c40..c8d1f4c2ab8ae042cc62ba6c5491cbb129a76419 100644 (file)
@@ -1,6 +1,7 @@
 config VIDEO_OMAP_CAMERA
        tristate "OMAP Camera support (EXPERIMENTAL)"
-       select VIDEO_BUF
+       select VIDEOBUF_GEN
+       select VIDEOBUF_DMA_SG
        depends on VIDEO_DEV && (ARCH_OMAP16XX || ARCH_OMAP24XX)
        help
          V4L2 camera driver support for OMAP1/2 based boards.
index 1d472124d166414b8e641cbdf25c36b0e748095c..6e5d8bdf33e10deb506d1ae766e37662808e31a9 100644 (file)
@@ -393,9 +393,10 @@ static void camera_core_vbq_complete(void *arg1, void *arg)
 static void camera_core_vbq_release(struct videobuf_queue *q,
                                    struct videobuf_buffer *vb)
 {
+       struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
        videobuf_waiton(vb, 0, 0);
-       videobuf_dma_unmap(q, &vb->dma);
-       videobuf_dma_free(&vb->dma);
+       videobuf_dma_unmap(q, dma);
+       videobuf_dma_free(dma);
 
        vb->state = STATE_NEEDS_INIT;
 }
@@ -459,13 +460,14 @@ static int camera_core_vbq_prepare(struct videobuf_queue *q,
 static void camera_core_vbq_queue(struct videobuf_queue *q,
                                  struct videobuf_buffer *vb)
 {
+       struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
        struct camera_fh *fh = q->priv_data;
        struct camera_device *cam = fh->cam;
        enum videobuf_state state = vb->state;
        int err;
 
        vb->state = STATE_QUEUED;
-       err = camera_core_sgdma_queue(cam, vb->dma.sglist, vb->dma.sglen,
+       err = camera_core_sgdma_queue(cam, dma->sglist, dma->sglen,
                                      camera_core_vbq_complete, vb);
        if (err) {
                /* Oops.  We're not supposed to get any errors here.  The only
@@ -915,7 +917,7 @@ static int camera_core_open(struct inode *inode, struct file *file)
        vidioc_int_g_fmt_cap(cam->sdev, &format);
        spin_unlock(&cam->img_lock);
 
-       videobuf_queue_init(&fh->vbq, &cam->vbq_ops, NULL, &cam->vbq_lock,
+       videobuf_queue_pci_init(&fh->vbq, &cam->vbq_ops, NULL, &cam->vbq_lock,
                            fh->type, V4L2_FIELD_NONE,
                            sizeof(struct videobuf_buffer), fh);
 
@@ -1045,7 +1047,6 @@ static int camera_device_register(struct v4l2_int_device *ctl,
        vfd->type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY | VID_TYPE_CHROMAKEY;
 
        /* Need to register for a VID_HARDWARE_* ID in videodev.h */
-       vfd->hardware = 0;
        vfd->fops = &camera_core_fops;
        video_set_drvdata(vfd, cam);
        vfd->minor = -1;
index e156cc3f282313e12bc494ed3ee1d44c4a2c71ec..02ed5bef8349306ecbd702933219a9cc22ceb32c 100644 (file)
@@ -17,8 +17,8 @@
 
 struct camera_fh;
 
-#include <media/video-buf.h>
 #include <asm/scatterlist.h>
+#include <media/videobuf-dma-sg.h>
 #include <media/v4l2-int-device.h>
 
 struct camera_device;