aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-subdev.c
diff options
context:
space:
mode:
authorAntti Koskipaa <akoskipa@gmail.com>2010-06-23 04:03:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:53:33 -0400
commitf6a5cb1be894468cdc69ec557d47f40c28f64642 (patch)
tree57518c84f343f0205a568c5333f5b5ead7c38ff8 /drivers/media/video/v4l2-subdev.c
parent35c3017a29d278c4405a7f3ab30b814999d156d3 (diff)
[media] v4l: v4l2_subdev userspace crop API
This patch adds the VIDIOC_SUBDEV_S_CROP and G_CROP ioctls to the userland API. CROPCAP is not implemented because it's redundant. Signed-off-by: Antti Koskipaa <akoskipa@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-subdev.c')
-rw-r--r--drivers/media/video/v4l2-subdev.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
index a4a12563ec3c..6e76f734c780 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -213,6 +213,32 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
213 return v4l2_subdev_call(sd, pad, set_fmt, subdev_fh, format); 213 return v4l2_subdev_call(sd, pad, set_fmt, subdev_fh, format);
214 } 214 }
215 215
216 case VIDIOC_SUBDEV_G_CROP: {
217 struct v4l2_subdev_crop *crop = arg;
218
219 if (crop->which != V4L2_SUBDEV_FORMAT_TRY &&
220 crop->which != V4L2_SUBDEV_FORMAT_ACTIVE)
221 return -EINVAL;
222
223 if (crop->pad >= sd->entity.num_pads)
224 return -EINVAL;
225
226 return v4l2_subdev_call(sd, pad, get_crop, subdev_fh, crop);
227 }
228
229 case VIDIOC_SUBDEV_S_CROP: {
230 struct v4l2_subdev_crop *crop = arg;
231
232 if (crop->which != V4L2_SUBDEV_FORMAT_TRY &&
233 crop->which != V4L2_SUBDEV_FORMAT_ACTIVE)
234 return -EINVAL;
235
236 if (crop->pad >= sd->entity.num_pads)
237 return -EINVAL;
238
239 return v4l2_subdev_call(sd, pad, set_crop, subdev_fh, crop);
240 }
241
216 case VIDIOC_SUBDEV_ENUM_MBUS_CODE: { 242 case VIDIOC_SUBDEV_ENUM_MBUS_CODE: {
217 struct v4l2_subdev_mbus_code_enum *code = arg; 243 struct v4l2_subdev_mbus_code_enum *code = arg;
218 244