[media] usbvision: replace current_norm by g_std
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 3 Jun 2013 08:36:47 +0000 (05:36 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 17 Jun 2013 12:37:23 +0000 (09:37 -0300)
current_norm use is deprecated because it is per-devicenode and if you
have more device nodes all dependent on the same video source, then this
no longer works. Just implement g_std instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/usbvision/usbvision-video.c

index d34c2afe2c24527f04af105204b5492d7fe1b9a3..7ad872a3e31abe4388bd97302337419eb42e186f 100644 (file)
@@ -608,6 +608,14 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
        return 0;
 }
 
+static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
+{
+       struct usb_usbvision *usbvision = video_drvdata(file);
+
+       *id = usbvision->tvnorm_id;
+       return 0;
+}
+
 static int vidioc_g_tuner(struct file *file, void *priv,
                                struct v4l2_tuner *vt)
 {
@@ -1248,6 +1256,7 @@ static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
        .vidioc_qbuf          = vidioc_qbuf,
        .vidioc_dqbuf         = vidioc_dqbuf,
        .vidioc_s_std         = vidioc_s_std,
+       .vidioc_g_std         = vidioc_g_std,
        .vidioc_enum_input    = vidioc_enum_input,
        .vidioc_g_input       = vidioc_g_input,
        .vidioc_s_input       = vidioc_s_input,
@@ -1274,7 +1283,6 @@ static struct video_device usbvision_video_template = {
        .name           = "usbvision-video",
        .release        = video_device_release,
        .tvnorms        = USBVISION_NORMS,
-       .current_norm   = V4L2_STD_PAL
 };
 
 
@@ -1307,9 +1315,6 @@ static struct video_device usbvision_radio_template = {
        .name           = "usbvision-radio",
        .release        = video_device_release,
        .ioctl_ops      = &usbvision_radio_ioctl_ops,
-
-       .tvnorms              = USBVISION_NORMS,
-       .current_norm         = V4L2_STD_PAL
 };