[media] media/platform: fix querycap
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 24 Nov 2014 09:37:25 +0000 (06:37 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 2 Dec 2014 13:31:34 +0000 (11:31 -0200)
Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/blackfin/bfin_capture.c
drivers/media/platform/fsl-viu.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/mx2_emmaprp.c
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/sh_vou.c
drivers/media/platform/via-camera.c
drivers/media/platform/vino.c

index b3345b37bb1059a0cd2fe1694048339806484c18..431c33d409a79a788789647b687b96baba991ef4 100644 (file)
@@ -841,7 +841,8 @@ static int bcap_querycap(struct file *file, void  *priv,
 {
        struct bcap_device *bcap_dev = video_drvdata(file);
 
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
        strlcpy(cap->bus_info, "Blackfin Platform", sizeof(cap->bus_info));
        strlcpy(cap->card, bcap_dev->cfg->card_name, sizeof(cap->card));
index d5dc198502ef0a81fc804594733e06ac8f60933f..8afee3c17c1ca8494f241fdbddb3ac1a95b1e0e1 100644 (file)
@@ -604,10 +604,11 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        strcpy(cap->driver, "viu");
        strcpy(cap->card, "viu");
-       cap->capabilities =     V4L2_CAP_VIDEO_CAPTURE |
+       cap->device_caps =      V4L2_CAP_VIDEO_CAPTURE |
                                V4L2_CAP_STREAMING     |
                                V4L2_CAP_VIDEO_OVERLAY |
                                V4L2_CAP_READWRITE;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index ce00cbaf850ece44abbe78ff77468d259b600787..b65761b4556880aba9f7cdb5f8bebdebcb1959d0 100644 (file)
@@ -1408,9 +1408,9 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,
 {
        strcpy(cap->driver, "marvell_ccic");
        strcpy(cap->card, "marvell_ccic");
-       cap->version = 1;
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 4971ff21f82b6b46a5a2c43e25a40adfd6611ab8..f923d1bc43a00700b30594a7826e201f0081ed4d 100644 (file)
@@ -402,13 +402,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1);
        strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1);
-       /*
-        * This is only a mem-to-mem video device. The capture and output
-        * device capability flags are left only for backward compatibility
-        * and are scheduled for removal.
-        */
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
-                           V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+       cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 64ab6fb06b9c6ed478661a93f7fdf8424422237a..d39e2b4027beb90ba9dc3649df423a50f0c7dc94 100644 (file)
@@ -1054,8 +1054,9 @@ static int vidioc_querycap(struct file *file, void *fh,
        strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
        strlcpy(cap->card, vout->vfd->name, sizeof(cap->card));
        cap->bus_info[0] = '\0';
-       cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
+       cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
                V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }
index 047669609458b39890c2cf158fcdf9528dc8f424..154ef0b6b8ab6b2f15550462a0a75fb5391c61d7 100644 (file)
@@ -396,7 +396,8 @@ static int sh_vou_querycap(struct file *file, void  *priv,
        dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
 
        strlcpy(cap->card, "SuperH VOU", sizeof(cap->card));
-       cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+       cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 2616483fce0b1d91c9130648348b8690feb1f99b..86989d86abfaeb26bf3b191fef55bf25ecd10104 100644 (file)
@@ -985,9 +985,9 @@ static int viacam_querycap(struct file *filp, void *priv,
 {
        strcpy(cap->driver, "via-camera");
        strcpy(cap->card, "via-camera");
-       cap->version = 1;
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 91d44ea16f275257cfc4f57d5c420b674a0495c3..2c85357f774d42903857d14a692edebe1f6affa9 100644 (file)
@@ -2932,10 +2932,8 @@ static int vino_querycap(struct file *file, void *__fh,
        strcpy(cap->driver, vino_driver_name);
        strcpy(cap->card, vino_driver_description);
        strcpy(cap->bus_info, vino_bus_name);
-       cap->capabilities =
-               V4L2_CAP_VIDEO_CAPTURE |
-               V4L2_CAP_STREAMING;
-       // V4L2_CAP_OVERLAY, V4L2_CAP_READWRITE
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }