[media] cx23885: ensure video is streaming before allowing vbi to stream
authorSteven Toth <stoth@kernellabs.com>
Mon, 10 Oct 2011 14:09:54 +0000 (11:09 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 14 Oct 2011 20:12:01 +0000 (17:12 -0300)
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx23885/cx23885-video.c

index a182e829c8d0f7b9817e9d833640d2032be46e28..44a63c4de1227fd828ec10f666ca0d499141f4c9 100644 (file)
@@ -1100,6 +1100,14 @@ static int vidioc_streamon(struct file *file, void *priv,
 
        if (unlikely(!res_get(dev, fh, get_resource(fh))))
                return -EBUSY;
+
+       /* Don't start VBI streaming unless vida streaming
+        * has already started.
+        */
+       if ((fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) &&
+               ((cx_read(VID_A_DMA_CTL) & 0x11) == 0))
+               return -EINVAL;
+
        return videobuf_streamon(get_queue(fh));
 }