Skip to content

Commit

Permalink
V4L/DVB (12748): em28xx: implement g_std v4l call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 0414614 commit 19bf003
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,22 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 19bf003

Please sign in to comment.