Commit 8a52303e authored by Trilok Soni's avatar Trilok Soni Committed by Tony Lindgren

OMAP: Update OMAP1 camera core with video_ioctl2 interface.

- Update omap1 camera interface to use video_ioctl2 interface.
- coding style related updates.
Signed-off-by: default avatarTrilok Soni <soni.trilok@gmail.com>
parent 8a47e860
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* 27/03/05 Vladimir Barinov - Added support for power management * 27/03/05 Vladimir Barinov - Added support for power management
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -36,6 +35,7 @@ ...@@ -36,6 +35,7 @@
#include "camera_hw_if.h" #include "camera_hw_if.h"
#include "camera_core.h" #include "camera_core.h"
#define OMAP1CAM_VERSION KERNEL_VERSION(0, 0, 0)
static struct camera_device *camera_dev; static struct camera_device *camera_dev;
static void camera_core_sgdma_process(struct camera_device *cam); static void camera_core_sgdma_process(struct camera_device *cam);
...@@ -66,8 +66,7 @@ camera_core_callback_sgdma(void *arg1, void *arg2) ...@@ -66,8 +66,7 @@ camera_core_callback_sgdma(void *arg1, void *arg2)
spin_lock(&cam->sg_lock); spin_lock(&cam->sg_lock);
sgdma = cam->sgdma + sgslot; sgdma = cam->sgdma + sgslot;
if (!sgdma->queued_sglist) if (!sgdma->queued_sglist) {
{
spin_unlock(&cam->sg_lock); spin_unlock(&cam->sg_lock);
dev_err(&cam->dev, "SGDMA completed when none queued\n"); dev_err(&cam->dev, "SGDMA completed when none queued\n");
return; return;
...@@ -146,8 +145,7 @@ camera_core_sgdma_process(struct camera_device *cam) ...@@ -146,8 +145,7 @@ camera_core_sgdma_process(struct camera_device *cam)
/* dma start failed */ /* dma start failed */
cam->in_use = 0; cam->in_use = 0;
return; return;
} } else {
else {
/* dma start successful */ /* dma start successful */
sgdma->next_sglist ++; sgdma->next_sglist ++;
sgdma->queued_sglist ++; sgdma->queued_sglist ++;
...@@ -280,7 +278,7 @@ camera_core_start_overlay(struct camera_device *cam) ...@@ -280,7 +278,7 @@ camera_core_start_overlay(struct camera_device *cam)
spin_unlock_irqrestore(&cam->overlay_lock, irqflags); spin_unlock_irqrestore(&cam->overlay_lock, irqflags);
} }
/* ------------------ videobuf_queue_ops ---------------------------------------- */ /* ------------------ videobuf_queue_ops --------------------------------*/
/* This routine is called from interrupt context when a scatter-gather DMA /* This routine is called from interrupt context when a scatter-gather DMA
* transfer of a videobuf_buffer completes. * transfer of a videobuf_buffer completes.
...@@ -389,85 +387,62 @@ camera_core_vbq_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) ...@@ -389,85 +387,62 @@ camera_core_vbq_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
} }
} }
/* ------------------ videobuf_queue_ops ---------------------------------------- */
static int /*
camera_core_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, *
void *arg) * IOCTL interface.
*
*/
static int vidioc_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ {
struct camera_fh *fh = file->private_data; struct camera_fh *ofh = fh;
struct camera_device *cam = fh->cam; struct camera_device *cam = ofh->cam;
int err;
switch (cmd) {
case VIDIOC_ENUMINPUT:
{
/* default handler assumes 1 video input (the camera) */
struct v4l2_input *input = (struct v4l2_input *)arg;
int index = input->index;
memset(input, 0, sizeof(*input));
input->index = index;
if (index > 0) strlcpy(cap->driver, CAM_NAME, sizeof(cap->driver));
return -EINVAL; strlcpy(cap->card, cam->vfd->name, sizeof(cap->card));
cap->version = OMAP1CAM_VERSION;
strlcpy(input->name, "camera", sizeof(input->name)); cap->capabilities =
input->type = V4L2_INPUT_TYPE_CAMERA; V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_OVERLAY |
return 0; V4L2_CAP_READWRITE |
} V4L2_CAP_STREAMING;
case VIDIOC_G_INPUT:
{
unsigned int *input = arg;
*input = 0;
return 0;
}
case VIDIOC_S_INPUT:
{
unsigned int *input = arg;
if (*input > 0)
return -EINVAL;
return 0; return 0;
} }
case VIDIOC_ENUM_FMT:
{
struct v4l2_fmtdesc *fmt = arg;
return cam->cam_sensor->enum_pixformat(fmt, cam->sensor_data);
}
case VIDIOC_TRY_FMT: static int vidioc_enum_fmt_cap(struct file *file, void *fh,
{ struct v4l2_fmtdesc *f)
struct v4l2_format *fmt = arg; {
return cam->cam_sensor->try_format(&fmt->fmt.pix, cam->sensor_data); struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
} return cam->cam_sensor->enum_pixformat(f, cam->sensor_data);
}
case VIDIOC_G_FMT: static int vidioc_g_fmt_cap(struct file *file, void *fh,
{ struct v4l2_format *f)
struct v4l2_format *fmt = arg; {
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
/* get the current format */ /* get the current format */
memset(&fmt->fmt.pix, 0, sizeof (fmt->fmt.pix)); memset(&f->fmt.pix, 0, sizeof(f->fmt.pix));
fmt->fmt.pix = cam->pix; f->fmt.pix = cam->pix;
return 0; return 0;
} }
case VIDIOC_S_FMT: static int vidioc_s_fmt_cap(struct file *file, void *fh,
{ struct v4l2_format *f)
struct v4l2_format *fmt = arg; {
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
unsigned int temp_sizeimage = 0; unsigned int temp_sizeimage = 0;
temp_sizeimage = cam->pix.sizeimage; temp_sizeimage = cam->pix.sizeimage;
cam->cam_sensor->try_format(&fmt->fmt.pix, cam->sensor_data); cam->cam_sensor->try_format(&f->fmt.pix, cam->sensor_data);
cam->pix = fmt->fmt.pix; cam->pix = f->fmt.pix;
cam->xclk = cam->cam_sensor->calc_xclk(&cam->pix, cam->xclk = cam->cam_sensor->calc_xclk(&cam->pix,
&cam->nominal_timeperframe, cam->sensor_data); &cam->nominal_timeperframe, cam->sensor_data);
...@@ -475,203 +450,200 @@ camera_core_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -475,203 +450,200 @@ camera_core_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data); cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data);
return cam->cam_sensor->configure(&cam->pix, cam->xclk, return cam->cam_sensor->configure(&cam->pix, cam->xclk,
&cam->cparm.timeperframe, cam->sensor_data); &cam->cparm.timeperframe, cam->sensor_data);
} }
case VIDIOC_QUERYCTRL: static int vidioc_try_fmt_cap(struct file *file, void *fh,
{ struct v4l2_format *f)
struct v4l2_queryctrl *qc = arg; {
return cam->cam_sensor->query_control(qc, cam->sensor_data); struct camera_fh *ofh = fh;
} struct camera_device *cam = ofh->cam;
case VIDIOC_G_CTRL: return cam->cam_sensor->try_format(&f->fmt.pix, cam->sensor_data);
{ }
struct v4l2_control *vc = arg;
return cam->cam_sensor->get_control(vc, cam->sensor_data);
}
case VIDIOC_S_CTRL: static int vidioc_reqbufs(struct file *file, void *fh,
{ struct v4l2_requestbuffers *b)
struct v4l2_control *vc = arg; {
return cam->cam_sensor->set_control(vc, cam->sensor_data); struct camera_fh *ofh = fh;
}
case VIDIOC_QUERYCAP: return videobuf_reqbufs(&ofh->vbq, b);
{ }
struct v4l2_capability *cap =
(struct v4l2_capability *) arg;
memset(cap, 0, sizeof(*cap)); static int vidioc_querybuf(struct file *file, void *fh,
strlcpy(cap->driver, CAM_NAME, sizeof(cap->driver)); struct v4l2_buffer *b)
strlcpy(cap->card, cam->vfd->name, sizeof(cap->card)); {
cap->bus_info[0] = '\0'; struct camera_fh *ofh = fh;
cap->version = KERNEL_VERSION(0, 0, 0);
cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
return 0;
}
case VIDIOC_G_FBUF: /* Get the frame buffer parameters */ return videobuf_querybuf(&ofh->vbq, b);
{ }
struct v4l2_framebuffer *fbuf =
(struct v4l2_framebuffer *) arg;
spin_lock(&cam->img_lock); static int vidioc_qbuf(struct file *file, void *fh, struct v4l2_buffer *b)
*fbuf = cam->fbuf; {
spin_unlock(&cam->img_lock); struct camera_fh *ofh = fh;
return 0;
} return videobuf_qbuf(&ofh->vbq, b);
}
case VIDIOC_S_FBUF: /* set the frame buffer parameters */ static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *b)
{ {
struct v4l2_framebuffer *fbuf = struct camera_fh *ofh = fh;
(struct v4l2_framebuffer *) arg;
return videobuf_dqbuf(&ofh->vbq, b, file->f_flags & O_NONBLOCK);
}
static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
{
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
spin_lock(&cam->img_lock); spin_lock(&cam->img_lock);
if (cam->previewing) {
if (cam->streaming || cam->reading) {
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
return -EBUSY; return -EBUSY;
} } else
cam->fbuf.base = fbuf->base; cam->streaming = ofh;
cam->fbuf.fmt = fbuf->fmt; /* FIXME: start camera interface */
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
return 0;
}
case VIDIOC_OVERLAY: return videobuf_streamon(&ofh->vbq);
{ }
int enable = *((int *) arg);
/* static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
* check whether the capture format and {
** the display format matches struct camera_fh *ofh = fh;
* return failure if they are different struct camera_device *cam = ofh->cam;
*/ int err;
if (cam->pix.pixelformat != cam->fbuf.fmt.pixelformat)
{
return -EINVAL;
}
/* If the camera image size is greater err = videobuf_streamoff(&ofh->vbq);
** than LCD size return failure */ if (err < 0)
if ((cam->pix.width > cam->fbuf.fmt.height) || return err;
(cam->pix.height > cam->fbuf.fmt.width))
{ spin_lock(&cam->img_lock);
if (cam->streaming == ofh)
cam->streaming = NULL;
/* FIXME: stop camera interface */
spin_unlock(&cam->img_lock);
return 0;
}
static int vidioc_enum_input(struct file *file, void *fh,
struct v4l2_input *inp)
{
if (inp->index > 0)
return -EINVAL; return -EINVAL;
}
if (!cam->previewing && enable) strlcpy(inp->name, "camera", sizeof(inp->name));
{ inp->type = V4L2_INPUT_TYPE_CAMERA;
cam->previewing = fh;
cam->overlay_cnt = 0;
camera_core_start_overlay(cam);
}
else if (!enable)
{
cam->previewing = NULL;
}
return 0; return 0;
} }
case VIDIOC_REQBUFS: static int vidioc_g_input(struct file *file, void *fh, unsigned int *i)
return videobuf_reqbufs(&fh->vbq, arg); {
*i = 0;
case VIDIOC_QUERYBUF: return 0;
return videobuf_querybuf(&fh->vbq, arg); }
case VIDIOC_QBUF: static int vidioc_s_input(struct file *file, void *fh, unsigned int i)
return videobuf_qbuf(&fh->vbq, arg); {
if (i > 0)
return -EINVAL;
case VIDIOC_DQBUF: return 0;
return videobuf_dqbuf(&fh->vbq, arg, }
file->f_flags & O_NONBLOCK);
case VIDIOC_STREAMON: static int vidioc_queryctrl(struct file *file, void *fh,
{ struct v4l2_queryctrl *a)
spin_lock(&cam->img_lock); {
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
if (cam->streaming || cam->reading) { return cam->cam_sensor->query_control(a, cam->sensor_data);
spin_unlock(&cam->img_lock); }
return -EBUSY;
} static int vidioc_g_ctrl(struct file *file, void *fh,
else { struct v4l2_control *a)
cam->streaming = fh; {
/* FIXME: start camera interface */ struct camera_fh *ofh = fh;
} struct camera_device *cam = ofh->cam;
return cam->cam_sensor->get_control(a, cam->sensor_data);
}
static int vidioc_s_ctrl(struct file *file, void *fh,
struct v4l2_control *a)
{
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
return cam->cam_sensor->set_control(a, cam->sensor_data);
}
static int vidioc_g_fbuf(struct file *file, void *fh,
struct v4l2_framebuffer *a)
{
struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
spin_lock(&cam->img_lock);
*a = cam->fbuf;
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
return videobuf_streamon(&fh->vbq); return 0;
} }
case VIDIOC_STREAMOFF:
{ static int vidioc_s_fbuf(struct file *file, void *fh,
err = videobuf_streamoff(&fh->vbq); struct v4l2_framebuffer *a)
if (err < 0) {
return err; struct camera_fh *ofh = fh;
struct camera_device *cam = ofh->cam;
spin_lock(&cam->img_lock); spin_lock(&cam->img_lock);
if (cam->streaming == fh) { if (cam->previewing) {
cam->streaming = NULL; spin_unlock(&cam->img_lock);
/* FIXME: stop camera interface */ return -EBUSY;
} }
cam->fbuf.base = a->base;
cam->fbuf.fmt = a->fmt;
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
return 0; return 0;
} }
case VIDIOC_ENUMSTD:
case VIDIOC_G_STD:
case VIDIOC_S_STD:
case VIDIOC_QUERYSTD:
{
/* Digital cameras don't have an analog video standard,
* so we don't need to implement these ioctls.
*/
return -EINVAL;
}
case VIDIOC_G_AUDIO:
case VIDIOC_S_AUDIO:
case VIDIOC_G_AUDOUT:
case VIDIOC_S_AUDOUT:
{
/* we don't have any audio inputs or outputs */
return -EINVAL;
}
case VIDIOC_G_JPEGCOMP: static int vidioc_overlay(struct file *file, void *fh,
case VIDIOC_S_JPEGCOMP: unsigned int i)
{ {
/* JPEG compression is not supported */ struct camera_fh *ofh = fh;
return -EINVAL; struct camera_device *cam = ofh->cam;
} int enable = i;
case VIDIOC_G_TUNER: /*
case VIDIOC_S_TUNER: * check whether the capture format and
case VIDIOC_G_MODULATOR: * the display format matches
case VIDIOC_S_MODULATOR: * return failure if they are different
case VIDIOC_G_FREQUENCY: */
case VIDIOC_S_FREQUENCY: if (cam->pix.pixelformat != cam->fbuf.fmt.pixelformat)
{
/* we don't have a tuner or modulator */
return -EINVAL; return -EINVAL;
}
case VIDIOC_ENUMOUTPUT: /* If the camera image size is greater
case VIDIOC_G_OUTPUT: * than LCD size return failure
case VIDIOC_S_OUTPUT: */
{ if ((cam->pix.width > cam->fbuf.fmt.height) ||
/* we don't have any video outputs */ (cam->pix.height > cam->fbuf.fmt.width))
return -EINVAL; return -EINVAL;
}
default: if (!cam->previewing && enable) {
{ cam->previewing = fh;
/* unrecognized ioctl */ cam->overlay_cnt = 0;
return -ENOIOCTLCMD; camera_core_start_overlay(cam);
} } else if (!enable)
} cam->previewing = NULL;
return 0; return 0;
} }
...@@ -698,8 +670,7 @@ camera_core_capture_callback(void *arg1, void *arg) ...@@ -698,8 +670,7 @@ camera_core_capture_callback(void *arg1, void *arg)
static int done = 0; static int done = 0;
spin_lock_irqsave(&cam->capture_lock, irqflags); spin_lock_irqsave(&cam->capture_lock, irqflags);
if (!cam->reading) if (!cam->reading) {
{
done = 0; done = 0;
cam->capture_started = 0; cam->capture_started = 0;
spin_unlock_irqrestore(&cam->capture_lock, irqflags); spin_unlock_irqrestore(&cam->capture_lock, irqflags);
...@@ -714,8 +685,7 @@ camera_core_capture_callback(void *arg1, void *arg) ...@@ -714,8 +685,7 @@ camera_core_capture_callback(void *arg1, void *arg)
camera_core_capture_callback, NULL); camera_core_capture_callback, NULL);
} else { } else {
cam->capture_completed = 1; cam->capture_completed = 1;
if (cam->reading) if (cam->reading) {
{
/* Wake up any process which are waiting for the /* Wake up any process which are waiting for the
** DMA to complete */ ** DMA to complete */
wake_up_interruptible(&camera_dev->new_video_frame); wake_up_interruptible(&camera_dev->new_video_frame);
...@@ -792,14 +762,6 @@ camera_core_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -792,14 +762,6 @@ camera_core_mmap(struct file *file, struct vm_area_struct *vma)
return videobuf_mmap_mapper(&fh->vbq, vma); return videobuf_mmap_mapper(&fh->vbq, vma);
} }
static int
camera_core_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
return video_usercopy(inode, file, cmd, arg, camera_core_do_ioctl);
}
static int static int
camera_core_release(struct inode *inode, struct file *file) camera_core_release(struct inode *inode, struct file *file)
{ {
...@@ -810,15 +772,14 @@ camera_core_release(struct inode *inode, struct file *file) ...@@ -810,15 +772,14 @@ camera_core_release(struct inode *inode, struct file *file)
kfree(fh); kfree(fh);
spin_lock(&cam->img_lock); spin_lock(&cam->img_lock);
if (cam->previewing == fh) {
if (cam->previewing == fh)
cam->previewing = NULL; cam->previewing = NULL;
} if (cam->streaming == fh)
if (cam->streaming == fh) {
cam->streaming = NULL; cam->streaming = NULL;
} if (cam->reading == fh)
if (cam->reading == fh) {
cam->reading = NULL; cam->reading = NULL;
}
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
camera_dev->cam_hardware->finish_dma(cam->hardware_data); camera_dev->cam_hardware->finish_dma(cam->hardware_data);
...@@ -873,8 +834,7 @@ camera_core_open(struct inode *inode, struct file *file) ...@@ -873,8 +834,7 @@ camera_core_open(struct inode *inode, struct file *file)
cam->capture_completed = 0; cam->capture_completed = 0;
cam->capture_started = 0; cam->capture_started = 0;
if (cam->cam_hardware->open(cam->hardware_data)) if (cam->cam_hardware->open(cam->hardware_data)) {
{
dev_err(&cam->dev, "Camera IF configuration failed\n"); dev_err(&cam->dev, "Camera IF configuration failed\n");
cam->active = 0; cam->active = 0;
return -ENODEV; return -ENODEV;
...@@ -883,8 +843,7 @@ camera_core_open(struct inode *inode, struct file *file) ...@@ -883,8 +843,7 @@ camera_core_open(struct inode *inode, struct file *file)
cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data); cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data);
/* program the sensor for the capture format and rate */ /* program the sensor for the capture format and rate */
if (cam->cam_sensor->configure(&cam->pix, cam->xclk, if (cam->cam_sensor->configure(&cam->pix, cam->xclk,
&cam->cparm.timeperframe, cam->sensor_data)) &cam->cparm.timeperframe, cam->sensor_data)) {
{
dev_err(&cam->dev, "Camera sensor configuration failed\n"); dev_err(&cam->dev, "Camera sensor configuration failed\n");
cam->cam_hardware->close(cam->hardware_data); cam->cam_hardware->close(cam->hardware_data);
cam->active = 0; cam->active = 0;
...@@ -901,9 +860,9 @@ static int camera_core_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -901,9 +860,9 @@ static int camera_core_suspend(struct platform_device *pdev, pm_message_t state)
int ret = 0; int ret = 0;
spin_lock(&cam->img_lock); spin_lock(&cam->img_lock);
if (cam->active) { if (cam->active)
cam->cam_hardware->close(cam->hardware_data); cam->cam_hardware->close(cam->hardware_data);
}
cam->cam_sensor->power_off(cam->sensor_data); cam->cam_sensor->power_off(cam->sensor_data);
spin_unlock(&cam->img_lock); spin_unlock(&cam->img_lock);
...@@ -933,13 +892,12 @@ static int camera_core_resume(struct platform_device *pdev) ...@@ -933,13 +892,12 @@ static int camera_core_resume(struct platform_device *pdev)
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static struct file_operations camera_core_fops = static struct file_operations camera_core_fops = {
{
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.read = camera_core_read, .read = camera_core_read,
.poll = camera_core_poll, .poll = camera_core_poll,
.ioctl = camera_core_ioctl, .ioctl = video_ioctl2,
.mmap = camera_core_mmap, .mmap = camera_core_mmap,
.open = camera_core_open, .open = camera_core_open,
.release = camera_core_release, .release = camera_core_release,
...@@ -980,6 +938,27 @@ static int __init camera_core_probe(struct platform_device *pdev) ...@@ -980,6 +938,27 @@ static int __init camera_core_probe(struct platform_device *pdev)
video_set_drvdata(vfd, cam); video_set_drvdata(vfd, cam);
vfd->minor = -1; vfd->minor = -1;
vfd->vidioc_querycap = vidioc_querycap;
vfd->vidioc_enum_fmt_cap = vidioc_enum_fmt_cap;
vfd->vidioc_g_fmt_cap = vidioc_g_fmt_cap;
vfd->vidioc_s_fmt_cap = vidioc_s_fmt_cap;
vfd->vidioc_try_fmt_cap = vidioc_try_fmt_cap;
vfd->vidioc_reqbufs = vidioc_reqbufs;
vfd->vidioc_querybuf = vidioc_querybuf;
vfd->vidioc_qbuf = vidioc_qbuf;
vfd->vidioc_dqbuf = vidioc_dqbuf;
vfd->vidioc_streamon = vidioc_streamon;
vfd->vidioc_streamoff = vidioc_streamoff;
vfd->vidioc_enum_input = vidioc_enum_input;
vfd->vidioc_g_input = vidioc_g_input;
vfd->vidioc_s_input = vidioc_s_input;
vfd->vidioc_queryctrl = vidioc_queryctrl;
vfd->vidioc_g_ctrl = vidioc_g_ctrl;
vfd->vidioc_s_ctrl = vidioc_s_ctrl;
vfd->vidioc_g_fbuf = vidioc_g_fbuf;
vfd->vidioc_s_fbuf = vidioc_s_fbuf;
vfd->vidioc_overlay = vidioc_overlay;
/* initialize the videobuf queue ops */ /* initialize the videobuf queue ops */
cam->vbq_ops.buf_setup = camera_core_vbq_setup; cam->vbq_ops.buf_setup = camera_core_vbq_setup;
cam->vbq_ops.buf_prepare = camera_core_vbq_prepare; cam->vbq_ops.buf_prepare = camera_core_vbq_prepare;
...@@ -988,8 +967,7 @@ static int __init camera_core_probe(struct platform_device *pdev) ...@@ -988,8 +967,7 @@ static int __init camera_core_probe(struct platform_device *pdev)
/* initilize the overlay interface */ /* initilize the overlay interface */
cam->overlay_size = overlay_mem; cam->overlay_size = overlay_mem;
if (cam->overlay_size > 0) if (cam->overlay_size > 0) {
{
cam->overlay_base = (unsigned long) dma_alloc_coherent(NULL, cam->overlay_base = (unsigned long) dma_alloc_coherent(NULL,
cam->overlay_size, cam->overlay_size,
(dma_addr_t *) &cam->overlay_base_phys, (dma_addr_t *) &cam->overlay_base_phys,
...@@ -1184,4 +1162,3 @@ MODULE_PARM_DESC(capture_mem, ...@@ -1184,4 +1162,3 @@ MODULE_PARM_DESC(capture_mem,
module_init(camera_core_init); module_init(camera_core_init);
module_exit(camera_core_cleanup); module_exit(camera_core_cleanup);
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