summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-11-07 13:17:14 +0000
committerGerd Knorr <devnull@localhost>2004-11-07 13:17:14 +0000
commit1a6399de3074ab4dc6bdad694bbd8b47d486d6b2 (patch)
tree22189018b0aab90670437f90da90bbbe57789b60 /linux/drivers/media/video/cx88
parent78f377b0ee18b3889b2a2bfcee75ab9786e80a35 (diff)
downloadmediapointer-dvb-s2-1a6399de3074ab4dc6bdad694bbd8b47d486d6b2.tar.gz
mediapointer-dvb-s2-1a6399de3074ab4dc6bdad694bbd8b47d486d6b2.tar.bz2
- yet another video-buf interface change + fixups.
- move more modules to new-style insmod options.
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r--linux/drivers/media/video/cx88/cx88-blackbird.c49
-rw-r--r--linux/drivers/media/video/cx88/cx88-dvb.c37
-rw-r--r--linux/drivers/media/video/cx88/cx88-vbi.c22
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c63
4 files changed, 83 insertions, 88 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c
index 6c4fe5199..0208a8a39 100644
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-blackbird.c,v 1.16 2004/10/19 16:02:04 kraxel Exp $
+ * $Id: cx88-blackbird.c,v 1.17 2004/11/07 13:17:15 kraxel Exp $
*
* Support for a cx23416 mpeg encoder via cx2388x host port.
* "blackbird" reference design.
@@ -543,9 +543,10 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
/* ------------------------------------------------------------------ */
-static int bb_buf_setup(void *priv, unsigned int *count, unsigned int *size)
+static int bb_buf_setup(struct videobuf_queue *q,
+ unsigned int *count, unsigned int *size)
{
- struct cx8802_fh *fh = priv;
+ struct cx8802_fh *fh = q->priv_data;
fh->dev->ts_packet_size = 512;
fh->dev->ts_packet_count = 100;
@@ -561,23 +562,24 @@ static int bb_buf_setup(void *priv, unsigned int *count, unsigned int *size)
}
static int
-bb_buf_prepare(void *priv, struct videobuf_buffer *vb,
- enum v4l2_field field)
+bb_buf_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
+ enum v4l2_field field)
{
- struct cx8802_fh *fh = priv;
+ struct cx8802_fh *fh = q->priv_data;
return cx8802_buf_prepare(fh->dev, (struct cx88_buffer*)vb);
}
static void
-bb_buf_queue(void *priv, struct videobuf_buffer *vb)
+bb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx8802_fh *fh = priv;
+ struct cx8802_fh *fh = q->priv_data;
cx8802_buf_queue(fh->dev, (struct cx88_buffer*)vb);
}
-static void bb_buf_release(void *priv, struct videobuf_buffer *vb)
+static void
+bb_buf_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx8802_fh *fh = priv;
+ struct cx8802_fh *fh = q->priv_data;
cx88_free_buffer(fh->dev->pci, (struct cx88_buffer*)vb);
}
@@ -635,23 +637,23 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
/* --- streaming capture ------------------------------------- */
case VIDIOC_REQBUFS:
- return videobuf_reqbufs(file->private_data, &fh->mpegq, arg);
+ return videobuf_reqbufs(&fh->mpegq, arg);
case VIDIOC_QUERYBUF:
return videobuf_querybuf(&fh->mpegq, arg);
case VIDIOC_QBUF:
- return videobuf_qbuf(file->private_data, &fh->mpegq, arg);
+ return videobuf_qbuf(&fh->mpegq, arg);
case VIDIOC_DQBUF:
- return videobuf_dqbuf(file->private_data, &fh->mpegq, arg,
+ return videobuf_dqbuf(&fh->mpegq, arg,
file->f_flags & O_NONBLOCK);
case VIDIOC_STREAMON:
- return videobuf_streamon(file->private_data, &fh->mpegq);
+ return videobuf_streamon(&fh->mpegq);
case VIDIOC_STREAMOFF:
- return videobuf_streamoff(file->private_data, &fh->mpegq);
+ return videobuf_streamoff(&fh->mpegq);
default:
return -EINVAL;
@@ -696,9 +698,8 @@ static int mpeg_open(struct inode *inode, struct file *file)
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_TOP,
- sizeof(struct cx88_buffer));
- init_MUTEX(&fh->mpegq.lock);
-
+ sizeof(struct cx88_buffer),
+ fh);
return 0;
}
@@ -710,9 +711,9 @@ static int mpeg_release(struct inode *inode, struct file *file)
/* stop mpeg capture */
if (fh->mpegq.streaming)
- videobuf_streamoff(file->private_data,&fh->mpegq);
+ videobuf_streamoff(&fh->mpegq);
if (fh->mpegq.reading)
- videobuf_read_stop(file->private_data,&fh->mpegq);
+ videobuf_read_stop(&fh->mpegq);
file->private_data = NULL;
kfree(fh);
@@ -724,8 +725,7 @@ mpeg_read(struct file *file, char *data, size_t count, loff_t *ppos)
{
struct cx8802_fh *fh = file->private_data;
- return videobuf_read_stream(file->private_data,
- &fh->mpegq, data, count, ppos, 0,
+ return videobuf_read_stream(&fh->mpegq, data, count, ppos, 0,
file->f_flags & O_NONBLOCK);
}
@@ -734,8 +734,7 @@ mpeg_poll(struct file *file, struct poll_table_struct *wait)
{
struct cx8802_fh *fh = file->private_data;
- return videobuf_poll_stream(file, file->private_data,
- &fh->mpegq, wait);
+ return videobuf_poll_stream(file, &fh->mpegq, wait);
}
static int
@@ -743,7 +742,7 @@ mpeg_mmap(struct file *file, struct vm_area_struct * vma)
{
struct cx8802_fh *fh = file->private_data;
- return videobuf_mmap_mapper(vma, &fh->mpegq);
+ return videobuf_mmap_mapper(&fh->mpegq, vma);
}
static struct file_operations mpeg_fops =
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
index 09fa4d18a..b5fbf4a71 100644
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-dvb.c,v 1.17 2004/11/05 09:40:59 kraxel Exp $
+ * $Id: cx88-dvb.c,v 1.18 2004/11/07 13:17:15 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines
@@ -49,9 +49,10 @@ MODULE_PARM_DESC(debug,"enable debug messages [dvb]");
/* ------------------------------------------------------------------ */
-static int dvb_buf_setup(void *priv, unsigned int *count, unsigned int *size)
+static int dvb_buf_setup(struct videobuf_queue *q,
+ unsigned int *count, unsigned int *size)
{
- struct cx8802_dev *dev = priv;
+ struct cx8802_dev *dev = q->priv_data;
dev->ts_packet_size = 188 * 4;
dev->ts_packet_count = 32;
@@ -61,22 +62,22 @@ static int dvb_buf_setup(void *priv, unsigned int *count, unsigned int *size)
return 0;
}
-static int dvb_buf_prepare(void *priv, struct videobuf_buffer *vb,
+static int dvb_buf_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
enum v4l2_field field)
{
- struct cx8802_dev *dev = priv;
+ struct cx8802_dev *dev = q->priv_data;
return cx8802_buf_prepare(dev, (struct cx88_buffer*)vb);
}
-static void dvb_buf_queue(void *priv, struct videobuf_buffer *vb)
+static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx8802_dev *dev = priv;
+ struct cx8802_dev *dev = q->priv_data;
cx8802_buf_queue(dev, (struct cx88_buffer*)vb);
}
-static void dvb_buf_release(void *priv, struct videobuf_buffer *vb)
+static void dvb_buf_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx8802_dev *dev = priv;
+ struct cx8802_dev *dev = q->priv_data;
cx88_free_buffer(dev->pci, (struct cx88_buffer*)vb);
}
@@ -98,14 +99,14 @@ static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
- mt352_write(fe, clock_config, sizeof(mt352_clock_config));
+ mt352_write(fe, clock_config, sizeof(clock_config));
udelay(200);
- mt352_write(fe, reset, sizeof(mt352_reset));
- mt352_write(fe, adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+ mt352_write(fe, reset, sizeof(reset));
+ mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
- mt352_write(fe, agc_cfg, sizeof(mt352_agc_cfg));
- mt352_write(fe, gpp_ctl_cfg, sizeof(mt352_gpp_ctl_cfg));
- mt352_write(fe, capt_range_cfg, sizeof(mt352_capt_range_cfg));
+ mt352_write(fe, agc_cfg, sizeof(agc_cfg));
+ mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
+ mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
return 0;
}
@@ -180,7 +181,6 @@ struct mt352_config dvico_fusionhdtv_dvbt_plus = {
static int dvb_register(struct cx8802_dev *dev)
{
/* init struct videobuf_dvb */
- dev->dvb.priv = dev;
dev->dvb.name = dev->core->name;
/* init frontend */
@@ -261,9 +261,8 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_TOP,
- sizeof(struct cx88_buffer));
- init_MUTEX(&dev->dvb.dvbq.lock);
-
+ sizeof(struct cx88_buffer),
+ dev);
err = dvb_register(dev);
if (0 != err)
goto fail_free;
diff --git a/linux/drivers/media/video/cx88/cx88-vbi.c b/linux/drivers/media/video/cx88/cx88-vbi.c
index 133d7c2da..672d1b456 100644
--- a/linux/drivers/media/video/cx88/cx88-vbi.c
+++ b/linux/drivers/media/video/cx88/cx88-vbi.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-vbi.c,v 1.13 2004/10/13 10:39:00 kraxel Exp $
+ * $Id: cx88-vbi.c,v 1.14 2004/11/07 13:17:15 kraxel Exp $
*/
#include <linux/kernel.h>
#include <linux/module.h>
@@ -143,7 +143,7 @@ void cx8800_vbi_timeout(unsigned long data)
/* ------------------------------------------------------------------ */
static int
-vbi_setup(void *priv, unsigned int *count, unsigned int *size)
+vbi_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
{
*size = VBI_LINE_COUNT * VBI_LINE_LENGTH * 2;
if (0 == *count)
@@ -156,12 +156,12 @@ vbi_setup(void *priv, unsigned int *count, unsigned int *size)
}
static int
-vbi_prepare(void *priv, struct videobuf_buffer *vb,
+vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
enum v4l2_field field)
{
- struct cx8800_fh *fh = priv;
+ struct cx8800_fh *fh = q->priv_data;
struct cx8800_dev *dev = fh->dev;
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
unsigned int size;
int rc;
@@ -192,11 +192,11 @@ vbi_prepare(void *priv, struct videobuf_buffer *vb,
}
static void
-vbi_queue(void *priv, struct videobuf_buffer *vb)
+vbi_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
{
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
struct cx88_buffer *prev;
- struct cx8800_fh *fh = priv;
+ struct cx8800_fh *fh = vq->priv_data;
struct cx8800_dev *dev = fh->dev;
struct cx88_dmaqueue *q = &dev->vbiq;
@@ -224,10 +224,10 @@ vbi_queue(void *priv, struct videobuf_buffer *vb)
}
}
-static void vbi_release(void *priv, struct videobuf_buffer *vb)
+static void vbi_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
- struct cx8800_fh *fh = priv;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
+ struct cx8800_fh *fh = q->priv_data;
cx88_free_buffer(fh->dev->pci,buf);
}
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 933f7739d..e52c54475 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.44 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: cx88-video.c,v 1.45 2004/11/07 13:17:15 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -518,9 +518,9 @@ static int restart_video_queue(struct cx8800_dev *dev,
/* ------------------------------------------------------------------ */
static int
-buffer_setup(void *priv, unsigned int *count, unsigned int *size)
+buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
{
- struct cx8800_fh *fh = priv;
+ struct cx8800_fh *fh = q->priv_data;
*size = fh->fmt->depth*fh->width*fh->height >> 3;
if (0 == *count)
@@ -531,12 +531,12 @@ buffer_setup(void *priv, unsigned int *count, unsigned int *size)
}
static int
-buffer_prepare(void *priv, struct videobuf_buffer *vb,
+buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
enum v4l2_field field)
{
- struct cx8800_fh *fh = priv;
+ struct cx8800_fh *fh = q->priv_data;
struct cx8800_dev *dev = fh->dev;
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
int rc, init_buffer = 0;
BUG_ON(NULL == fh->fmt);
@@ -615,11 +615,11 @@ buffer_prepare(void *priv, struct videobuf_buffer *vb,
}
static void
-buffer_queue(void *priv, struct videobuf_buffer *vb)
+buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
{
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
struct cx88_buffer *prev;
- struct cx8800_fh *fh = priv;
+ struct cx8800_fh *fh = vq->priv_data;
struct cx8800_dev *dev = fh->dev;
struct cx88_dmaqueue *q = &dev->vidq;
@@ -663,10 +663,10 @@ buffer_queue(void *priv, struct videobuf_buffer *vb)
}
}
-static void buffer_release(void *priv, struct videobuf_buffer *vb)
+static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct cx88_buffer *buf = (struct cx88_buffer*)vb;
- struct cx8800_fh *fh = priv;
+ struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
+ struct cx8800_fh *fh = q->priv_data;
cx88_free_buffer(fh->dev->pci,buf);
}
@@ -982,15 +982,15 @@ static int video_open(struct inode *inode, struct file *file)
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
- sizeof(struct cx88_buffer));
+ sizeof(struct cx88_buffer),
+ fh);
videobuf_queue_init(&fh->vbiq, &cx8800_vbi_qops,
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VBI_CAPTURE,
V4L2_FIELD_SEQ_TB,
- sizeof(struct cx88_buffer));
- init_MUTEX(&fh->vidq.lock);
- init_MUTEX(&fh->vbiq.lock);
-
+ sizeof(struct cx88_buffer),
+ fh);
+
if (fh->radio) {
struct cx88_core *core = dev->core;
int board = core->board;
@@ -1017,14 +1017,12 @@ video_read(struct file *file, char *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->private_data,
- &fh->vidq, data, count, ppos,
+ return videobuf_read_one(&fh->vidq, 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->private_data,
- &fh->vbiq, data, count, ppos, 1,
+ return videobuf_read_stream(&fh->vbiq, data, count, ppos, 1,
file->f_flags & O_NONBLOCK);
default:
BUG();
@@ -1041,8 +1039,7 @@ video_poll(struct file *file, struct poll_table_struct *wait)
if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
if (!res_get(fh->dev,fh,RESOURCE_VBI))
return POLLERR;
- return videobuf_poll_stream(file, file->private_data,
- &fh->vbiq, wait);
+ return videobuf_poll_stream(file, &fh->vbiq, wait);
}
if (res_check(fh,RESOURCE_VIDEO)) {
@@ -1076,7 +1073,7 @@ static int video_release(struct inode *inode, struct file *file)
/* stop video capture */
if (res_check(fh, RESOURCE_VIDEO)) {
- videobuf_queue_cancel(file->private_data,&fh->vidq);
+ videobuf_queue_cancel(&fh->vidq);
res_free(dev,fh,RESOURCE_VIDEO);
}
if (fh->vidq.read_buf) {
@@ -1087,9 +1084,9 @@ static int video_release(struct inode *inode, struct file *file)
/* stop vbi capture */
if (res_check(fh, RESOURCE_VBI)) {
if (fh->vbiq.streaming)
- videobuf_streamoff(file->private_data,&fh->vbiq);
+ videobuf_streamoff(&fh->vbiq);
if (fh->vbiq.reading)
- videobuf_read_stop(file->private_data,&fh->vbiq);
+ videobuf_read_stop(&fh->vbiq);
res_free(dev,fh,RESOURCE_VBI);
}
@@ -1103,7 +1100,7 @@ video_mmap(struct file *file, struct vm_area_struct * vma)
{
struct cx8800_fh *fh = file->private_data;
- return videobuf_mmap_mapper(vma, get_queue(fh));
+ return videobuf_mmap_mapper(get_queue(fh), vma);
}
/* ------------------------------------------------------------------ */
@@ -1622,7 +1619,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
req.type = q->type;
req.count = 8;
req.memory = V4L2_MEMORY_MMAP;
- err = videobuf_reqbufs(file->private_data,q,&req);
+ err = videobuf_reqbufs(q,&req);
if (err < 0)
return err;
memset(mbuf,0,sizeof(*mbuf));
@@ -1635,16 +1632,16 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
return 0;
}
case VIDIOC_REQBUFS:
- return videobuf_reqbufs(file->private_data, get_queue(fh), arg);
+ return videobuf_reqbufs(get_queue(fh), arg);
case VIDIOC_QUERYBUF:
return videobuf_querybuf(get_queue(fh), arg);
case VIDIOC_QBUF:
- return videobuf_qbuf(file->private_data, get_queue(fh), arg);
+ return videobuf_qbuf(get_queue(fh), arg);
case VIDIOC_DQBUF:
- return videobuf_dqbuf(file->private_data, get_queue(fh), arg,
+ return videobuf_dqbuf(get_queue(fh), arg,
file->f_flags & O_NONBLOCK);
case VIDIOC_STREAMON:
@@ -1653,13 +1650,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
if (!res_get(dev,fh,res))
return -EBUSY;
- return videobuf_streamon(file->private_data, get_queue(fh));
+ return videobuf_streamon(get_queue(fh));
}
case VIDIOC_STREAMOFF:
{
int res = get_ressource(fh);
- err = videobuf_streamoff(file->private_data, get_queue(fh));
+ err = videobuf_streamoff(get_queue(fh));
if (err < 0)
return err;
res_free(dev,fh,res);