• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/media/video/

Lines Matching defs:fh

26 #include <media/v4l2-fh.h>
32 int v4l2_event_init(struct v4l2_fh *fh)
34 fh->events = kzalloc(sizeof(*fh->events), GFP_KERNEL);
35 if (fh->events == NULL)
38 init_waitqueue_head(&fh->events->wait);
40 INIT_LIST_HEAD(&fh->events->free);
41 INIT_LIST_HEAD(&fh->events->available);
42 INIT_LIST_HEAD(&fh->events->subscribed);
44 fh->events->sequence = -1;
50 int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n)
52 struct v4l2_events *events = fh->events;
67 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
70 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
85 void v4l2_event_free(struct v4l2_fh *fh)
87 struct v4l2_events *events = fh->events;
97 fh->events = NULL;
101 static int __v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event)
103 struct v4l2_events *events = fh->events;
107 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
110 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
123 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
128 int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event,
131 struct v4l2_events *events = fh->events;
135 return __v4l2_event_dequeue(fh, event);
143 ret = __v4l2_event_dequeue(fh, event);
150 /* Caller must hold fh->event->lock! */
152 struct v4l2_fh *fh, u32 type)
154 struct v4l2_events *events = fh->events;
157 assert_spin_locked(&fh->vdev->fh_lock);
169 struct v4l2_fh *fh;
177 list_for_each_entry(fh, &vdev->fh_list, list) {
178 struct v4l2_events *events = fh->events;
182 if (!v4l2_event_subscribed(fh, ev->type))
185 /* Increase event sequence number on fh. */
209 int v4l2_event_pending(struct v4l2_fh *fh)
211 return fh->events->navailable;
215 int v4l2_event_subscribe(struct v4l2_fh *fh,
218 struct v4l2_events *events = fh->events;
222 if (fh->events == NULL) {
231 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
233 if (v4l2_event_subscribed(fh, sub->type) == NULL) {
241 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
249 static void v4l2_event_unsubscribe_all(struct v4l2_fh *fh)
251 struct v4l2_events *events = fh->events;
258 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
264 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
269 int v4l2_event_unsubscribe(struct v4l2_fh *fh,
276 v4l2_event_unsubscribe_all(fh);
280 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
282 sev = v4l2_event_subscribed(fh, sub->type);
286 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);