[media] em28xx: Add VIDIOC_QUERYSTD support
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 4 Oct 2011 12:53:00 +0000 (09:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 8 Oct 2011 11:01:40 +0000 (08:01 -0300)
Allow subdevs to return the detected standards

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-video.c

index 61f35c8d66d22871aff74e9c0a3d72e277d5b668..62182e311060d09497c01c7bb8081435fb3b6951 100644 (file)
@@ -1156,6 +1156,21 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
        return 0;
 }
 
+static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm)
+{
+       struct em28xx_fh   *fh  = priv;
+       struct em28xx      *dev = fh->dev;
+       int                rc;
+
+       rc = check_dev(dev);
+       if (rc < 0)
+               return rc;
+
+       v4l2_device_call_all(&dev->v4l2_dev, 0, video, querystd, norm);
+
+       return 0;
+}
+
 static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
 {
        struct em28xx_fh   *fh  = priv;
@@ -2354,6 +2369,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
        .vidioc_qbuf                = vidioc_qbuf,
        .vidioc_dqbuf               = vidioc_dqbuf,
        .vidioc_g_std               = vidioc_g_std,
+       .vidioc_querystd            = vidioc_querystd,
        .vidioc_s_std               = vidioc_s_std,
        .vidioc_g_parm              = vidioc_g_parm,
        .vidioc_s_parm              = vidioc_s_parm,