tv: add device capability flag
authorJinhyung Jo <jinhyung.jo@samsung.com>
Thu, 10 Nov 2016 04:54:56 +0000 (13:54 +0900)
committerJinhyung Jo <jinhyung.jo@samsung.com>
Thu, 10 Nov 2016 05:04:41 +0000 (14:04 +0900)
According to the policy of the V4L2,
the device drivers MUST fill in the device_caps.
If do not, warning messages & back-traces are print to the log.
Therefore add flags to the devices that do not have the device_caps.

Change-Id: I5d9ce4da56fc55ca81ca362b4f052339fec02f91
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
drivers/maru/tv/maru_atv.c
drivers/maru/tv/maru_component.c
drivers/maru/tv/maru_composite.c
drivers/maru/tv/maru_dtv_decoder.c
drivers/maru/tv/maru_hdmi.c
drivers/maru/tv/maru_hdmiswitch.c
drivers/maru/tv/maru_tuner.c

index 3ee2ef99646ff18783212472b201ab20c1d69eb7..45f2fdffd3e15b7890aeb55f031f0d32874e383e 100644 (file)
@@ -194,6 +194,11 @@ const struct v4l2_ioctl_ops *get_audio_v4l2_ioctl_ops(void)
 static int vidioc_querycap_sif(struct file *file, void *priv, struct v4l2_capability *cap)
 {
        print_dbg(1, "%s is called", __func__);
+       strcpy(cap->driver, "maruatv_sif");
+       /* TODO: This is W/A. So someone in charge of this module
+               has to set the correct capability */
+       cap->device_caps = V4L2_CAP_AUDIO | V4L2_CAP_STREAMING;;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 07c7dde904c41c1b759b87c43acc024b3d354829..2bebb4d79f03b35fce0a68f533d80e86aadf93c9 100644 (file)
@@ -101,6 +101,10 @@ static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability
 {
        maru_component_dbg(5, "[component]enter\n");
        strcpy(cap->driver, MARU_COMPONENT_MODULE_NAME);
+       /* TODO: This is W/A. So someone in charge of this module
+               has to set the correct capability */
+       cap->device_caps = V4L2_CAP_STREAMING;;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index bc4703c09932c0dfb50fa8bda3934bc9c1d5c41c..cb27beaf6984049b4d06fcd78ba8a1c720ae7b53 100644 (file)
@@ -104,7 +104,10 @@ static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability
        maru_composite_dbg(5, "[composite]enter\n");
 
        strcpy(cap->driver, MARU_COMPOSITE_MODULE_NAME);
-
+       /* TODO: This is W/A. So someone in charge of this module
+               has to set the correct capability */
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 4f4bd691709a5f43665188b63c769f6847896eb3..a113d605a1f006b1b0ca2cb702c797bbed5fd1c1 100644 (file)
@@ -386,8 +386,9 @@ static int vidioc_querycap(struct file *file, void *priv,
        strcpy(cap->card, MARU_DTV_DEC_MODULE_NAME);
        strlcpy(cap->bus_info, dev->v4l2_dev.name, sizeof(cap->bus_info));
        cap->version = dev->version;
-       cap->capabilities =
+       cap->device_caps =
                V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_M2M | V4L2_CAP_VIDEO_OUTPUT;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        DEBUG("v4l2_capability capabilities=0x%x\n", cap->capabilities);
        return ret;
index 970c81d4524b5e795711ec6e0a24f4cb3fb5864a..01a03ecdf787cff006b2150e1acf24409eb30090 100644 (file)
@@ -117,7 +117,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        maru_hdmi_dbg(5, "[hdmi]enter\n");
 
        strcpy(cap->driver, MARU_HDMI_MODULE_NAME);
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }
index 963a4df74067606f2470f84047e10473afe63da6..45f50bd00d3d3f0c8bf2644b26a2c547249ab2ef 100644 (file)
@@ -255,7 +255,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
 
        cap->bus_info[0] = 0;
        cap->version = MARU_EXTINPUT_VERSION;
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }
index f35d85715da4a6dfcc27cbb8e246d5cb3d55eaaa..0b410e5c145751ad7f5aab46b61f73560558eb55 100644 (file)
@@ -243,7 +243,8 @@ static int maruatv_vidioc_querycap(struct file *file, void *priv, struct v4l2_ca
        print_dbg(1, "\n");
 
        strlcpy(cap->driver, "marutuner_atv", sizeof(cap->driver));
-       cap->capabilities = V4L2_CAP_TUNER;
+       cap->device_caps = V4L2_CAP_TUNER;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }