diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-12-09 14:39:54 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 02:32:42 +0300 |
commit | ea8aa4349e11c62242a8908fc172de27d7a151d7 (patch) | |
tree | b079fb17ea30defa24b394daac41679074a5a690 /drivers/media/video/v4l2-subdev.c | |
parent | 3dd5ee0801ee10e5632b40fd8d0495417b32910a (diff) | |
download | linux-ea8aa4349e11c62242a8908fc172de27d7a151d7.tar.xz |
[media] v4l: subdev: Control ioctls support
Pass the control-related ioctls to the subdev driver through the control
framework.
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c index 460b33697c9b..da10430051c0 100644 --- a/drivers/media/video/v4l2-subdev.c +++ b/drivers/media/video/v4l2-subdev.c @@ -24,6 +24,7 @@ #include <linux/ioctl.h> #include <linux/videodev2.h> +#include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> @@ -39,7 +40,31 @@ static int subdev_close(struct file *file) static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) { + struct video_device *vdev = video_devdata(file); + struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev); + switch (cmd) { + case VIDIOC_QUERYCTRL: + return v4l2_subdev_queryctrl(sd, arg); + + case VIDIOC_QUERYMENU: + return v4l2_subdev_querymenu(sd, arg); + + case VIDIOC_G_CTRL: + return v4l2_subdev_g_ctrl(sd, arg); + + case VIDIOC_S_CTRL: + return v4l2_subdev_s_ctrl(sd, arg); + + case VIDIOC_G_EXT_CTRLS: + return v4l2_subdev_g_ext_ctrls(sd, arg); + + case VIDIOC_S_EXT_CTRLS: + return v4l2_subdev_s_ext_ctrls(sd, arg); + + case VIDIOC_TRY_EXT_CTRLS: + return v4l2_subdev_try_ext_ctrls(sd, arg); + default: return -ENOIOCTLCMD; } |