[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)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 May 2013 11:09:33 +0000 (08:09 -0300)
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 0e55b087076fb3d29eb376d60bfff92c72e9ec90..03530bc6bdd1f09dfb36112ac4ea0d31b92bf04b 100644 (file)
@@ -649,18 +649,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;
 }
 
@@ -921,6 +933,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,