diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-08-28 08:48:29 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-10-01 08:23:29 -0300 |
commit | 245b5ae95f6c58a49f5a7230041f9fbfbaabfc99 (patch) | |
tree | 203e8d39428ff647be77e2b1453ce26534bbac9c /drivers/media | |
parent | 45053edc054ac9467adfdaf4f8a39db15af22b37 (diff) | |
download | linux-stable-245b5ae95f6c58a49f5a7230041f9fbfbaabfc99.tar.gz linux-stable-245b5ae95f6c58a49f5a7230041f9fbfbaabfc99.tar.bz2 linux-stable-245b5ae95f6c58a49f5a7230041f9fbfbaabfc99.zip |
[media] saa7164: add support for control events
Now that saa7164 uses v4l2_fh and that poll() has been fixed, it is
trivial to add support for control events.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/pci/saa7164/saa7164-encoder.c | 8 | ||||
-rw-r--r-- | drivers/media/pci/saa7164/saa7164.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index fd32fa0c8cb7..3bd76c4663a9 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -919,7 +919,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) struct saa7164_encoder_fh *fh = (struct saa7164_encoder_fh *)file->private_data; struct saa7164_port *port = fh->port; - unsigned int mask = 0; + unsigned int mask = v4l2_ctrl_poll(file, wait); port->last_poll_msecs_diff = port->last_poll_msecs; port->last_poll_msecs = jiffies_to_msecs(jiffies); @@ -935,7 +935,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait) if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { if (atomic_inc_return(&port->v4l_reader_count) == 1) { if (saa7164_encoder_initialize(port) < 0) - return POLLERR; + return mask | POLLERR; saa7164_encoder_start_streaming(port); msleep(200); } @@ -976,6 +976,10 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, + .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, + .vidioc_log_status = v4l2_ctrl_log_status, + .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, + .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; static struct video_device saa7164_mpeg_template = { diff --git a/drivers/media/pci/saa7164/saa7164.h b/drivers/media/pci/saa7164/saa7164.h index 05707e393b2c..1d8e95d4dae3 100644 --- a/drivers/media/pci/saa7164/saa7164.h +++ b/drivers/media/pci/saa7164/saa7164.h @@ -65,6 +65,7 @@ #include <media/v4l2-ioctl.h> #include <media/v4l2-device.h> #include <media/v4l2-ctrls.h> +#include <media/v4l2-event.h> #include "saa7164-reg.h" #include "saa7164-types.h" |