upstream: [media] bfin_capture: add query_dv_timings/enum_dv_timings support
authorScott Jiang <scott.jiang.linux@gmail.com>
Fri, 12 Apr 2013 22:52:59 +0000 (19:52 -0300)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 05:26:50 +0000 (14:26 +0900)
More dv_timings ioctl ops are introduced in video core.
Add query_dv_timings/enum_dv_timings accordingly.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/blackfin/bfin_capture.c

index 9eca639..83a2fca 100644 (file)
@@ -642,18 +642,30 @@ static int bcap_s_std(struct file *file, void *priv, v4l2_std_id std)
        return 0;
 }
 
-static int bcap_g_dv_timings(struct file *file, void *priv,
+static int bcap_enum_dv_timings(struct file *file, void *priv,
+                               struct v4l2_enum_dv_timings *timings)
+{
+       struct bcap_device *bcap_dev = video_drvdata(file);
+
+       return v4l2_subdev_call(bcap_dev->sd, video,
+                       enum_dv_timings, timings);
+}
+
+static int bcap_query_dv_timings(struct file *file, void *priv,
                                struct v4l2_dv_timings *timings)
 {
        struct bcap_device *bcap_dev = video_drvdata(file);
-       int ret;
 
-       ret = v4l2_subdev_call(bcap_dev->sd, video,
-                               g_dv_timings, timings);
-       if (ret < 0)
-               return ret;
+       return v4l2_subdev_call(bcap_dev->sd, video,
+                               query_dv_timings, timings);
+}
 
-       bcap_dev->dv_timings = *timings;
+static int bcap_g_dv_timings(struct file *file, void *priv,
+                               struct v4l2_dv_timings *timings)
+{
+       struct bcap_device *bcap_dev = video_drvdata(file);
+
+       *timings = bcap_dev->dv_timings;
        return 0;
 }
 
@@ -879,6 +891,8 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
        .vidioc_g_std            = bcap_g_std,
        .vidioc_s_dv_timings     = bcap_s_dv_timings,
        .vidioc_g_dv_timings     = bcap_g_dv_timings,
+       .vidioc_query_dv_timings = bcap_query_dv_timings,
+       .vidioc_enum_dv_timings  = bcap_enum_dv_timings,
        .vidioc_reqbufs          = bcap_reqbufs,
        .vidioc_querybuf         = bcap_querybuf,
        .vidioc_qbuf             = bcap_qbuf,