aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-06-13 17:55:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:31 -0400
commit77068d36d8b9e9902a89b4bb01011d41926f5420 (patch)
tree4fde4974ce56e52acac5c7c8d873d300e946adcc /include/media
parent523f46d6aba9dcb0a2d0fc474ca884e93a7cf198 (diff)
[media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event
The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control would know which filehandles subscribed to it. However, it is much easier to use struct v4l2_subscribed_event directly for that and get rid of that intermediate struct. 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.h17
-rw-r--r--include/media/v4l2-event.h9
2 files changed, 16 insertions, 10 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 8f08c6edf509..a15e9098f98b 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -31,6 +31,7 @@ struct v4l2_ctrl;
31struct video_device; 31struct video_device;
32struct v4l2_subdev; 32struct v4l2_subdev;
33struct v4l2_event_subscription; 33struct v4l2_event_subscription;
34struct v4l2_subscribed_event;
34struct v4l2_fh; 35struct v4l2_fh;
35 36
36/** struct v4l2_ctrl_ops - The control operations that the driver has to provide. 37/** struct v4l2_ctrl_ops - The control operations that the driver has to provide.
@@ -53,6 +54,7 @@ struct v4l2_ctrl_ops {
53 54
54/** struct v4l2_ctrl - The control structure. 55/** struct v4l2_ctrl - The control structure.
55 * @node: The list node. 56 * @node: The list node.
57 * @ev_subs: The list of control event subscriptions.
56 * @handler: The handler that owns the control. 58 * @handler: The handler that owns the control.
57 * @cluster: Point to start of cluster array. 59 * @cluster: Point to start of cluster array.
58 * @ncontrols: Number of controls in cluster array. 60 * @ncontrols: Number of controls in cluster array.
@@ -108,7 +110,7 @@ struct v4l2_ctrl_ops {
108struct v4l2_ctrl { 110struct v4l2_ctrl {
109 /* Administrative fields */ 111 /* Administrative fields */
110 struct list_head node; 112 struct list_head node;
111 struct list_head fhs; 113 struct list_head ev_subs;
112 struct v4l2_ctrl_handler *handler; 114 struct v4l2_ctrl_handler *handler;
113 struct v4l2_ctrl **cluster; 115 struct v4l2_ctrl **cluster;
114 unsigned ncontrols; 116 unsigned ncontrols;
@@ -184,11 +186,6 @@ struct v4l2_ctrl_handler {
184 int error; 186 int error;
185}; 187};
186 188
187struct v4l2_ctrl_fh {
188 struct list_head node;
189 struct v4l2_fh *fh;
190};
191
192/** struct v4l2_ctrl_config - Control configuration structure. 189/** struct v4l2_ctrl_config - Control configuration structure.
193 * @ops: The control ops. 190 * @ops: The control ops.
194 * @id: The control ID. 191 * @id: The control ID.
@@ -497,10 +494,10 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
497int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); 494int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
498 495
499/* Internal helper functions that deal with control events. */ 496/* Internal helper functions that deal with control events. */
500void v4l2_ctrl_add_fh(struct v4l2_ctrl_handler *hdl, 497void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
501 struct v4l2_ctrl_fh *ctrl_fh, 498 struct v4l2_subscribed_event *sev);
502 struct v4l2_event_subscription *sub); 499void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
503void v4l2_ctrl_del_fh(struct v4l2_ctrl *ctrl, struct v4l2_fh *fh); 500 struct v4l2_subscribed_event *sev);
504 501
505/** v4l2_ctrl_subscribe_fh() - Helper function that subscribes a control event. 502/** v4l2_ctrl_subscribe_fh() - Helper function that subscribes a control event.
506 * @fh: The file handler that subscribed the control event. 503 * @fh: The file handler that subscribed the control event.
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 042b893035de..eda17f8d78bc 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -38,9 +38,18 @@ struct v4l2_kevent {
38}; 38};
39 39
40struct v4l2_subscribed_event { 40struct v4l2_subscribed_event {
41 /* list node for the v4l2_fh->subscribed list */
41 struct list_head list; 42 struct list_head list;
43 /* event type */
42 u32 type; 44 u32 type;
45 /* associated object ID (e.g. control ID) */
43 u32 id; 46 u32 id;
47 /* copy of v4l2_event_subscription->flags */
48 u32 flags;
49 /* filehandle that subscribed to this event */
50 struct v4l2_fh *fh;
51 /* list node that hooks into the object's event list (if there is one) */
52 struct list_head node;
44}; 53};
45 54
46int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); 55int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n);