Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19bf0038 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab
Browse files

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: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0414614a
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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 = {