Commit 1a3c60a0 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] cx88: support control events

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 88bb42fb
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/firmware.h> #include <linux/firmware.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/cx2341x.h> #include <media/cx2341x.h>
#include "cx88.h" #include "cx88.h"
...@@ -1053,7 +1054,7 @@ mpeg_poll(struct file *file, struct poll_table_struct *wait) ...@@ -1053,7 +1054,7 @@ mpeg_poll(struct file *file, struct poll_table_struct *wait)
if (!dev->mpeg_active && (req_events & (POLLIN | POLLRDNORM))) if (!dev->mpeg_active && (req_events & (POLLIN | POLLRDNORM)))
blackbird_start_codec(file, fh); blackbird_start_codec(file, fh);
return videobuf_poll_stream(file, &fh->mpegq, wait); return v4l2_ctrl_poll(file, wait) | videobuf_poll_stream(file, &fh->mpegq, wait);
} }
static int static int
...@@ -1096,6 +1097,8 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { ...@@ -1096,6 +1097,8 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
.vidioc_g_tuner = vidioc_g_tuner, .vidioc_g_tuner = vidioc_g_tuner,
.vidioc_s_tuner = vidioc_s_tuner, .vidioc_s_tuner = vidioc_s_tuner,
.vidioc_s_std = vidioc_s_std, .vidioc_s_std = vidioc_s_std,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
}; };
static struct video_device cx8802_mpeg_template = { static struct video_device cx8802_mpeg_template = {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "cx88.h" #include "cx88.h"
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/wm8775.h> #include <media/wm8775.h>
MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); 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,12 +824,12 @@ video_poll(struct file *file, struct poll_table_struct *wait)
struct video_device *vdev = video_devdata(file); struct video_device *vdev = video_devdata(file);
struct cx8800_fh *fh = file->private_data; struct cx8800_fh *fh = file->private_data;
struct cx88_buffer *buf; struct cx88_buffer *buf;
unsigned int rc = POLLERR; unsigned int rc = v4l2_ctrl_poll(file, wait);
if (vdev->vfl_type == VFL_TYPE_VBI) { if (vdev->vfl_type == VFL_TYPE_VBI) {
if (!res_get(fh->dev,fh,RESOURCE_VBI)) if (!res_get(fh->dev,fh,RESOURCE_VBI))
return POLLERR; return rc | POLLERR;
return videobuf_poll_stream(file, &fh->vbiq, wait); return rc | videobuf_poll_stream(file, &fh->vbiq, wait);
} }
mutex_lock(&fh->vidq.vb_lock); mutex_lock(&fh->vidq.vb_lock);
...@@ -846,9 +847,7 @@ video_poll(struct file *file, struct poll_table_struct *wait) ...@@ -846,9 +847,7 @@ video_poll(struct file *file, struct poll_table_struct *wait)
poll_wait(file, &buf->vb.done, wait); poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == VIDEOBUF_DONE || if (buf->vb.state == VIDEOBUF_DONE ||
buf->vb.state == VIDEOBUF_ERROR) buf->vb.state == VIDEOBUF_ERROR)
rc = POLLIN|POLLRDNORM; rc |= POLLIN|POLLRDNORM;
else
rc = 0;
done: done:
mutex_unlock(&fh->vidq.vb_lock); mutex_unlock(&fh->vidq.vb_lock);
return rc; return rc;
...@@ -1561,6 +1560,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { ...@@ -1561,6 +1560,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_tuner = vidioc_s_tuner, .vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency, .vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency, .vidioc_s_frequency = vidioc_s_frequency,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register = vidioc_g_register, .vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register, .vidioc_s_register = vidioc_s_register,
...@@ -1581,6 +1582,7 @@ static const struct v4l2_file_operations radio_fops = ...@@ -1581,6 +1582,7 @@ static const struct v4l2_file_operations radio_fops =
{ {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = video_open, .open = video_open,
.poll = v4l2_ctrl_poll,
.release = video_release, .release = video_release,
.unlocked_ioctl = video_ioctl2, .unlocked_ioctl = video_ioctl2,
}; };
...@@ -1591,6 +1593,8 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { ...@@ -1591,6 +1593,8 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {
.vidioc_s_tuner = radio_s_tuner, .vidioc_s_tuner = radio_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency, .vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency, .vidioc_s_frequency = vidioc_s_frequency,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register = vidioc_g_register, .vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register, .vidioc_s_register = vidioc_s_register,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment