aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-08-28 17:38:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-28 07:28:13 -0500
commitf887e99ae2210e23c9726b6f146938a84f6acc47 (patch)
treee8783e91573517f5085bfb4f3031454e0fe0b8de /drivers/media
parent815adc465de9c8cd1967d0d9d538ed30925423a0 (diff)
[media] uvcvideo: Set device_caps in VIDIOC_QUERYCAP
Set the capabilities field to global capabilities, and the device_caps field to the video node capabilities. This issue was found by the v4l2-compliance tool. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/uvc/uvc_driver.c5
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c10
-rw-r--r--drivers/media/usb/uvc/uvcvideo.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 5967081747ce..ae24f7d70b03 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1741,6 +1741,11 @@ static int uvc_register_video(struct uvc_device *dev,
1741 return ret; 1741 return ret;
1742 } 1742 }
1743 1743
1744 if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
1745 stream->chain->caps |= V4L2_CAP_VIDEO_CAPTURE;
1746 else
1747 stream->chain->caps |= V4L2_CAP_VIDEO_OUTPUT;
1748
1744 atomic_inc(&dev->nstreams); 1749 atomic_inc(&dev->nstreams);
1745 return 0; 1750 return 0;
1746} 1751}
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 3bd93736a82a..b1aa55fb8984 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -565,12 +565,14 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
565 usb_make_path(stream->dev->udev, 565 usb_make_path(stream->dev->udev,
566 cap->bus_info, sizeof(cap->bus_info)); 566 cap->bus_info, sizeof(cap->bus_info));
567 cap->version = LINUX_VERSION_CODE; 567 cap->version = LINUX_VERSION_CODE;
568 cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
569 | chain->caps;
568 if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) 570 if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
569 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE 571 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE
570 | V4L2_CAP_STREAMING; 572 | V4L2_CAP_STREAMING;
571 else 573 else
572 cap->capabilities = V4L2_CAP_VIDEO_OUTPUT 574 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT
573 | V4L2_CAP_STREAMING; 575 | V4L2_CAP_STREAMING;
574 break; 576 break;
575 } 577 }
576 578
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index d83b6baf703a..a6c561f631a0 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -371,6 +371,8 @@ struct uvc_video_chain {
371 struct uvc_entity *selector; /* Selector unit */ 371 struct uvc_entity *selector; /* Selector unit */
372 372
373 struct mutex ctrl_mutex; /* Protects ctrl.info */ 373 struct mutex ctrl_mutex; /* Protects ctrl.info */
374
375 u32 caps; /* V4L2 chain-wide caps */
374}; 376};
375 377
376struct uvc_stats_frame { 378struct uvc_stats_frame {