#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/mm.h>
+#include <linux/vmalloc.h>
+#include <linux/usb.h>
#include <media/videobuf-vmalloc.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
-#include <linux/vmalloc.h>
-#include <linux/usb.h>
+#include <media/v4l2-event.h>
#define S2255_VERSION "1.22.1"
#define FIRMWARE_FILE_NAME "f2255usb.bin"
};
struct s2255_fh {
+ /* this must be the first field in this struct */
+ struct v4l2_fh fh;
struct s2255_dev *dev;
struct videobuf_queue vb_vidq;
enum v4l2_buf_type type;
fh = kzalloc(sizeof(*fh), GFP_KERNEL);
if (NULL == fh)
return -ENOMEM;
- file->private_data = fh;
+ v4l2_fh_init(&fh->fh, vdev);
+ v4l2_fh_add(&fh->fh);
+ file->private_data = &fh->fh;
fh->dev = dev;
fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fh->channel = channel;
{
struct s2255_fh *fh = file->private_data;
struct s2255_dev *dev = fh->dev;
- int rc;
+ int rc = v4l2_ctrl_poll(file, wait);
+
dprintk(100, "%s\n", __func__);
if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
return POLLERR;
mutex_lock(&dev->lock);
- rc = videobuf_poll_stream(file, &fh->vb_vidq, wait);
+ rc |= videobuf_poll_stream(file, &fh->vb_vidq, wait);
mutex_unlock(&dev->lock);
return rc;
}
videobuf_mmap_free(&fh->vb_vidq);
mutex_unlock(&dev->lock);
dprintk(1, "%s (dev=%s)\n", __func__, video_device_node_name(vdev));
+ v4l2_fh_del(&fh->fh);
+ v4l2_fh_exit(&fh->fh);
kfree(fh);
return 0;
}
.vidioc_s_parm = vidioc_s_parm,
.vidioc_g_parm = vidioc_g_parm,
.vidioc_enum_frameintervals = vidioc_enum_frameintervals,
+ .vidioc_log_status = v4l2_ctrl_log_status,
+ .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
+ .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
};
static void s2255_video_device_release(struct video_device *vdev)
channel->vdev.ctrl_handler = &channel->hdl;
channel->vdev.lock = &dev->lock;
channel->vdev.v4l2_dev = &dev->v4l2_dev;
+ set_bit(V4L2_FL_USE_FH_PRIO, &channel->vdev.flags);
video_set_drvdata(&channel->vdev, channel);
if (video_nr == -1)
ret = video_register_device(&channel->vdev,