summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-09-23 13:58:19 +0000
committerGerd Knorr <devnull@localhost>2004-09-23 13:58:19 +0000
commit2f9202097e4418d085a0d6ef636de1d0b0fb84dd (patch)
tree346e618d5502ac1f9abce855416aad2bb0b20a47 /linux/drivers/media/video/saa7134/saa7134-video.c
parent953f8692136acd6aa9201f9388697a7005756894 (diff)
downloadmediapointer-dvb-s2-2f9202097e4418d085a0d6ef636de1d0b0fb84dd.tar.gz
mediapointer-dvb-s2-2f9202097e4418d085a0d6ef636de1d0b0fb84dd.tar.bz2
- make video-bufg don't touch struct file any more, pass through
a void ptr instead of a file ptr everythere. - add cx22702 fe driver,
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 210836a92..14cfff8d7 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-video.c,v 1.13 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: saa7134-video.c,v 1.14 2004/09/23 13:58:19 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* video4linux video interface
@@ -918,10 +918,10 @@ static int buffer_activate(struct saa7134_dev *dev,
return 0;
}
-static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
+static int buffer_prepare(void *priv, struct videobuf_buffer *vb,
enum v4l2_field field)
{
- struct saa7134_fh *fh = file->private_data;
+ struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
struct saa7134_buf *buf = (struct saa7134_buf *)vb;
unsigned int size;
@@ -980,9 +980,9 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
}
static int
-buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
+buffer_setup(void *priv, unsigned int *count, unsigned int *size)
{
- struct saa7134_fh *fh = file->private_data;
+ struct saa7134_fh *fh = priv;
*size = fh->fmt->depth * fh->width * fh->height >> 3;
if (0 == *count)
@@ -991,17 +991,17 @@ buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
return 0;
}
-static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
+static void buffer_queue(void *priv, struct videobuf_buffer *vb)
{
- struct saa7134_fh *fh = file->private_data;
+ struct saa7134_fh *fh = priv;
struct saa7134_buf *buf = (struct saa7134_buf *)vb;
saa7134_buffer_queue(fh->dev,&fh->dev->video_q,buf);
}
-static void buffer_release(struct file *file, struct videobuf_buffer *vb)
+static void buffer_release(void *priv, struct videobuf_buffer *vb)
{
- struct saa7134_fh *fh = file->private_data;
+ struct saa7134_fh *fh = priv;
struct saa7134_buf *buf = (struct saa7134_buf *)vb;
saa7134_dma_free(fh->dev,buf);
@@ -1271,13 +1271,15 @@ video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (res_locked(fh->dev,RESOURCE_VIDEO))
return -EBUSY;
- return videobuf_read_one(file, saa7134_queue(fh),
- data, count, ppos);
+ return videobuf_read_one(file->private_data, saa7134_queue(fh),
+ data, count, ppos,
+ file->f_flags & O_NONBLOCK);
case V4L2_BUF_TYPE_VBI_CAPTURE:
if (!res_get(fh->dev,fh,RESOURCE_VBI))
return -EBUSY;
- return videobuf_read_stream(file, saa7134_queue(fh),
- data, count, ppos, 1);
+ return videobuf_read_stream(file->private_data, saa7134_queue(fh),
+ data, count, ppos, 1,
+ file->f_flags & O_NONBLOCK);
break;
default:
BUG();
@@ -1292,7 +1294,7 @@ video_poll(struct file *file, struct poll_table_struct *wait)
struct videobuf_buffer *buf = NULL;
if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)
- return videobuf_poll_stream(file, &fh->vbi, wait);
+ return videobuf_poll_stream(file->private_data, &fh->vbi, wait);
if (res_check(fh,RESOURCE_VIDEO)) {
if (!list_empty(&fh->cap.stream))
@@ -1305,11 +1307,11 @@ video_poll(struct file *file, struct poll_table_struct *wait)
up(&fh->cap.lock);
return POLLERR;
}
- if (0 != fh->cap.ops->buf_prepare(file,fh->cap.read_buf,fh->cap.field)) {
+ if (0 != fh->cap.ops->buf_prepare(file->private_data,fh->cap.read_buf,fh->cap.field)) {
up(&fh->cap.lock);
return POLLERR;
}
- fh->cap.ops->buf_queue(file,fh->cap.read_buf);
+ fh->cap.ops->buf_queue(file->private_data,fh->cap.read_buf);
fh->cap.read_off = 0;
}
up(&fh->cap.lock);
@@ -1342,20 +1344,20 @@ static int video_release(struct inode *inode, struct file *file)
/* stop video capture */
if (res_check(fh, RESOURCE_VIDEO)) {
- videobuf_streamoff(file,&fh->cap);
+ videobuf_streamoff(file->private_data,&fh->cap);
res_free(dev,fh,RESOURCE_VIDEO);
}
if (fh->cap.read_buf) {
- buffer_release(file,fh->cap.read_buf);
+ buffer_release(file->private_data,fh->cap.read_buf);
kfree(fh->cap.read_buf);
}
/* stop vbi capture */
if (res_check(fh, RESOURCE_VBI)) {
if (fh->vbi.streaming)
- videobuf_streamoff(file,&fh->vbi);
+ videobuf_streamoff(file->private_data,&fh->vbi);
if (fh->vbi.reading)
- videobuf_read_stop(file,&fh->vbi);
+ videobuf_read_stop(file->private_data,&fh->vbi);
res_free(dev,fh,RESOURCE_VBI);
}
@@ -2031,7 +2033,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
req.type = q->type;
req.count = gbuffers;
req.memory = V4L2_MEMORY_MMAP;
- err = videobuf_reqbufs(file,q,&req);
+ err = videobuf_reqbufs(file->private_data,q,&req);
if (err < 0)
return err;
memset(mbuf,0,sizeof(*mbuf));
@@ -2044,16 +2046,17 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
return 0;
}
case VIDIOC_REQBUFS:
- return videobuf_reqbufs(file,saa7134_queue(fh),arg);
+ return videobuf_reqbufs(file->private_data,saa7134_queue(fh),arg);
case VIDIOC_QUERYBUF:
return videobuf_querybuf(saa7134_queue(fh),arg);
case VIDIOC_QBUF:
- return videobuf_qbuf(file,saa7134_queue(fh),arg);
+ return videobuf_qbuf(file->private_data,saa7134_queue(fh),arg);
case VIDIOC_DQBUF:
- return videobuf_dqbuf(file,saa7134_queue(fh),arg);
+ return videobuf_dqbuf(file->private_data,saa7134_queue(fh),arg,
+ file->f_flags & O_NONBLOCK);
case VIDIOC_STREAMON:
{
@@ -2061,13 +2064,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
if (!res_get(dev,fh,res))
return -EBUSY;
- return videobuf_streamon(file,saa7134_queue(fh));
+ return videobuf_streamon(file->private_data,saa7134_queue(fh));
}
case VIDIOC_STREAMOFF:
{
int res = saa7134_resource(fh);
- err = videobuf_streamoff(file,saa7134_queue(fh));
+ err = videobuf_streamoff(file->private_data,saa7134_queue(fh));
if (err < 0)
return err;
res_free(dev,fh,res);