Commit d87cdb88 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media-device: export the entity function via new ioctl

Now that entities have a main function, expose it via
MEDIA_IOC_G_TOPOLOGY ioctl.

Please notice that some entities may have secundary functions.
Such use case will be addressed later, when we add support for the
Media Controller properties.
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 0e576b76
...@@ -263,6 +263,7 @@ static long __media_device_get_topology(struct media_device *mdev, ...@@ -263,6 +263,7 @@ static long __media_device_get_topology(struct media_device *mdev,
/* Copy fields to userspace struct if not error */ /* Copy fields to userspace struct if not error */
memset(&uentity, 0, sizeof(uentity)); memset(&uentity, 0, sizeof(uentity));
uentity.id = entity->graph_obj.id; uentity.id = entity->graph_obj.id;
uentity.function = entity->function;
strncpy(uentity.name, entity->name, strncpy(uentity.name, entity->name,
sizeof(uentity.name)); sizeof(uentity.name));
......
...@@ -276,7 +276,8 @@ struct media_links_enum { ...@@ -276,7 +276,8 @@ struct media_links_enum {
struct media_v2_entity { struct media_v2_entity {
__u32 id; __u32 id;
char name[64]; /* FIXME: move to a property? (RFC says so) */ char name[64]; /* FIXME: move to a property? (RFC says so) */
__u16 reserved[14]; __u32 function; /* Main function of the entity */
__u16 reserved[12];
}; };
/* Should match the specific fields at media_intf_devnode */ /* Should match the specific fields at media_intf_devnode */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment