summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-subdev.c
diff options
context:
space:
mode:
authorHans Verkuil2014-02-10 12:08:44 +0100
committerMauro Carvalho Chehab2014-02-24 14:57:14 +0100
commitab58a30162f0383c06388af522bc889a5da38fc6 (patch)
tree610feb6fafb2f7a567f85627ef666c4b83804d02 /drivers/media/v4l2-core/v4l2-subdev.c
parent[media] radio-usb-si4713: make array of structs const (diff)
downloadkernel-qcow2-linux-ab58a30162f0383c06388af522bc889a5da38fc6.tar.gz
kernel-qcow2-linux-ab58a30162f0383c06388af522bc889a5da38fc6.tar.xz
kernel-qcow2-linux-ab58a30162f0383c06388af522bc889a5da38fc6.zip
[media] v4l2-subdev: Allow 32-bit compat ioctls
Add support for 32-bit ioctls with v4l-subdev device nodes. Rather than keep adding new ioctls to the list in v4l2-compat-ioctl32.c, just check if the ioctl is a non-private V4L2 ioctl and if so, call the conversion code. We keep forgetting to add new ioctls, so this is a more robust solution. In addition extend the subdev API with support for a compat32 function to convert custom v4l-subdev ioctls. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-subdev.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-subdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 996c248dea42..60d2550c9ac8 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -368,6 +368,17 @@ static long subdev_ioctl(struct file *file, unsigned int cmd,
return video_usercopy(file, cmd, arg, subdev_do_ioctl);
}
+#ifdef CONFIG_COMPAT
+static long subdev_compat_ioctl32(struct file *file, unsigned int cmd,
+ unsigned long arg)
+{
+ struct video_device *vdev = video_devdata(file);
+ struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
+
+ return v4l2_subdev_call(sd, core, compat_ioctl32, cmd, arg);
+}
+#endif
+
static unsigned int subdev_poll(struct file *file, poll_table *wait)
{
struct video_device *vdev = video_devdata(file);
@@ -389,6 +400,9 @@ const struct v4l2_file_operations v4l2_subdev_fops = {
.owner = THIS_MODULE,
.open = subdev_open,
.unlocked_ioctl = subdev_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl32 = subdev_compat_ioctl32,
+#endif
.release = subdev_close,
.poll = subdev_poll,
};