diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-09-06 09:59:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 09:19:01 -0500 |
commit | d87cdb884486bfa795be99c83a5b3ac4d428ca84 (patch) | |
tree | 40f87b39589940f201c2a10e265f24c05e1459ff | |
parent | 0e576b76f5470a2f8b2287958a2b9a3dd0f56f10 (diff) |
[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/media-device.c | 1 | ||||
-rw-r--r-- | include/uapi/linux/media.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 4f8388423edc..83525ac29328 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c | |||
@@ -263,6 +263,7 @@ static long __media_device_get_topology(struct media_device *mdev, | |||
263 | /* Copy fields to userspace struct if not error */ | 263 | /* Copy fields to userspace struct if not error */ |
264 | memset(&uentity, 0, sizeof(uentity)); | 264 | memset(&uentity, 0, sizeof(uentity)); |
265 | uentity.id = entity->graph_obj.id; | 265 | uentity.id = entity->graph_obj.id; |
266 | uentity.function = entity->function; | ||
266 | strncpy(uentity.name, entity->name, | 267 | strncpy(uentity.name, entity->name, |
267 | sizeof(uentity.name)); | 268 | sizeof(uentity.name)); |
268 | 269 | ||
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index f9520225a211..290dd5585dc8 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h | |||
@@ -276,7 +276,8 @@ struct media_links_enum { | |||
276 | struct media_v2_entity { | 276 | struct media_v2_entity { |
277 | __u32 id; | 277 | __u32 id; |
278 | char name[64]; /* FIXME: move to a property? (RFC says so) */ | 278 | char name[64]; /* FIXME: move to a property? (RFC says so) */ |
279 | __u16 reserved[14]; | 279 | __u32 function; /* Main function of the entity */ |
280 | __u16 reserved[12]; | ||
280 | }; | 281 | }; |
281 | 282 | ||
282 | /* Should match the specific fields at media_intf_devnode */ | 283 | /* Should match the specific fields at media_intf_devnode */ |