diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-12-29 11:36:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 15:37:56 -0400 |
commit | fc5602be7ca5b55174c5d6595089718779b28dfa (patch) | |
tree | 135b5632bb714d8786abb1a96fe50d7dd5a794a3 | |
parent | 0f62fd6a2fa12d6a63cbb18f9e30b05345f636f6 (diff) |
[media] v4l2-fh: implement v4l2_priority support
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/v4l2-fh.c | 4 | ||||
-rw-r--r-- | include/media/v4l2-fh.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-fh.c b/drivers/media/video/v4l2-fh.c index d78f184f40c5..78a1608a09d6 100644 --- a/drivers/media/video/v4l2-fh.c +++ b/drivers/media/video/v4l2-fh.c | |||
@@ -33,6 +33,8 @@ int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev) | |||
33 | fh->vdev = vdev; | 33 | fh->vdev = vdev; |
34 | INIT_LIST_HEAD(&fh->list); | 34 | INIT_LIST_HEAD(&fh->list); |
35 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); | 35 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); |
36 | fh->prio = V4L2_PRIORITY_UNSET; | ||
37 | BUG_ON(vdev->prio == NULL); | ||
36 | 38 | ||
37 | /* | 39 | /* |
38 | * fh->events only needs to be initialized if the driver | 40 | * fh->events only needs to be initialized if the driver |
@@ -51,6 +53,7 @@ void v4l2_fh_add(struct v4l2_fh *fh) | |||
51 | { | 53 | { |
52 | unsigned long flags; | 54 | unsigned long flags; |
53 | 55 | ||
56 | v4l2_prio_open(fh->vdev->prio, &fh->prio); | ||
54 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 57 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
55 | list_add(&fh->list, &fh->vdev->fh_list); | 58 | list_add(&fh->list, &fh->vdev->fh_list); |
56 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 59 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
@@ -64,6 +67,7 @@ void v4l2_fh_del(struct v4l2_fh *fh) | |||
64 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 67 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
65 | list_del_init(&fh->list); | 68 | list_del_init(&fh->list); |
66 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 69 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
70 | v4l2_prio_close(fh->vdev->prio, fh->prio); | ||
67 | } | 71 | } |
68 | EXPORT_SYMBOL_GPL(v4l2_fh_del); | 72 | EXPORT_SYMBOL_GPL(v4l2_fh_del); |
69 | 73 | ||
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 1d72dde320bf..5fc5ba96e1d2 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h | |||
@@ -35,6 +35,7 @@ struct v4l2_fh { | |||
35 | struct list_head list; | 35 | struct list_head list; |
36 | struct video_device *vdev; | 36 | struct video_device *vdev; |
37 | struct v4l2_events *events; /* events, pending and subscribed */ | 37 | struct v4l2_events *events; /* events, pending and subscribed */ |
38 | enum v4l2_priority prio; | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | /* | 41 | /* |