summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-if.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pwc/pwc-if.c')
-rw-r--r--drivers/media/video/pwc/pwc-if.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 122fbd0..f3370a8 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -625,10 +625,19 @@ static ssize_t pwc_video_read(struct file *file, char __user *buf,
static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
{
struct pwc_device *pdev = video_drvdata(file);
+ unsigned long req_events = poll_requested_events(wait);
if (!pdev->udev)
return POLL_ERR;
+ if ((req_events & (POLLIN | POLLRDNORM)) &&
+ pdev->vb_queue.num_buffers == 0 &&
+ !pdev->iso_init) {
+ /* This poll will start a read stream, check capt_file */
+ if (pwc_test_n_set_capt_file(pdev, file))
+ return POLL_ERR;
+ }
+
return vb2_poll(&pdev->vb_queue, file, wait);
}
OpenPOWER on IntegriCloud