summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvc_driver.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-12-05 02:06:01 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-04 14:37:58 +0300
commit94c53e26dc74744cc4f9a8ddc593b7aef96ba764 (patch)
tree9074912c8b48381b67c65709aaff1a5307946e6e /drivers/media/usb/uvc/uvc_driver.c
parent31a96f4c872e8fb953c853630f69d5de6ec961c9 (diff)
downloadlinux-94c53e26dc74744cc4f9a8ddc593b7aef96ba764.tar.xz
media: uvcvideo: Report V4L2 device caps through the video_device structure
The V4L2 core populates the struct v4l2_capability device_caps field from the same field in video_device. There's no need to handle that manually in the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_driver.c')
-rw-r--r--drivers/media/usb/uvc/uvc_driver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index f6fbfc122871..d63458539e03 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1921,6 +1921,17 @@ int uvc_register_video_device(struct uvc_device *dev,
vdev->vfl_dir = VFL_DIR_TX;
else
vdev->vfl_dir = VFL_DIR_RX;
+
+ switch (type) {
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+ default:
+ vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+ break;
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+ vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+ break;
+ }
+
strlcpy(vdev->name, dev->name, sizeof vdev->name);
/*