From: Steven Toth Date: Mon, 10 Oct 2011 14:09:54 +0000 (-0300) Subject: [media] cx23885: ensure video is streaming before allowing vbi to stream X-Git-Tag: next-20111101~96^2~20 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=24465b448546e10666ad6021be0615214a258cbc;p=karo-tx-linux.git [media] cx23885: ensure video is streaming before allowing vbi to stream Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index a182e829c8d0..44a63c4de122 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c @@ -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)); }