Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 016527d3f47e8ca96edee80b2bb00497d5535379 Mon Sep 17 00:00:00 2001
- From: Florian Vaussard <[hidden email]>
- Date: Wed, 14 Mar 2012 16:08:00 +0100
- Subject: [PATCH] Adding missing ioctl's
- ---
- drivers/media/video/omap3isp/ispvideo.c | 46
- +++++++++++++++++++++++++++++++
- 1 files changed, 46 insertions(+), 0 deletions(-)
- diff --git a/drivers/media/video/omap3isp/ispvideo.c
- b/drivers/media/video/omap3isp/ispvideo.c
- index 1452b3a..a15e396 100644
- --- a/drivers/media/video/omap3isp/ispvideo.c
- +++ b/drivers/media/video/omap3isp/ispvideo.c
- @@ -733,6 +733,36 @@ isp_video_get_format(struct file *file, void *fh,
- struct
- v4l2_format *format)
- }
- static int
- +isp_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc
- *fmtdesc)
- +{
- + struct isp_video_fh *vfh = to_isp_video_fh(fh);
- + struct isp_video *video = video_drvdata(file);
- +
- + if (fmtdesc->index)
- + {
- +// printk(KERN_ERR "%s: invalid index (%d)\n",__func__,
- fmtdesc->index);
- + return -EINVAL;
- + }
- +
- + if (fmtdesc->type != video->type)
- + {
- +// printk(KERN_ERR "%s: invalid type (%d). Current type:
- %d\n",__func__, fmtdesc->type, video->type);
- + return -EINVAL;
- + }
- +
- + // ***Ugly hack***
- + fmtdesc->flags = 0;
- + fmtdesc->description[0] = 'U';
- + fmtdesc->description[1] = 'Y';
- + fmtdesc->description[2] = 'V';
- + fmtdesc->description[3] = 'Y';
- + fmtdesc->description[4] = '0';
- + fmtdesc->pixelformat = V4L2_PIX_FMT_UYVY;
- +
- + return 0;
- +}
- +
- +static int
- isp_video_set_format(struct file *file, void *fh, struct v4l2_format
- *format)
- {
- struct isp_video_fh *vfh = to_isp_video_fh(fh);
- @@ -765,6 +795,8 @@ isp_video_try_format(struct file *file, void *fh, struct
- v4l2_format *format)
- u32 pad;
- int ret;
- +// printk(KERN_ERR "%s: Trying format %d\n",__func__,
- format->fmt.pix.pixelformat);
- +
- if (format->type != video->type)
- return -EINVAL;
- @@ -1158,8 +1190,21 @@ isp_video_s_input(struct file *file, void *fh,
- unsigned
- int input)
- return input == 0 ? 0 : -EINVAL;
- }
- +static int
- +isp_video_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl
- *queryctrl)
- +{
- +// printk(KERN_ERR "%s: querry id (%d)\n",__func__, queryctrl->id);
- +// printk(KERN_ERR "%s: querry type (%d)\n",__func__, queryctrl->type);
- +
- + if (queryctrl->id < V4L2_CID_BASE)
- + return -EDOM;
- +
- + return -EINVAL;
- +}
- +
- static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
- .vidioc_querycap = isp_video_querycap,
- + .vidioc_enum_fmt_vid_cap = isp_video_enum_format,
- .vidioc_g_fmt_vid_cap = isp_video_get_format,
- .vidioc_s_fmt_vid_cap = isp_video_set_format,
- .vidioc_try_fmt_vid_cap = isp_video_try_format,
- @@ -1180,6 +1225,7 @@ static const struct v4l2_ioctl_ops
- isp_video_ioctl_ops = {
- .vidioc_enum_input = isp_video_enum_input,
- .vidioc_g_input = isp_video_g_input,
- .vidioc_s_input = isp_video_s_input,
- + .vidioc_queryctrl = isp_video_queryctrl,
- };
- /*
- -----------------------------------------------------------------------------
- --
- 1.7.5.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement