Commit 1259636c authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: adapt saa7146 to video-buf changes.

This patch adapts the saa7146 driver to the video-buf changes.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3c822205
...@@ -371,7 +371,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) ...@@ -371,7 +371,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
if( 0 == fh->vbi_q.streaming ) if( 0 == fh->vbi_q.streaming )
return videobuf_poll_stream(file, &fh->vbi_q, wait); return videobuf_poll_stream(file, file->private_data, &fh->vbi_q, wait);
q = &fh->vbi_q; q = &fh->vbi_q;
} else { } else {
DEB_D(("using video queue.\n")); DEB_D(("using video queue.\n"));
......
...@@ -213,8 +213,9 @@ static int buffer_activate(struct saa7146_dev *dev, ...@@ -213,8 +213,9 @@ static int buffer_activate(struct saa7146_dev *dev,
return 0; return 0;
} }
static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field) static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_buf *buf = (struct saa7146_buf *)vb; struct saa7146_buf *buf = (struct saa7146_buf *)vb;
...@@ -264,7 +265,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l ...@@ -264,7 +265,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l
return err; return err;
} }
static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size) static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
{ {
int llength,lines; int llength,lines;
...@@ -279,8 +280,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si ...@@ -279,8 +280,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si
return 0; return 0;
} }
static void buffer_queue(struct file *file, struct videobuf_buffer *vb) static void buffer_queue(void *priv, struct videobuf_buffer *vb)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
...@@ -290,8 +292,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) ...@@ -290,8 +292,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
saa7146_buffer_queue(dev,&vv->vbi_q,buf); saa7146_buffer_queue(dev,&vv->vbi_q,buf);
} }
static void buffer_release(struct file *file, struct videobuf_buffer *vb) static void buffer_release(void *priv, struct videobuf_buffer *vb)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_buf *buf = (struct saa7146_buf *)vb; struct saa7146_buf *buf = (struct saa7146_buf *)vb;
...@@ -480,7 +483,8 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff ...@@ -480,7 +483,8 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff
} }
mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT);
ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1); ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1,
file->f_flags & O_NONBLOCK);
/* /*
printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3)); printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3));
printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3)); printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3));
......
...@@ -1147,7 +1147,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -1147,7 +1147,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
case VIDIOC_DQBUF: { case VIDIOC_DQBUF: {
struct v4l2_buffer *buf = arg; struct v4l2_buffer *buf = arg;
int ret = 0; int ret = 0;
ret = videobuf_dqbuf(file,q,buf); ret = videobuf_dqbuf(file,q,buf,file->f_flags & O_NONBLOCK);
DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index)); DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index));
return ret; return ret;
} }
...@@ -1240,8 +1240,9 @@ static int buffer_activate (struct saa7146_dev *dev, ...@@ -1240,8 +1240,9 @@ static int buffer_activate (struct saa7146_dev *dev,
return 0; return 0;
} }
static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4l2_field field) static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_field field)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
...@@ -1322,8 +1323,9 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4 ...@@ -1322,8 +1323,9 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4
return err; return err;
} }
static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size) static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS)
...@@ -1341,8 +1343,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si ...@@ -1341,8 +1343,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si
return 0; return 0;
} }
static void buffer_queue(struct file *file, struct videobuf_buffer *vb) static void buffer_queue(void *priv, struct videobuf_buffer *vb)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
...@@ -1353,8 +1356,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) ...@@ -1353,8 +1356,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
} }
static void buffer_release(struct file *file, struct videobuf_buffer *vb) static void buffer_release(void *priv, struct videobuf_buffer *vb)
{ {
struct file *file = priv;
struct saa7146_fh *fh = file->private_data; struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_buf *buf = (struct saa7146_buf *)vb; struct saa7146_buf *buf = (struct saa7146_buf *)vb;
...@@ -1474,7 +1478,8 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo ...@@ -1474,7 +1478,8 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
goto out; goto out;
} }
ret = videobuf_read_one(file,&fh->video_q , data, count, ppos); ret = videobuf_read_one(file,&fh->video_q , data, count, ppos,
file->f_flags & O_NONBLOCK);
if (ret != 0) { if (ret != 0) {
video_end(fh, file); video_end(fh, file);
} else { } else {
......
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