summaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-05-23 11:07:05 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-28 00:55:38 +0400
commitfa4d7096d1fb7c012ebaacefee132007a21e0965 (patch)
treeb33643476d3df4c675b7edaada6a0f35d3837272 /drivers/media/video/v4l2-common.c
parent1de5be5e91ee10d8f42be2aebc1cede718b48d50 (diff)
downloadlinux-fa4d7096d1fb7c012ebaacefee132007a21e0965.tar.xz
[media] v4l2-ctrls: add new bitmask control type
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 06b9f9f82013..5c6100fb4072 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -105,6 +105,9 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
menu_items[ctrl->value][0] == '\0')
return -EINVAL;
}
+ if (qctrl->type == V4L2_CTRL_TYPE_BITMASK &&
+ (ctrl->value & ~qctrl->maximum))
+ return -ERANGE;
return 0;
}
EXPORT_SYMBOL(v4l2_ctrl_check);