V4L/DVB (12748): em28xx: implement g_std v4l call

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, September 21, 2009 - 9:59 am

Gitweb:     http://git.kernel.org/linus/19bf00384a6d5bbe5d7b8afbcc25772e3675d423
Commit:     19bf00384a6d5bbe5d7b8afbcc25772e3675d423
Parent:     0414614aab32d84da2bb092eb83b5e456946022d
Author:     Devin Heitmueller <dheitmueller@kernellabs.com>
AuthorDate: Fri Sep 11 00:40:18 2009 -0300
Committer:  Mauro Carvalho Chehab <mchehab@redhat.com>
CommitDate: Fri Sep 18 23:47:45 2009 -0300

    V4L/DVB (12748): em28xx: implement g_std v4l call
    
    We need to implement the g_std call, or else the default norm always gets
    returned, which breaks VBI capturing if you had changed the standard to NTSC
    using s_std.
    
    I had temporarily changed the default norm to NTSC so that zvbi-ntsc-cc
    wouldn't choke, so now that we are returning the correct value, switch it back
    to PAL as the default.
    
    This work was sponsored by EyeMagnet Limited.
    
    Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/video/em28xx/em28xx-video.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 8955b7b..486db84 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1140,6 +1140,22 @@ out:
 	return rc;
 }
 
+static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
+{
+	struct em28xx_fh   *fh  = priv;
+	struct em28xx      *dev = fh->dev;
+	struct v4l2_format f;
+	int                rc;
+
+	rc = check_dev(dev);
+	if (rc < 0)
+		return rc;
+
+	*norm = dev->norm;
+
+	return 0;
+}
+
 static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
 {
 	struct em28xx_fh   *fh  = priv;
@@ -2354,6 +2370,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
 	.vidioc_querybuf            = vidioc_querybuf,
 	.vidioc_qbuf                = vidioc_qbuf,
 	.vidioc_dqbuf               = vidioc_dqbuf,
+	.vidioc_g_std               = vidioc_g_std,
 	.vidioc_s_std               = vidioc_s_std,
 	.vidioc_g_parm		    = vidioc_g_parm,
 	.vidioc_s_parm		    = vidioc_s_parm,
@@ -2387,9 +2404,7 @@ static const struct video_device em28xx_video_template = {
 	.minor                      = -1,
 
 	.tvnorms                    = V4L2_STD_ALL,
-	/* FIXME: we need this to be NTSC for VBI to work - it should
-	   be moved to a per-board definition */
-	.current_norm               = V4L2_STD_NTSC,
+	.current_norm               = V4L2_STD_PAL,
 };
 
 static const struct v4l2_file_operations radio_fops = {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
V4L/DVB (12748): em28xx: implement g_std v4l call, Linux Kernel Mailing ..., (Mon Sep 21, 9:59 am)