summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil2016-03-01 15:57:23 +0100
committerMauro Carvalho Chehab2016-04-13 21:40:29 +0200
commit7bbe7813290df9fda0c175b7a703325720594912 (patch)
tree6cb036f67f202db211dee0ed12aba0f1dfb192bb /drivers/media/v4l2-core/v4l2-ioctl.c
parent[media] exynos-gsc: remove an always false condition (diff)
downloadkernel-qcow2-linux-7bbe7813290df9fda0c175b7a703325720594912.tar.gz
kernel-qcow2-linux-7bbe7813290df9fda0c175b7a703325720594912.tar.xz
kernel-qcow2-linux-7bbe7813290df9fda0c175b7a703325720594912.zip
[media] v4l2: add device_caps to struct video_device
Instead of letting drivers fill in device_caps at querycap time, let them fill it in when the video device is registered. This has the advantage that in the future the v4l2 core can access the video device's capabilities and take decisions based on that. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-ioctl.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 170dd68d27f4..6bf5a3ecd126 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1020,9 +1020,12 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct v4l2_capability *cap = (struct v4l2_capability *)arg;
+ struct video_device *vfd = video_devdata(file);
int ret;
cap->version = LINUX_VERSION_CODE;
+ cap->device_caps = vfd->device_caps;
+ cap->capabilities = vfd->device_caps | V4L2_CAP_DEVICE_CAPS;
ret = ops->vidioc_querycap(file, fh, cap);