Commit 86dd9831 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] cx23885: support v4l2_fh and g/s_priority

Add support for struct v4l2_fh and priority handling.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent d43be757
...@@ -1550,6 +1550,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, ...@@ -1550,6 +1550,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int mpeg_open(struct file *file) static int mpeg_open(struct file *file)
{ {
struct video_device *vdev = video_devdata(file);
struct cx23885_dev *dev = video_drvdata(file); struct cx23885_dev *dev = video_drvdata(file);
struct cx23885_fh *fh; struct cx23885_fh *fh;
...@@ -1560,6 +1561,7 @@ static int mpeg_open(struct file *file) ...@@ -1560,6 +1561,7 @@ static int mpeg_open(struct file *file)
if (!fh) if (!fh)
return -ENOMEM; return -ENOMEM;
v4l2_fh_init(&fh->fh, vdev);
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
...@@ -1569,6 +1571,7 @@ static int mpeg_open(struct file *file) ...@@ -1569,6 +1571,7 @@ static int mpeg_open(struct file *file)
V4L2_FIELD_INTERLACED, V4L2_FIELD_INTERLACED,
sizeof(struct cx23885_buffer), sizeof(struct cx23885_buffer),
fh, NULL); fh, NULL);
v4l2_fh_add(&fh->fh);
return 0; return 0;
} }
...@@ -1601,6 +1604,8 @@ static int mpeg_release(struct file *file) ...@@ -1601,6 +1604,8 @@ static int mpeg_release(struct file *file)
videobuf_read_stop(&fh->mpegq); videobuf_read_stop(&fh->mpegq);
videobuf_mmap_free(&fh->mpegq); videobuf_mmap_free(&fh->mpegq);
v4l2_fh_del(&fh->fh);
v4l2_fh_exit(&fh->fh);
file->private_data = NULL; file->private_data = NULL;
kfree(fh); kfree(fh);
......
...@@ -883,7 +883,8 @@ static int video_open(struct file *file) ...@@ -883,7 +883,8 @@ static int video_open(struct file *file)
if (NULL == fh) if (NULL == fh)
return -ENOMEM; return -ENOMEM;
file->private_data = fh; v4l2_fh_init(&fh->fh, vdev);
file->private_data = &fh->fh;
fh->dev = dev; fh->dev = dev;
fh->radio = radio; fh->radio = radio;
fh->type = type; fh->type = type;
...@@ -905,6 +906,7 @@ static int video_open(struct file *file) ...@@ -905,6 +906,7 @@ static int video_open(struct file *file)
sizeof(struct cx23885_buffer), sizeof(struct cx23885_buffer),
fh, NULL); fh, NULL);
v4l2_fh_add(&fh->fh);
dprintk(1, "post videobuf_queue_init()\n"); dprintk(1, "post videobuf_queue_init()\n");
...@@ -1003,6 +1005,8 @@ static int video_release(struct file *file) ...@@ -1003,6 +1005,8 @@ static int video_release(struct file *file)
videobuf_mmap_free(&fh->vidq); videobuf_mmap_free(&fh->vidq);
videobuf_mmap_free(&fh->vbiq); videobuf_mmap_free(&fh->vbiq);
v4l2_fh_del(&fh->fh);
v4l2_fh_exit(&fh->fh);
file->private_data = NULL; file->private_data = NULL;
kfree(fh); kfree(fh);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/tuner.h> #include <media/tuner.h>
#include <media/tveeprom.h> #include <media/tveeprom.h>
#include <media/videobuf-dma-sg.h> #include <media/videobuf-dma-sg.h>
...@@ -147,6 +148,7 @@ struct cx23885_tvnorm { ...@@ -147,6 +148,7 @@ struct cx23885_tvnorm {
}; };
struct cx23885_fh { struct cx23885_fh {
struct v4l2_fh fh;
struct cx23885_dev *dev; struct cx23885_dev *dev;
enum v4l2_buf_type type; enum v4l2_buf_type type;
int radio; int radio;
......
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