]> asedeno.scripts.mit.edu Git - linux.git/commit
media: v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 10 Jul 2018 08:00:53 +0000 (04:00 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 15:13:09 +0000 (11:13 -0400)
commit5f611d74c2bd89296aa045609df0e5309ff7ab41
treea0cbd5fb28148dff19e8616a7c7e3d8ce79ab373
parentc41e9cff704a06b8cbd9eeea0fdec54fb6d13825
media: v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

If a driver needs to find/inspect the controls set in a request then
it can use these functions.

E.g. to check if a required control is set in a request use this in the
req_validate() implementation:

int res = -EINVAL;

hdl = v4l2_ctrl_request_hdl_find(req, parent_hdl);
if (hdl) {
if (v4l2_ctrl_request_hdl_ctrl_find(hdl, ctrl_id))
res = 0;
v4l2_ctrl_request_hdl_put(hdl);
}
return res;

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-ctrls.c
include/media/v4l2-ctrls.h