aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-03-31 11:29:26 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:52:52 -0400
commited3de6015a920c131fbcc770fb95097fde592d86 (patch)
tree0dcf1e935719a6766fb156c79acb4b6c400b48d4 /drivers/media/video/uvc
parent35a00c41ea8b280cb629503c735daf20cdf0f9f8 (diff)
V4L/DVB: uvcvideo: Use POLLOUT and POLLWRNORM for output devices
The V4L2 specification requires drivers to use the write events in the file operations poll handler for output devices. The uvcvideo driver erroneously used read events for all devices. Fix this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r--drivers/media/video/uvc/uvc_queue.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c
index 4a925a31b0e0..133c78d113ac 100644
--- a/drivers/media/video/uvc/uvc_queue.c
+++ b/drivers/media/video/uvc/uvc_queue.c
@@ -388,8 +388,12 @@ unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
388 388
389 poll_wait(file, &buf->wait, wait); 389 poll_wait(file, &buf->wait, wait);
390 if (buf->state == UVC_BUF_STATE_DONE || 390 if (buf->state == UVC_BUF_STATE_DONE ||
391 buf->state == UVC_BUF_STATE_ERROR) 391 buf->state == UVC_BUF_STATE_ERROR) {
392 mask |= POLLIN | POLLRDNORM; 392 if (queue->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
393 mask |= POLLIN | POLLRDNORM;
394 else
395 mask |= POLLOUT | POLLWRNORM;
396 }
393 397
394done: 398done:
395 mutex_unlock(&queue->mutex); 399 mutex_unlock(&queue->mutex);