]> Pileus Git - ~andy/linux/blobdiff - drivers/media/pci/saa7164/saa7164-vbi.c
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / drivers / media / pci / saa7164 / saa7164-vbi.c
index da224eb39b95a002e8aa2c3c2b2c91e9a4848ef0..6e025fea25422774ae478633c7038cd978c1fbf3 100644 (file)
@@ -200,6 +200,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
                return -EINVAL;
 
        port->encodernorm = saa7164_tvnorms[i];
+       port->std = id;
 
        /* Update the audio decoder while is not running in
         * auto detect mode.
@@ -211,6 +212,15 @@ 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 saa7164_encoder_fh *fh = file->private_data;
+       struct saa7164_port *port = fh->port;
+
+       *id = port->std;
+       return 0;
+}
+
 static int vidioc_enum_input(struct file *file, void *priv,
        struct v4l2_input *i)
 {
@@ -1236,6 +1246,7 @@ static const struct v4l2_file_operations vbi_fops = {
 
 static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
        .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,
@@ -1254,15 +1265,6 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
        .vidioc_s_ext_ctrls      = vidioc_s_ext_ctrls,
        .vidioc_try_ext_ctrls    = vidioc_try_ext_ctrls,
        .vidioc_queryctrl        = vidioc_queryctrl,
-#if 0
-       .vidioc_g_chip_ident     = saa7164_g_chip_ident,
-#endif
-#ifdef CONFIG_VIDEO_ADV_DEBUG
-#if 0
-       .vidioc_g_register       = saa7164_g_register,
-       .vidioc_s_register       = saa7164_s_register,
-#endif
-#endif
        .vidioc_g_fmt_vbi_cap    = saa7164_vbi_fmt,
        .vidioc_try_fmt_vbi_cap  = saa7164_vbi_fmt,
        .vidioc_s_fmt_vbi_cap    = saa7164_vbi_fmt,
@@ -1274,7 +1276,6 @@ static struct video_device saa7164_vbi_template = {
        .ioctl_ops     = &vbi_ioctl_ops,
        .minor         = -1,
        .tvnorms       = SAA7164_NORMS,
-       .current_norm  = V4L2_STD_NTSC_M,
 };
 
 static struct video_device *saa7164_vbi_alloc(
@@ -1296,7 +1297,7 @@ static struct video_device *saa7164_vbi_alloc(
        snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name,
                type, saa7164_boards[dev->board].name);
 
-       vfd->parent  = &pci->dev;
+       vfd->v4l2_dev  = &dev->v4l2_dev;
        vfd->release = video_device_release;
        return vfd;
 }
@@ -1333,6 +1334,7 @@ int saa7164_vbi_register(struct saa7164_port *port)
                goto failed;
        }
 
+       port->std = V4L2_STD_NTSC_M;
        video_set_drvdata(port->v4l_device, port);
        result = video_register_device(port->v4l_device,
                VFL_TYPE_VBI, -1);