[media] media-device: export the entity function via new ioctl
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 6 Sep 2015 13:59:08 +0000 (10:59 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:01 +0000 (12:19 -0200)
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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/media-device.c
include/uapi/linux/media.h

index 4f8388423edcec518d2cf58b910e905567356c56..83525ac293284af633763bff6adc9b24f204c6a1 100644 (file)
@@ -263,6 +263,7 @@ static long __media_device_get_topology(struct media_device *mdev,
                /* Copy fields to userspace struct if not error */
                memset(&uentity, 0, sizeof(uentity));
                uentity.id = entity->graph_obj.id;
+               uentity.function = entity->function;
                strncpy(uentity.name, entity->name,
                        sizeof(uentity.name));
 
index f9520225a211b5ba14eb8143e07492a3b4eb6136..290dd5585dc8029596018168bc4428c68dc91134 100644 (file)
@@ -276,7 +276,8 @@ struct media_links_enum {
 struct media_v2_entity {
        __u32 id;
        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 */