Commit a58dd995 authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Tony Lindgren

ARM: OMAP1: Camera: Update videobuf utilization

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: default avatarEduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent a2329123
config VIDEO_OMAP_CAMERA config VIDEO_OMAP_CAMERA
tristate "OMAP Camera support (EXPERIMENTAL)" tristate "OMAP Camera support (EXPERIMENTAL)"
select VIDEO_BUF select VIDEOBUF_GEN
select VIDEOBUF_DMA_SG
depends on VIDEO_DEV && (ARCH_OMAP16XX || ARCH_OMAP24XX) depends on VIDEO_DEV && (ARCH_OMAP16XX || ARCH_OMAP24XX)
help help
V4L2 camera driver support for OMAP1/2 based boards. V4L2 camera driver support for OMAP1/2 based boards.
...@@ -393,9 +393,10 @@ static void camera_core_vbq_complete(void *arg1, void *arg) ...@@ -393,9 +393,10 @@ static void camera_core_vbq_complete(void *arg1, void *arg)
static void camera_core_vbq_release(struct videobuf_queue *q, static void camera_core_vbq_release(struct videobuf_queue *q,
struct videobuf_buffer *vb) struct videobuf_buffer *vb)
{ {
struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
videobuf_waiton(vb, 0, 0); videobuf_waiton(vb, 0, 0);
videobuf_dma_unmap(q, &vb->dma); videobuf_dma_unmap(q, dma);
videobuf_dma_free(&vb->dma); videobuf_dma_free(dma);
vb->state = STATE_NEEDS_INIT; vb->state = STATE_NEEDS_INIT;
} }
...@@ -459,13 +460,14 @@ static int camera_core_vbq_prepare(struct videobuf_queue *q, ...@@ -459,13 +460,14 @@ static int camera_core_vbq_prepare(struct videobuf_queue *q,
static void camera_core_vbq_queue(struct videobuf_queue *q, static void camera_core_vbq_queue(struct videobuf_queue *q,
struct videobuf_buffer *vb) struct videobuf_buffer *vb)
{ {
struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
struct camera_fh *fh = q->priv_data; struct camera_fh *fh = q->priv_data;
struct camera_device *cam = fh->cam; struct camera_device *cam = fh->cam;
enum videobuf_state state = vb->state; enum videobuf_state state = vb->state;
int err; int err;
vb->state = STATE_QUEUED; 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); camera_core_vbq_complete, vb);
if (err) { if (err) {
/* Oops. We're not supposed to get any errors here. The only /* 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) ...@@ -915,7 +917,7 @@ static int camera_core_open(struct inode *inode, struct file *file)
vidioc_int_g_fmt_cap(cam->sdev, &format); vidioc_int_g_fmt_cap(cam->sdev, &format);
spin_unlock(&cam->img_lock); 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, fh->type, V4L2_FIELD_NONE,
sizeof(struct videobuf_buffer), fh); sizeof(struct videobuf_buffer), fh);
...@@ -1045,7 +1047,6 @@ static int camera_device_register(struct v4l2_int_device *ctl, ...@@ -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; vfd->type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY | VID_TYPE_CHROMAKEY;
/* Need to register for a VID_HARDWARE_* ID in videodev.h */ /* Need to register for a VID_HARDWARE_* ID in videodev.h */
vfd->hardware = 0;
vfd->fops = &camera_core_fops; vfd->fops = &camera_core_fops;
video_set_drvdata(vfd, cam); video_set_drvdata(vfd, cam);
vfd->minor = -1; vfd->minor = -1;
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
struct camera_fh; struct camera_fh;
#include <media/video-buf.h>
#include <asm/scatterlist.h> #include <asm/scatterlist.h>
#include <media/videobuf-dma-sg.h>
#include <media/v4l2-int-device.h> #include <media/v4l2-int-device.h>
struct camera_device; struct camera_device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment