aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-01-27 14:18:42 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-02-14 13:38:43 -0500
commita26243b0e3726d2b39dc23dd2c8717c52a286af4 (patch)
tree478ea3c96e683a29a937746c853f5dcf4d323f03 /include/media
parent42194e728f067cde09a95ce522c108756d44c0be (diff)
[media] v4l2-ctrls: add helper functions for control events
Many drivers just support control events, and most radio drivers just need to poll for control events. Add some functions to simplify those jobs. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-ctrls.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 5f246c277ff..3dbd0663850 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -33,6 +33,7 @@ struct video_device;
33struct v4l2_subdev; 33struct v4l2_subdev;
34struct v4l2_subscribed_event; 34struct v4l2_subscribed_event;
35struct v4l2_fh; 35struct v4l2_fh;
36struct poll_table_struct;
36 37
37/** struct v4l2_ctrl_ops - The control operations that the driver has to provide. 38/** struct v4l2_ctrl_ops - The control operations that the driver has to provide.
38 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant 39 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant
@@ -496,6 +497,14 @@ void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
496 associated with the filehandle. */ 497 associated with the filehandle. */
497int v4l2_ctrl_log_status(struct file *file, void *fh); 498int v4l2_ctrl_log_status(struct file *file, void *fh);
498 499
500/* Can be used as a vidioc_subscribe_event function that just subscribes
501 control events. */
502int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
503 struct v4l2_event_subscription *sub);
504
505/* Can be used as a poll function that just polls for control events. */
506unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait);
507
499/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ 508/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */
500int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); 509int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
501int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); 510int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm);