]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] cx23885: fix querycap
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 23 Apr 2014 07:50:14 +0000 (04:50 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 3 Sep 2014 10:42:12 +0000 (07:42 -0300)
Set device_caps to fix the v4l2-compliance QUERYCAP complaints.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/pci/cx23885/cx23885-video.c

index 91e4cb457296ccdef2b1b777e6f8594341a71a1d..2666ac415ec281e58b078e0afd1a09f04e4abdb9 100644 (file)
@@ -1146,19 +1146,22 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
 static int vidioc_querycap(struct file *file, void  *priv,
        struct v4l2_capability *cap)
 {
+       struct video_device *vdev = video_devdata(file);
        struct cx23885_dev *dev  = ((struct cx23885_fh *)priv)->dev;
 
        strcpy(cap->driver, "cx23885");
        strlcpy(cap->card, cx23885_boards[dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
-       cap->capabilities =
-               V4L2_CAP_VIDEO_CAPTURE |
-               V4L2_CAP_READWRITE     |
-               V4L2_CAP_STREAMING     |
-               V4L2_CAP_VBI_CAPTURE;
+       cap->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
        if (dev->tuner_type != TUNER_ABSENT)
-               cap->capabilities |= V4L2_CAP_TUNER;
+               cap->device_caps |= V4L2_CAP_TUNER;
+       if (vdev->vfl_type == VFL_TYPE_VBI)
+               cap->device_caps |= V4L2_CAP_VBI_CAPTURE;
+       else
+               cap->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
+       cap->capabilities = cap->device_caps | V4L2_CAP_VBI_CAPTURE |
+               V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }