summaryrefslogtreecommitdiffstats
path: root/include/media/media-device.h
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2015-12-16 14:44:32 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 15:19:17 +0100
commitc8d54cd53b43c514fbd8d36abf0f2f00f719dd54 (patch)
tree7e2f2f38d49fcedadf4b37ad6a173cf3c5bc4b26 /include/media/media-device.h
parent[media] media: Introduce internal index for media entities (diff)
downloadlinux-c8d54cd53b43c514fbd8d36abf0f2f00f719dd54.tar.xz
linux-c8d54cd53b43c514fbd8d36abf0f2f00f719dd54.zip
[media] media: Add an API to manage entity enumerations
This is useful in e.g. knowing whether certain operations have already been performed for an entity. The users include the framework itself (for graph walking) and a number of drivers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media/media-device.h')
-rw-r--r--include/media/media-device.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 2ab4e6803842..da4e12ca259c 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -342,6 +342,21 @@ struct media_device {
#define to_media_device(node) container_of(node, struct media_device, devnode)
/**
+ * media_entity_enum_init - Initialise an entity enumeration
+ *
+ * @e: Entity enumeration to be initialised
+ * @mdev: The related media device
+ *
+ * Returns zero on success or a negative error code.
+ */
+static inline __must_check int media_entity_enum_init(
+ struct media_entity_enum *ent_enum, struct media_device *mdev)
+{
+ return __media_entity_enum_init(ent_enum,
+ mdev->entity_internal_idx_max + 1);
+}
+
+/**
* media_device_init() - Initializes a media device element
*
* @mdev: pointer to struct &media_device