]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] pvrusb2: implement VIDIOC_QUERYSTD
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 3 Oct 2011 15:22:28 +0000 (12:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 8 Oct 2011 11:00:26 +0000 (08:00 -0300)
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-hdw.h
drivers/media/video/pvrusb2/pvrusb2-v4l2.c

index e98d38212791034cdac61d11a24dec00ca636297..5a6f24d1246d459edbd69cefde0a690048ff8e16 100644 (file)
@@ -2993,6 +2993,13 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id,
                pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \
        }
 
+int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std)
+{
+       v4l2_device_call_all(&hdw->v4l2_dev, 0,
+                            video, querystd, std);
+       return 0;
+}
+
 /* Execute whatever commands are required to update the state of all the
    sub-devices so that they match our current control values. */
 static void pvr2_subdev_update(struct pvr2_hdw *hdw)
index d7753ae9ff46bed8b0c91bf438a9e9d3ff39120f..66546580b17d8d06f3521fb9096ce584207535d5 100644 (file)
@@ -214,6 +214,9 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *);
 int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
                               unsigned int idx);
 
+/* Get the detected video standard */
+int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std);
+
 /* Enable / disable retrieval of CPU firmware or prom contents.  This must
    be enabled before pvr2_hdw_cpufw_get() will function.  Note that doing
    this may prevent the device from running (and leaving this mode may
index e27f8ab76966ccdebd9f1a11338b0006ea759a84..0d029da07e6b9b516660a21ba1970163f06f5f17 100644 (file)
@@ -227,6 +227,13 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
                break;
        }
 
+       case VIDIOC_QUERYSTD:
+       {
+               v4l2_std_id *std = arg;
+               ret = pvr2_hdw_get_detected_std(hdw, std);
+               break;
+       }
+
        case VIDIOC_G_STD:
        {
                int val = 0;