diff options
author | Gerd Knorr <devnull@localhost> | 2004-09-23 13:58:19 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-09-23 13:58:19 +0000 |
commit | 2f9202097e4418d085a0d6ef636de1d0b0fb84dd (patch) | |
tree | 346e618d5502ac1f9abce855416aad2bb0b20a47 /linux/drivers/media/video/saa7134 | |
parent | 953f8692136acd6aa9201f9388697a7005756894 (diff) | |
download | mediapointer-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')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-ts.c | 37 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-vbi.c | 18 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 55 |
3 files changed, 58 insertions, 52 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-ts.c b/linux/drivers/media/video/saa7134/saa7134-ts.c index 265ba86aa..2df96839a 100644 --- a/linux/drivers/media/video/saa7134/saa7134-ts.c +++ b/linux/drivers/media/video/saa7134/saa7134-ts.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-ts.c,v 1.7 2004/09/15 16:15:24 kraxel Exp $ + * $Id: saa7134-ts.c,v 1.8 2004/09/23 13:58:19 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -94,10 +94,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_dev *dev = file->private_data; + struct saa7134_dev *dev = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; unsigned int lines, llength, size; int err; @@ -142,7 +142,7 @@ 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) { *size = TS_PACKET_SIZE * ts_nr_packets; if (0 == *count) @@ -151,17 +151,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_dev *dev = file->private_data; + struct saa7134_dev *dev = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; saa7134_buffer_queue(dev,&dev->ts_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_dev *dev = file->private_data; + struct saa7134_dev *dev = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; saa7134_dma_free(dev,buf); @@ -231,10 +231,10 @@ static int ts_release(struct inode *inode, struct file *file) struct saa7134_dev *dev = file->private_data; if (dev->ts.ts.streaming) - videobuf_streamoff(file,&dev->ts.ts); + videobuf_streamoff(file->private_data,&dev->ts.ts); down(&dev->ts.ts.lock); if (dev->ts.ts.reading) - videobuf_read_stop(file,&dev->ts.ts); + videobuf_read_stop(file->private_data,&dev->ts.ts); dev->ts.users--; /* stop the encoder */ @@ -255,7 +255,9 @@ ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos) dev->ts.started = 1; } - return videobuf_read_stream(file, &dev->ts.ts, data, count, ppos, 0); + return videobuf_read_stream(file->private_data, + &dev->ts.ts, data, count, ppos, 0, + file->f_flags & O_NONBLOCK); } static unsigned int @@ -263,7 +265,7 @@ ts_poll(struct file *file, struct poll_table_struct *wait) { struct saa7134_dev *dev = file->private_data; - return videobuf_poll_stream(file, &dev->ts.ts, wait); + return videobuf_poll_stream(file->private_data, &dev->ts.ts, wait); } @@ -392,22 +394,23 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, } case VIDIOC_REQBUFS: - return videobuf_reqbufs(file,&dev->ts.ts,arg); + return videobuf_reqbufs(file->private_data,&dev->ts.ts,arg); case VIDIOC_QUERYBUF: return videobuf_querybuf(&dev->ts.ts,arg); case VIDIOC_QBUF: - return videobuf_qbuf(file,&dev->ts.ts,arg); + return videobuf_qbuf(file->private_data,&dev->ts.ts,arg); case VIDIOC_DQBUF: - return videobuf_dqbuf(file,&dev->ts.ts,arg); + return videobuf_dqbuf(file->private_data,&dev->ts.ts,arg, + file->f_flags & O_NONBLOCK); case VIDIOC_STREAMON: - return videobuf_streamon(file,&dev->ts.ts); + return videobuf_streamon(file->private_data,&dev->ts.ts); case VIDIOC_STREAMOFF: - return videobuf_streamoff(file,&dev->ts.ts); + return videobuf_streamoff(file->private_data,&dev->ts.ts); case VIDIOC_QUERYCTRL: case VIDIOC_G_CTRL: diff --git a/linux/drivers/media/video/saa7134/saa7134-vbi.c b/linux/drivers/media/video/saa7134/saa7134-vbi.c index 01f77e2cc..312da9bf7 100644 --- a/linux/drivers/media/video/saa7134/saa7134-vbi.c +++ b/linux/drivers/media/video/saa7134/saa7134-vbi.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-vbi.c,v 1.2 2004/09/15 16:15:24 kraxel Exp $ + * $Id: saa7134-vbi.c,v 1.3 2004/09/23 13:58:19 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -115,10 +115,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; struct saa7134_tvnorm *norm = dev->tvnorm; @@ -169,9 +169,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; struct saa7134_dev *dev = fh->dev; int llength,lines; @@ -190,18 +190,18 @@ 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_dev *dev = fh->dev; struct saa7134_buf *buf = (struct saa7134_buf *)vb; saa7134_buffer_queue(dev,&dev->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 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; 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); |