aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/media-device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/media-device.h')
-rw-r--r--include/media/media-device.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 30857f7fc22b..a8390fe87e83 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -25,8 +25,10 @@
25 25
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/spinlock.h>
28 29
29#include <media/media-devnode.h> 30#include <media/media-devnode.h>
31#include <media/media-entity.h>
30 32
31/** 33/**
32 * struct media_device - Media device 34 * struct media_device - Media device
@@ -37,6 +39,9 @@
37 * @bus_info: Unique and stable device location identifier 39 * @bus_info: Unique and stable device location identifier
38 * @hw_revision: Hardware device revision 40 * @hw_revision: Hardware device revision
39 * @driver_version: Device driver version 41 * @driver_version: Device driver version
42 * @entity_id: ID of the next entity to be registered
43 * @entities: List of registered entities
44 * @lock: Entities list lock
40 * 45 *
41 * This structure represents an abstract high-level media device. It allows easy 46 * This structure represents an abstract high-level media device. It allows easy
42 * access to entities and provides basic media device-level support. The 47 * access to entities and provides basic media device-level support. The
@@ -58,6 +63,12 @@ struct media_device {
58 char bus_info[32]; 63 char bus_info[32];
59 u32 hw_revision; 64 u32 hw_revision;
60 u32 driver_version; 65 u32 driver_version;
66
67 u32 entity_id;
68 struct list_head entities;
69
70 /* Protects the entities list */
71 spinlock_t lock;
61}; 72};
62 73
63/* media_devnode to media_device */ 74/* media_devnode to media_device */
@@ -66,4 +77,12 @@ struct media_device {
66int __must_check media_device_register(struct media_device *mdev); 77int __must_check media_device_register(struct media_device *mdev);
67void media_device_unregister(struct media_device *mdev); 78void media_device_unregister(struct media_device *mdev);
68 79
80int __must_check media_device_register_entity(struct media_device *mdev,
81 struct media_entity *entity);
82void media_device_unregister_entity(struct media_entity *entity);
83
84/* Iterate over all entities. */
85#define media_device_for_each_entity(entity, mdev) \
86 list_for_each_entry(entity, &(mdev)->entities, list)
87
69#endif 88#endif