diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-02-12 06:26:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-14 18:57:51 -0400 |
commit | 65fe42d6054bb84c4abc4168310bd5d7c462456e (patch) | |
tree | eb387f6636aa58aa1bc0cf89d226b7b333e0f421 /drivers/media/usb | |
parent | ede197aac0c64021a0b2139d19edd8fa066530c2 (diff) |
[media] hdpvr: add prio and control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/hdpvr/hdpvr-video.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 4bbcf480d5e7..e30ece215c87 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <media/v4l2-dev.h> | 24 | #include <media/v4l2-dev.h> |
25 | #include <media/v4l2-common.h> | 25 | #include <media/v4l2-common.h> |
26 | #include <media/v4l2-ioctl.h> | 26 | #include <media/v4l2-ioctl.h> |
27 | #include <media/v4l2-event.h> | ||
27 | #include "hdpvr.h" | 28 | #include "hdpvr.h" |
28 | 29 | ||
29 | #define BULK_URB_TIMEOUT 90 /* 0.09 seconds */ | 30 | #define BULK_URB_TIMEOUT 90 /* 0.09 seconds */ |
@@ -479,16 +480,15 @@ err: | |||
479 | 480 | ||
480 | static unsigned int hdpvr_poll(struct file *filp, poll_table *wait) | 481 | static unsigned int hdpvr_poll(struct file *filp, poll_table *wait) |
481 | { | 482 | { |
483 | unsigned long req_events = poll_requested_events(wait); | ||
482 | struct hdpvr_buffer *buf = NULL; | 484 | struct hdpvr_buffer *buf = NULL; |
483 | struct hdpvr_device *dev = video_drvdata(filp); | 485 | struct hdpvr_device *dev = video_drvdata(filp); |
484 | unsigned int mask = 0; | 486 | unsigned int mask = v4l2_ctrl_poll(filp, wait); |
485 | 487 | ||
486 | mutex_lock(&dev->io_mutex); | 488 | if (!(req_events & (POLLIN | POLLRDNORM))) |
489 | return mask; | ||
487 | 490 | ||
488 | if (!video_is_registered(dev->video_dev)) { | 491 | mutex_lock(&dev->io_mutex); |
489 | mutex_unlock(&dev->io_mutex); | ||
490 | return -EIO; | ||
491 | } | ||
492 | 492 | ||
493 | if (dev->status == STATUS_IDLE) { | 493 | if (dev->status == STATUS_IDLE) { |
494 | if (hdpvr_start_streaming(dev)) { | 494 | if (hdpvr_start_streaming(dev)) { |
@@ -880,10 +880,13 @@ static const struct v4l2_ioctl_ops hdpvr_ioctl_ops = { | |||
880 | .vidioc_enumaudio = vidioc_enumaudio, | 880 | .vidioc_enumaudio = vidioc_enumaudio, |
881 | .vidioc_g_audio = vidioc_g_audio, | 881 | .vidioc_g_audio = vidioc_g_audio, |
882 | .vidioc_s_audio = vidioc_s_audio, | 882 | .vidioc_s_audio = vidioc_s_audio, |
883 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | 883 | .vidioc_enum_fmt_vid_cap= vidioc_enum_fmt_vid_cap, |
884 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, | 884 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, |
885 | .vidioc_encoder_cmd = vidioc_encoder_cmd, | 885 | .vidioc_encoder_cmd = vidioc_encoder_cmd, |
886 | .vidioc_try_encoder_cmd = vidioc_try_encoder_cmd, | 886 | .vidioc_try_encoder_cmd = vidioc_try_encoder_cmd, |
887 | .vidioc_log_status = v4l2_ctrl_log_status, | ||
888 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | ||
889 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | ||
887 | }; | 890 | }; |
888 | 891 | ||
889 | static void hdpvr_device_release(struct video_device *vdev) | 892 | static void hdpvr_device_release(struct video_device *vdev) |
@@ -1008,6 +1011,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, | |||
1008 | strcpy(dev->video_dev->name, "Hauppauge HD PVR"); | 1011 | strcpy(dev->video_dev->name, "Hauppauge HD PVR"); |
1009 | dev->video_dev->v4l2_dev = &dev->v4l2_dev; | 1012 | dev->video_dev->v4l2_dev = &dev->v4l2_dev; |
1010 | video_set_drvdata(dev->video_dev, dev); | 1013 | video_set_drvdata(dev->video_dev, dev); |
1014 | set_bit(V4L2_FL_USE_FH_PRIO, &dev->video_dev->flags); | ||
1011 | 1015 | ||
1012 | res = video_register_device(dev->video_dev, VFL_TYPE_GRABBER, devnum); | 1016 | res = video_register_device(dev->video_dev, VFL_TYPE_GRABBER, devnum); |
1013 | if (res < 0) { | 1017 | if (res < 0) { |