[media] pvrusb2: Base available video standards on what hardware supports
authorMike Isely <isely@pobox.com>
Mon, 20 Feb 2012 05:33:06 +0000 (02:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 7 May 2012 19:56:10 +0000 (16:56 -0300)
With the transition to ioctl2, the pvrusb2 driver's own standards
enumeration is no longer used.  Instead a generic algorithm internal
to v4l is used (which is a great idea - since the pvrusb2
implementation itself was generic anyway).  This change ensures that
the v4l algorithm works with the correct set of hardware supported
standards.  This resolves a FIXME left behind from the videodev_ioctl2
transition.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-v4l2.c

index ed497bbf539bd79951064e0f3d88d1e986d2d41a..4c1a47470d391c47d89dfcc32f59329fd0f76f7a 100644 (file)
@@ -1348,10 +1348,13 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
        memcpy(&dip->devbase,&vdev_template,sizeof(vdev_template));
        dip->devbase.release = pvr2_video_device_release;
        dip->devbase.ioctl_ops = &pvr2_ioctl_ops;
-       /* FIXME: tvnorms should be set to the set of supported standards
-          by this device. Then video_ioctl2 will implement VIDIOC_ENUMSTD
-          based on this field. */
-       dip->devbase.tvnorms = V4L2_STD_ALL;
+       {
+               int val;
+               pvr2_ctrl_get_value(
+                       pvr2_hdw_get_ctrl_by_id(vp->channel.mc_head->hdw,
+                                               PVR2_CID_STDAVAIL), &val);
+               dip->devbase.tvnorms = (v4l2_std_id)val;
+       }
 
        mindevnum = -1;
        unit_number = pvr2_hdw_get_unit_number(vp->channel.mc_head->hdw);