media: usb/gadget/f_uvc: set device_caps in struct video_device
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Jun 2019 11:19:55 +0000 (07:19 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 5 Jun 2019 12:47:44 +0000 (08:47 -0400)
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

But this only really works if all drivers use this, so convert
this UVC gadget driver.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/usb/gadget/function/f_uvc.c
drivers/usb/gadget/function/uvc_v4l2.c

index 8c99392df5931ce6273ecba8aa07e28ca6205572..fb0a892687c0cb64b4b4d0cbc49aad7b1608eacf 100644 (file)
@@ -423,6 +423,7 @@ uvc_register_video(struct uvc_device *uvc)
        uvc->vdev.release = video_device_release_empty;
        uvc->vdev.vfl_dir = VFL_DIR_TX;
        uvc->vdev.lock = &uvc->video.mutex;
+       uvc->vdev.device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
        strlcpy(uvc->vdev.name, cdev->gadget->name, sizeof(uvc->vdev.name));
 
        video_set_drvdata(&uvc->vdev, uvc);
index a1183eccee227febeafea3471d74dc0221ca82ab..495f0ec663ead95b16960df968c93c4bb8f23f8a 100644 (file)
@@ -71,10 +71,6 @@ uvc_v4l2_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
        strlcpy(cap->card, cdev->gadget->name, sizeof(cap->card));
        strlcpy(cap->bus_info, dev_name(&cdev->gadget->dev),
                sizeof(cap->bus_info));
-
-       cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
        return 0;
 }