aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2010-10-09 15:09:17 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 08:16:35 -0200
commitbf797165f099296b622bcdcea1126a113e0aaac4 (patch)
treed5f21a15806fc4b104eae50e341bfef60a2b8726
parent78ca500559b5a4f16a95c198b3e7bdfac8455bf8 (diff)
downloadkernel_samsung_smdk4412-bf797165f099296b622bcdcea1126a113e0aaac4.zip
kernel_samsung_smdk4412-bf797165f099296b622bcdcea1126a113e0aaac4.tar.gz
kernel_samsung_smdk4412-bf797165f099296b622bcdcea1126a113e0aaac4.tar.bz2
[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 <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/au0828/au0828-video.c7
1 files changed, 7 insertions, 0 deletions
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);
}