diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-05-11 10:25:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-06 17:12:09 -0400 |
commit | 1a3c60a072dda4e845c40d47384794510a74eaf9 (patch) | |
tree | 49a21ba1dabdc26cc5268e6b5db73f7a51805176 /drivers | |
parent | 88bb42fb5a556ffc918279cad3f86d83c353f055 (diff) |
[media] cx88: support control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 95cdfed80f4e..0f1cc8dba957 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/firmware.h> | 35 | #include <linux/firmware.h> |
36 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
37 | #include <media/v4l2-ioctl.h> | 37 | #include <media/v4l2-ioctl.h> |
38 | #include <media/v4l2-event.h> | ||
38 | #include <media/cx2341x.h> | 39 | #include <media/cx2341x.h> |
39 | 40 | ||
40 | #include "cx88.h" | 41 | #include "cx88.h" |
@@ -1053,7 +1054,7 @@ mpeg_poll(struct file *file, struct poll_table_struct *wait) | |||
1053 | if (!dev->mpeg_active && (req_events & (POLLIN | POLLRDNORM))) | 1054 | if (!dev->mpeg_active && (req_events & (POLLIN | POLLRDNORM))) |
1054 | blackbird_start_codec(file, fh); | 1055 | blackbird_start_codec(file, fh); |
1055 | 1056 | ||
1056 | return videobuf_poll_stream(file, &fh->mpegq, wait); | 1057 | return v4l2_ctrl_poll(file, wait) | videobuf_poll_stream(file, &fh->mpegq, wait); |
1057 | } | 1058 | } |
1058 | 1059 | ||
1059 | static int | 1060 | static int |
@@ -1096,6 +1097,8 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { | |||
1096 | .vidioc_g_tuner = vidioc_g_tuner, | 1097 | .vidioc_g_tuner = vidioc_g_tuner, |
1097 | .vidioc_s_tuner = vidioc_s_tuner, | 1098 | .vidioc_s_tuner = vidioc_s_tuner, |
1098 | .vidioc_s_std = vidioc_s_std, | 1099 | .vidioc_s_std = vidioc_s_std, |
1100 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | ||
1101 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | ||
1099 | }; | 1102 | }; |
1100 | 1103 | ||
1101 | static struct video_device cx8802_mpeg_template = { | 1104 | static struct video_device cx8802_mpeg_template = { |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 673f88be325f..930d43b0d89e 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "cx88.h" | 40 | #include "cx88.h" |
41 | #include <media/v4l2-common.h> | 41 | #include <media/v4l2-common.h> |
42 | #include <media/v4l2-ioctl.h> | 42 | #include <media/v4l2-ioctl.h> |
43 | #include <media/v4l2-event.h> | ||
43 | #include <media/wm8775.h> | 44 | #include <media/wm8775.h> |
44 | 45 | ||
45 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 46 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
@@ -823,12 +824,12 @@ video_poll(struct file *file, struct poll_table_struct *wait) | |||
823 | struct video_device *vdev = video_devdata(file); | 824 | struct video_device *vdev = video_devdata(file); |
824 | struct cx8800_fh *fh = file->private_data; | 825 | struct cx8800_fh *fh = file->private_data; |
825 | struct cx88_buffer *buf; | 826 | struct cx88_buffer *buf; |
826 | unsigned int rc = POLLERR; | 827 | unsigned int rc = v4l2_ctrl_poll(file, wait); |
827 | 828 | ||
828 | if (vdev->vfl_type == VFL_TYPE_VBI) { | 829 | if (vdev->vfl_type == VFL_TYPE_VBI) { |
829 | if (!res_get(fh->dev,fh,RESOURCE_VBI)) | 830 | if (!res_get(fh->dev,fh,RESOURCE_VBI)) |
830 | return POLLERR; | 831 | return rc | POLLERR; |
831 | return videobuf_poll_stream(file, &fh->vbiq, wait); | 832 | return rc | videobuf_poll_stream(file, &fh->vbiq, wait); |
832 | } | 833 | } |
833 | 834 | ||
834 | mutex_lock(&fh->vidq.vb_lock); | 835 | mutex_lock(&fh->vidq.vb_lock); |
@@ -846,9 +847,7 @@ video_poll(struct file *file, struct poll_table_struct *wait) | |||
846 | poll_wait(file, &buf->vb.done, wait); | 847 | poll_wait(file, &buf->vb.done, wait); |
847 | if (buf->vb.state == VIDEOBUF_DONE || | 848 | if (buf->vb.state == VIDEOBUF_DONE || |
848 | buf->vb.state == VIDEOBUF_ERROR) | 849 | buf->vb.state == VIDEOBUF_ERROR) |
849 | rc = POLLIN|POLLRDNORM; | 850 | rc |= POLLIN|POLLRDNORM; |
850 | else | ||
851 | rc = 0; | ||
852 | done: | 851 | done: |
853 | mutex_unlock(&fh->vidq.vb_lock); | 852 | mutex_unlock(&fh->vidq.vb_lock); |
854 | return rc; | 853 | return rc; |
@@ -1561,6 +1560,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
1561 | .vidioc_s_tuner = vidioc_s_tuner, | 1560 | .vidioc_s_tuner = vidioc_s_tuner, |
1562 | .vidioc_g_frequency = vidioc_g_frequency, | 1561 | .vidioc_g_frequency = vidioc_g_frequency, |
1563 | .vidioc_s_frequency = vidioc_s_frequency, | 1562 | .vidioc_s_frequency = vidioc_s_frequency, |
1563 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | ||
1564 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | ||
1564 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1565 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1565 | .vidioc_g_register = vidioc_g_register, | 1566 | .vidioc_g_register = vidioc_g_register, |
1566 | .vidioc_s_register = vidioc_s_register, | 1567 | .vidioc_s_register = vidioc_s_register, |
@@ -1581,6 +1582,7 @@ static const struct v4l2_file_operations radio_fops = | |||
1581 | { | 1582 | { |
1582 | .owner = THIS_MODULE, | 1583 | .owner = THIS_MODULE, |
1583 | .open = video_open, | 1584 | .open = video_open, |
1585 | .poll = v4l2_ctrl_poll, | ||
1584 | .release = video_release, | 1586 | .release = video_release, |
1585 | .unlocked_ioctl = video_ioctl2, | 1587 | .unlocked_ioctl = video_ioctl2, |
1586 | }; | 1588 | }; |
@@ -1591,6 +1593,8 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { | |||
1591 | .vidioc_s_tuner = radio_s_tuner, | 1593 | .vidioc_s_tuner = radio_s_tuner, |
1592 | .vidioc_g_frequency = vidioc_g_frequency, | 1594 | .vidioc_g_frequency = vidioc_g_frequency, |
1593 | .vidioc_s_frequency = vidioc_s_frequency, | 1595 | .vidioc_s_frequency = vidioc_s_frequency, |
1596 | .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, | ||
1597 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | ||
1594 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1598 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1595 | .vidioc_g_register = vidioc_g_register, | 1599 | .vidioc_g_register = vidioc_g_register, |
1596 | .vidioc_s_register = vidioc_s_register, | 1600 | .vidioc_s_register = vidioc_s_register, |