aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-02-24 08:42:24 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 15:37:55 -0400
commit0f62fd6a2fa12d6a63cbb18f9e30b05345f636f6 (patch)
treeb5963e3b4a5e859949f0f76b96c58c503a30efa4 /drivers/media/video
parent022654930891c7ddfdb1ea34d6c4af9d1096bf91 (diff)
[media] v4l2: add v4l2_prio_state to v4l2_device and video_device
Integrate the v4l2_prio_state into the core, ready for use. One struct v4l2_prio_state is added to v4l2_device and a pointer to a prio state is added to video_device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/v4l2-dev.c6
-rw-r--r--drivers/media/video/v4l2-device.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 65d546f35ef..6b1ef85d8cc 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -573,6 +573,12 @@ int __video_register_device(struct video_device *vdev, int type, int nr,
573 vdev->parent = vdev->v4l2_dev->dev; 573 vdev->parent = vdev->v4l2_dev->dev;
574 if (vdev->ctrl_handler == NULL) 574 if (vdev->ctrl_handler == NULL)
575 vdev->ctrl_handler = vdev->v4l2_dev->ctrl_handler; 575 vdev->ctrl_handler = vdev->v4l2_dev->ctrl_handler;
576 /* If the prio state pointer is NULL, and if the driver doesn't
577 handle priorities itself, then use the v4l2_device prio
578 state. */
579 if (vdev->prio == NULL && vdev->ioctl_ops &&
580 vdev->ioctl_ops->vidioc_s_priority == NULL)
581 vdev->prio = &vdev->v4l2_dev->prio;
576 } 582 }
577 583
578 /* Part 2: find a free minor, device node number and device index. */ 584 /* Part 2: find a free minor, device node number and device index. */
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
index a1afda352d0..fd7a445ce34 100644
--- a/drivers/media/video/v4l2-device.c
+++ b/drivers/media/video/v4l2-device.c
@@ -36,6 +36,7 @@ int v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev)
36 INIT_LIST_HEAD(&v4l2_dev->subdevs); 36 INIT_LIST_HEAD(&v4l2_dev->subdevs);
37 spin_lock_init(&v4l2_dev->lock); 37 spin_lock_init(&v4l2_dev->lock);
38 mutex_init(&v4l2_dev->ioctl_lock); 38 mutex_init(&v4l2_dev->ioctl_lock);
39 v4l2_prio_init(&v4l2_dev->prio);
39 v4l2_dev->dev = dev; 40 v4l2_dev->dev = dev;
40 if (dev == NULL) { 41 if (dev == NULL) {
41 /* If dev == NULL, then name must be filled in by the caller */ 42 /* If dev == NULL, then name must be filled in by the caller */