From: Devin Heitmueller Date: Sat, 9 Oct 2010 18:09:17 +0000 (-0300) Subject: [media] au0828: enable VBI timeout when calling read() without streamon() X-Git-Tag: v2.6.38-rc1~470^2~219 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf797165f099296b622bcdcea1126a113e0aaac4;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git [media] au0828: enable VBI timeout when calling read() without streamon() Because some clients (e.g. tvtime) will just open the filehandle and call read() instead of explicitly calling streamon first, we need to make sure the VBI timeout routine gets enabled in this case. Signed-off-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index cf8fc62..48682af 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -1116,6 +1116,13 @@ static ssize_t au0828_v4l2_read(struct file *filp, char __user *buf, if (!res_get(fh, AU0828_RESOURCE_VBI)) return -EBUSY; + if (dev->vbi_timeout_running == 0) { + /* Handle case where caller tries to read without + calling streamon first */ + dev->vbi_timeout_running = 1; + mod_timer(&dev->vbi_timeout, jiffies + (HZ / 10)); + } + return videobuf_read_stream(&fh->vb_vbiq, buf, count, pos, 0, filp->f_flags & O_NONBLOCK); }