Lines Matching defs:fh

3  * v4l2-fh.c
16 #include <media/v4l2-fh.h>
21 void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
23 fh->vdev = vdev;
25 fh->ctrl_handler = vdev->ctrl_handler;
26 INIT_LIST_HEAD(&fh->list);
27 set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags);
35 fh->prio = V4L2_PRIORITY_UNSET;
36 init_waitqueue_head(&fh->wait);
37 INIT_LIST_HEAD(&fh->available);
38 INIT_LIST_HEAD(&fh->subscribed);
39 fh->sequence = -1;
40 mutex_init(&fh->subscribe_lock);
44 void v4l2_fh_add(struct v4l2_fh *fh)
48 v4l2_prio_open(fh->vdev->prio, &fh->prio);
49 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
50 list_add(&fh->list, &fh->vdev->fh_list);
51 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
58 struct v4l2_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL);
60 filp->private_data = fh;
61 if (fh == NULL)
63 v4l2_fh_init(fh, vdev);
64 v4l2_fh_add(fh);
69 void v4l2_fh_del(struct v4l2_fh *fh)
73 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
74 list_del_init(&fh->list);
75 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
76 v4l2_prio_close(fh->vdev->prio, fh->prio);
80 void v4l2_fh_exit(struct v4l2_fh *fh)
82 if (fh->vdev == NULL)
84 v4l_disable_media_source(fh->vdev);
85 v4l2_event_unsubscribe_all(fh);
86 mutex_destroy(&fh->subscribe_lock);
87 fh->vdev = NULL;
93 struct v4l2_fh *fh = filp->private_data;
95 if (fh) {
96 v4l2_fh_del(fh);
97 v4l2_fh_exit(fh);
98 kfree(fh);
105 int v4l2_fh_is_singular(struct v4l2_fh *fh)
110 if (fh == NULL || fh->vdev == NULL)
112 spin_lock_irqsave(&fh->vdev->fh_lock, flags);
113 is_singular = list_is_singular(&fh->list);
114 spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);