summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-07 16:36:25 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 17:18:47 +0300
commit86e2662071d6f26704bb290317746149ce07be7a (patch)
treedc501c1fde47a4f21d98c506cee2d47df79fdcd9 /include/media
parent3c0e266fba5897c02c4bd23521a3271d338650ad (diff)
downloadlinux-86e2662071d6f26704bb290317746149ce07be7a.tar.xz
[media] media: add support to link interfaces and entities
Now that we have a new graph object called "interfaces", we need to be able to link them to the entities. Add a linked list to the interfaces to allow them to be linked to the entities. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-entity.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index a7b21a7f4c64..d64e8cb4de98 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -78,10 +78,12 @@ struct media_link {
union {
struct media_gobj *gobj0;
struct media_pad *source;
+ struct media_interface *intf;
};
union {
struct media_gobj *gobj1;
struct media_pad *sink;
+ struct media_entity *entity;
};
struct media_link *reverse; /* Link in the reverse direction */
unsigned long flags; /* Link flags (MEDIA_LNK_FL_*) */
@@ -154,6 +156,7 @@ struct media_entity {
* struct media_intf_devnode - Define a Kernel API interface
*
* @graph_obj: embedded graph object
+ * @links: List of links pointing to graph entities
* @type: Type of the interface as defined at the
* uapi/media/media.h header, e. g.
* MEDIA_INTF_T_*
@@ -161,6 +164,7 @@ struct media_entity {
*/
struct media_interface {
struct media_gobj graph_obj;
+ struct list_head links;
u32 type;
u32 flags;
};
@@ -290,6 +294,11 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev,
u32 major, u32 minor,
gfp_t gfp_flags);
void media_devnode_remove(struct media_intf_devnode *devnode);
+struct media_link *media_create_intf_link(struct media_entity *entity,
+ struct media_interface *intf,
+ u32 flags);
+void media_remove_intf_link(struct media_link *link);
+
#define media_entity_call(entity, operation, args...) \
(((entity)->ops && (entity)->ops->operation) ? \
(entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)