On 10/12/2015 06:43 PM, Mauro Carvalho Chehab wrote:
V4L2 device (and subdevice) nodes should create an interface, if the Media Controller support is enabled.
Please notice that radio devices should not create an entity, as radio input/output is either via wires or via ALSA.
Change-Id: I570210b1c08ebf5f29e2917da27c957bb798d2b0 Signed-off-by: Mauro Carvalho Chehab mchehab@osg.samsung.com
Acked-by: Hans Verkuil hans.verkuil@cisco.com
But see comment below:
drivers/media/v4l2-core/v4l2-dev.c | 112 ++++++++++++++++++++++++++++------ drivers/media/v4l2-core/v4l2-device.c | 16 ++++- include/media/v4l2-dev.h | 1 + 3 files changed, 110 insertions(+), 19 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 44b330589787..07123dd569c4 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c
<snip>
@@ -713,6 +716,92 @@ static void determine_valid_ioctls(struct video_device *vdev) BASE_VIDIOC_PRIVATE); }
+static int video_register_media_controller(struct video_device *vdev, int type) +{ +#if defined(CONFIG_MEDIA_CONTROLLER)
- u32 intf_type;
- int ret;
- if (!vdev->v4l2_dev->mdev)
return 0;
- vdev->entity.type = MEDIA_ENT_T_UNKNOWN;
- switch (type) {
- case VFL_TYPE_GRABBER:
intf_type = MEDIA_INTF_T_V4L_VIDEO;
vdev->entity.type = MEDIA_ENT_T_V4L2_VIDEO;
break;
I think I mentioned it before: V4L vs V4L2 in the macro names is inconsistent. I would suggest using V4L2 as well in MEDIA_INTF_. It looks really weird and arbitrary here.
Regards,
Hans