summaryrefslogtreecommitdiffstats
path: root/drivers/media/media-device.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-03-07 15:04:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 04:53:12 -0300
commit503c3d829eaf48837dd5bff5d97ad66369bb955a (patch)
tree9c14ed9561c5ffca07909e53d5ae0e52cdf5f99e /drivers/media/media-device.c
parenta5ccc48a7c48610e7f92fa599406738d69195d51 (diff)
downloadblackbird-obmc-linux-503c3d829eaf48837dd5bff5d97ad66369bb955a.tar.gz
blackbird-obmc-linux-503c3d829eaf48837dd5bff5d97ad66369bb955a.zip
[media] media: Entity use count
Due to the wide differences between drivers regarding power management needs, the media controller does not implement power management. However, the media_entity structure includes a use_count field that media drivers can use to track the number of users of every entity for power management needs. The use_count field is owned by media drivers and must not be touched by entity drivers. Access to the field must be protected by the media device graph_mutex lock. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r--drivers/media/media-device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index a36509a1df09..d2bc809d7a2a 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -73,6 +73,7 @@ int __must_check media_device_register(struct media_device *mdev)
mdev->entity_id = 1;
INIT_LIST_HEAD(&mdev->entities);
spin_lock_init(&mdev->lock);
+ mutex_init(&mdev->graph_mutex);
/* Register the device node. */
mdev->devnode.fops = &media_device_fops;
OpenPOWER on IntegriCloud