diff options
author | Gerd Knorr <devnull@localhost> | 2004-11-07 13:17:14 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-11-07 13:17:14 +0000 |
commit | 1a6399de3074ab4dc6bdad694bbd8b47d486d6b2 (patch) | |
tree | 22189018b0aab90670437f90da90bbbe57789b60 | |
parent | 78f377b0ee18b3889b2a2bfcee75ab9786e80a35 (diff) | |
download | mediapointer-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.
27 files changed, 437 insertions, 456 deletions
diff --git a/linux/drivers/media/common/ir-common.c b/linux/drivers/media/common/ir-common.c index d40c8f37b..10e608a9d 100644 --- a/linux/drivers/media/common/ir-common.c +++ b/linux/drivers/media/common/ir-common.c @@ -1,5 +1,5 @@ /* - * $Id: ir-common.c,v 1.4 2004/10/13 10:39:00 kraxel Exp $ + * $Id: ir-common.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ * * some common structs and functions to handle infrared remotes via * input layer ... @@ -36,11 +36,11 @@ MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); static int repeat = 1; -MODULE_PARM(repeat,"i"); +module_param(repeat, int, 0444); MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)"); static int debug = 0; /* debug level (0,1,2) */ -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); #define dprintk(level, fmt, arg...) if (debug >= level) \ printk(KERN_DEBUG fmt , ## arg) diff --git a/linux/drivers/media/video/btcx-risc.c b/linux/drivers/media/video/btcx-risc.c index 4ecb36193..ab5dfcbac 100644 --- a/linux/drivers/media/video/btcx-risc.c +++ b/linux/drivers/media/video/btcx-risc.c @@ -1,5 +1,5 @@ /* - $Id: btcx-risc.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $ + $Id: btcx-risc.c,v 1.4 2004/11/07 13:17:14 kraxel Exp $ btcx-risc.c @@ -39,7 +39,7 @@ MODULE_AUTHOR("Gerd Knorr"); MODULE_LICENSE("GPL"); static unsigned int debug = 0; -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)"); /* ---------------------------------------------------------- */ diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c index a1c3ab74a..8aa672e4d 100644 --- a/linux/drivers/media/video/bttv-cards.c +++ b/linux/drivers/media/video/bttv-cards.c @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.31 2004/10/27 18:34:55 kraxel Exp $ + $Id: bttv-cards.c,v 1.32 2004/11/07 13:17:14 kraxel Exp $ bttv-cards.c @@ -106,53 +106,31 @@ static unsigned int audioall = UNSET; static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET }; /* insmod options */ -MODULE_PARM(triton1,"i"); +module_param(triton1, int, 0444); +module_param(vsfx, int, 0444); +module_param(no_overlay, int, 0444); +module_param(latency, int, 0444); +module_param(gpiomask, int, 0444); +module_param(audioall, int, 0444); +module_param(autoload, int, 0444); + +module_param_array(card, int, NULL, 0444); +module_param_array(pll, int, NULL, 0444); +module_param_array(tuner, int, NULL, 0444); +module_param_array(svhs, int, NULL, 0444); +module_param_array(remote, int, NULL, 0444); +module_param_array(audiomux, int, NULL, 0444); + MODULE_PARM_DESC(triton1,"set ETBF pci config bit " "[enable bug compatibility for triton1 + others]"); -MODULE_PARM(vsfx,"i"); MODULE_PARM_DESC(vsfx,"set VSFX pci config bit " "[yet another chipset flaw workaround]"); -MODULE_PARM(no_overlay,"i"); -MODULE_PARM(latency,"i"); MODULE_PARM_DESC(latency,"pci latency timer"); -MODULE_PARM(card,"1-" __stringify(BTTV_MAX) "i"); MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list"); -MODULE_PARM(pll,"1-" __stringify(BTTV_MAX) "i"); MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)"); -MODULE_PARM(tuner,"1-" __stringify(BTTV_MAX) "i"); MODULE_PARM_DESC(tuner,"specify installed tuner type"); -MODULE_PARM(autoload,"i"); MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)"); -MODULE_PARM(svhs,"1-" __stringify(BTTV_MAX) "i"); -MODULE_PARM(remote,"1-" __stringify(BTTV_MAX) "i"); - -MODULE_PARM(gpiomask,"i"); -MODULE_PARM(audioall,"i"); -MODULE_PARM(audiomux,"1-6i"); - -/* kernel args */ -#ifndef MODULE -static int __init p_card(char *str) { return bttv_parse(str,BTTV_MAX,card); } -static int __init p_pll(char *str) { return bttv_parse(str,BTTV_MAX,pll); } -static int __init p_tuner(char *str) { return bttv_parse(str,BTTV_MAX,tuner); } -__setup("bttv.card=", p_card); -__setup("bttv.pll=", p_pll); -__setup("bttv.tuner=", p_tuner); - -int __init bttv_parse(char *str, int max, int *vals) -{ - int i,number,res = 2; - - for (i = 0; res == 2 && i < max; i++) { - res = get_option(&str,&number); - if (res) - vals[i] = number; - } - return 1; -} -#endif - /* ----------------------------------------------------------------------- */ /* list of card IDs for bt878+ cards */ diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c index 64c7719a6..0f7ba5314 100644 --- a/linux/drivers/media/video/bttv-driver.c +++ b/linux/drivers/media/video/bttv-driver.c @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.25 2004/11/03 09:04:50 kraxel Exp $ + $Id: bttv-driver.c,v 1.26 2004/11/07 13:17:14 kraxel Exp $ bttv - Bt848 frame grabber driver @@ -77,53 +77,52 @@ static unsigned int vcr_hack = 0; static unsigned int irq_iswitch = 0; /* API features (turn on/off stuff for testing) */ -static unsigned int v4l2 = 1; +static unsigned int v4l2 = 1; /* insmod args */ -MODULE_PARM(radio,"1-" __stringify(BTTV_MAX) "i"); +module_param(bttv_verbose, int, 0644); +module_param(bttv_gpio, int, 0644); +module_param(bttv_debug, int, 0644); +module_param(irq_debug, int, 0644); +module_param(debug_latency, int, 0644); + +module_param(fdsr, int, 0444); +module_param(video_nr, int, 0444); +module_param(radio_nr, int, 0444); +module_param(vbi_nr, int, 0444); +module_param(gbuffers, int, 0444); +module_param(gbufsize, int, 0444); + +module_param(v4l2, int, 0644); +module_param(bigendian, int, 0644); +module_param(irq_iswitch, int, 0644); +module_param(combfilter, int, 0444); +module_param(lumafilter, int, 0444); +module_param(automute, int, 0444); +module_param(chroma_agc, int, 0444); +module_param(adc_crush, int, 0444); +module_param(whitecrush_upper, int, 0444); +module_param(whitecrush_lower, int, 0444); +module_param(vcr_hack, int, 0444); +module_param_array(radio, int, NULL, 0444); + MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)"); -MODULE_PARM(bigendian,"i"); MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian"); -MODULE_PARM(bttv_verbose,"i"); MODULE_PARM_DESC(bttv_verbose,"verbose startup messages, default is 1 (yes)"); -MODULE_PARM(bttv_gpio,"i"); MODULE_PARM_DESC(bttv_gpio,"log gpio changes, default is 0 (no)"); -MODULE_PARM(bttv_debug,"i"); MODULE_PARM_DESC(bttv_debug,"debug messages, default is 0 (no)"); -MODULE_PARM(irq_debug,"i"); MODULE_PARM_DESC(irq_debug,"irq handler debug messages, default is 0 (no)"); -MODULE_PARM(gbuffers,"i"); MODULE_PARM_DESC(gbuffers,"number of capture buffers. range 2-32, default 8"); -MODULE_PARM(gbufsize,"i"); MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000"); - -MODULE_PARM(video_nr,"i"); -MODULE_PARM(radio_nr,"i"); -MODULE_PARM(vbi_nr,"i"); -MODULE_PARM(debug_latency,"i"); - -MODULE_PARM(fdsr,"i"); - -MODULE_PARM(combfilter,"i"); -MODULE_PARM(lumafilter,"i"); -MODULE_PARM(automute,"i"); MODULE_PARM_DESC(automute,"mute audio on bad/missing video signal, default is 1 (yes)"); -MODULE_PARM(chroma_agc,"i"); MODULE_PARM_DESC(chroma_agc,"enables the AGC of chroma signal, default is 0 (no)"); -MODULE_PARM(adc_crush,"i"); MODULE_PARM_DESC(adc_crush,"enables the luminance ADC crush, default is 1 (yes)"); -MODULE_PARM(whitecrush_upper,"i"); MODULE_PARM_DESC(whitecrush_upper,"sets the white crush upper value, default is 207"); -MODULE_PARM(whitecrush_lower,"i"); MODULE_PARM_DESC(whitecrush_lower,"sets the white crush lower value, default is 127"); -MODULE_PARM(vcr_hack,"i"); MODULE_PARM_DESC(vcr_hack,"enables the VCR hack (improves synch on poor VCR tapes), default is 0 (no)"); -MODULE_PARM(irq_iswitch,"i"); MODULE_PARM_DESC(irq_iswitch,"switch inputs in irq handler"); -MODULE_PARM(v4l2,"i"); - MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards"); MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr"); MODULE_LICENSE("GPL"); @@ -1415,9 +1414,9 @@ static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf, } 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 bttv_fh *fh = priv; + struct bttv_fh *fh = q->priv_data; *size = fh->fmt->depth*fh->width*fh->height >> 3; if (0 == *count) @@ -1428,21 +1427,21 @@ 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 bttv_buffer *buf = (struct bttv_buffer*)vb; - struct bttv_fh *fh = priv; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); + struct bttv_fh *fh = q->priv_data; return bttv_prepare_buffer(fh->btv, buf, fh->fmt, fh->width, fh->height, field); } static void -buffer_queue(void *priv, struct videobuf_buffer *vb) +buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct bttv_buffer *buf = (struct bttv_buffer*)vb; - struct bttv_fh *fh = priv; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); + struct bttv_fh *fh = q->priv_data; struct bttv *btv = fh->btv; buf->vb.state = STATE_QUEUED; @@ -1453,10 +1452,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 bttv_buffer *buf = (struct bttv_buffer*)vb; - struct bttv_fh *fh = priv; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); + struct bttv_fh *fh = q->priv_data; bttv_dma_free(fh->btv,buf); } @@ -2387,8 +2386,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, unsigned int i; down(&fh->cap.lock); - retval = videobuf_mmap_setup(file->private_data, - &fh->cap,gbuffers,gbufsize, + retval = videobuf_mmap_setup(&fh->cap,gbuffers,gbufsize, V4L2_MEMORY_MMAP); if (retval < 0) goto fh_unlock_and_return; @@ -2686,16 +2684,16 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, } case VIDIOC_REQBUFS: - return videobuf_reqbufs(file->private_data,bttv_queue(fh),arg); + return videobuf_reqbufs(bttv_queue(fh),arg); case VIDIOC_QUERYBUF: return videobuf_querybuf(bttv_queue(fh),arg); case VIDIOC_QBUF: - return videobuf_qbuf(file->private_data,bttv_queue(fh),arg); + return videobuf_qbuf(bttv_queue(fh),arg); case VIDIOC_DQBUF: - return videobuf_dqbuf(file->private_data,bttv_queue(fh),arg, + return videobuf_dqbuf(bttv_queue(fh),arg, file->f_flags & O_NONBLOCK); case VIDIOC_STREAMON: @@ -2704,13 +2702,13 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, if (!check_alloc_btres(btv,fh,res)) return -EBUSY; - return videobuf_streamon(file->private_data,bttv_queue(fh)); + return videobuf_streamon(bttv_queue(fh)); } case VIDIOC_STREAMOFF: { int res = bttv_resource(fh); - retval = videobuf_streamoff(file->private_data,bttv_queue(fh)); + retval = videobuf_streamoff(bttv_queue(fh)); if (retval < 0) return retval; free_btres(btv,fh,res); @@ -2847,15 +2845,13 @@ static ssize_t bttv_read(struct file *file, char __user *data, case V4L2_BUF_TYPE_VIDEO_CAPTURE: if (locked_btres(fh->btv,RESOURCE_VIDEO)) return -EBUSY; - retval = videobuf_read_one(file->private_data, - &fh->cap, data, count, ppos, + retval = videobuf_read_one(&fh->cap, data, count, ppos, file->f_flags & O_NONBLOCK); break; case V4L2_BUF_TYPE_VBI_CAPTURE: if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI)) return -EBUSY; - retval = videobuf_read_stream(file->private_data, - &fh->vbi, data, count, ppos, 1, + retval = videobuf_read_stream(&fh->vbi, data, count, ppos, 1, file->f_flags & O_NONBLOCK); break; default: @@ -2873,8 +2869,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI)) return POLLERR; - return videobuf_poll_stream(file, file->private_data, - &fh->vbi, wait); + return videobuf_poll_stream(file, &fh->vbi, wait); } if (check_btres(fh,RESOURCE_VIDEO)) { @@ -2962,12 +2957,14 @@ static int bttv_open(struct inode *inode, struct file *file) btv->c.pci, &btv->s_lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED, - sizeof(struct bttv_buffer)); + sizeof(struct bttv_buffer), + fh); videobuf_queue_init(&fh->vbi, &bttv_vbi_qops, btv->c.pci, &btv->s_lock, V4L2_BUF_TYPE_VBI_CAPTURE, V4L2_FIELD_SEQ_TB, - sizeof(struct bttv_buffer)); + sizeof(struct bttv_buffer), + fh); i2c_vidiocschan(btv); btv->users++; @@ -2988,7 +2985,7 @@ static int bttv_release(struct inode *inode, struct file *file) /* stop video capture */ if (check_btres(fh, RESOURCE_VIDEO)) { - videobuf_streamoff(file->private_data,&fh->cap); + videobuf_streamoff(&fh->cap); free_btres(btv,fh,RESOURCE_VIDEO); } if (fh->cap.read_buf) { @@ -2999,9 +2996,9 @@ static int bttv_release(struct inode *inode, struct file *file) /* stop vbi capture */ if (check_btres(fh, RESOURCE_VBI)) { if (fh->vbi.streaming) - videobuf_streamoff(file->private_data,&fh->vbi); + videobuf_streamoff(&fh->vbi); if (fh->vbi.reading) - videobuf_read_stop(file->private_data,&fh->vbi); + videobuf_read_stop(&fh->vbi); free_btres(btv,fh,RESOURCE_VBI); } @@ -3024,7 +3021,7 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma) dprintk("bttv%d: mmap type=%s 0x%lx+%ld\n", fh->btv->c.nr, v4l2_type_names[fh->type], vma->vm_start, vma->vm_end - vma->vm_start); - return videobuf_mmap_mapper(vma,bttv_queue(fh)); + return videobuf_mmap_mapper(bttv_queue(fh),vma); } static struct file_operations bttv_fops = diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c index e76b71178..5d84a44c7 100644 --- a/linux/drivers/media/video/bttv-i2c.c +++ b/linux/drivers/media/video/bttv-i2c.c @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.12 2004/10/27 18:34:55 kraxel Exp $ + $Id: bttv-i2c.c,v 1.13 2004/11/07 13:17:15 kraxel Exp $ bttv-i2c.c -- all the i2c code is here @@ -43,9 +43,9 @@ static int detach_inform(struct i2c_client *client); static int i2c_debug = 0; static int i2c_hw = 0; static int i2c_scan = 0; -MODULE_PARM(i2c_debug,"i"); -MODULE_PARM(i2c_hw,"i"); -MODULE_PARM(i2c_scan,"i"); +module_param(i2c_debug, int, 0644); +module_param(i2c_hw, int, 0444); +module_param(i2c_scan, int, 0444); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); /* ----------------------------------------------------------------------- */ diff --git a/linux/drivers/media/video/bttv-vbi.c b/linux/drivers/media/video/bttv-vbi.c index 0e944f523..ecdd9bfd6 100644 --- a/linux/drivers/media/video/bttv-vbi.c +++ b/linux/drivers/media/video/bttv-vbi.c @@ -1,5 +1,5 @@ /* - $Id: bttv-vbi.c,v 1.6 2004/10/13 10:39:00 kraxel Exp $ + $Id: bttv-vbi.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $ bttv - Bt848 frame grabber driver vbi interface @@ -37,9 +37,9 @@ static unsigned int vbibufs = 4; static unsigned int vbi_debug = 0; -MODULE_PARM(vbibufs,"i"); +module_param(vbibufs, int, 0444); +module_param(vbi_debug, int, 0644); MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32, default 4"); -MODULE_PARM(vbi_debug,"i"); MODULE_PARM_DESC(vbi_debug,"vbi code debug messages, default is 0 (no)"); #ifdef dprintk @@ -63,10 +63,10 @@ vbi_buffer_risc(struct bttv *btv, struct bttv_buffer *buf, int lines) return 0; } -static int vbi_buffer_setup(void *priv, +static int vbi_buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) { - struct bttv_fh *fh = priv; + struct bttv_fh *fh = q->priv_data; struct bttv *btv = fh->btv; if (0 == *count) @@ -76,12 +76,13 @@ static int vbi_buffer_setup(void *priv, return 0; } -static int vbi_buffer_prepare(void *priv, struct videobuf_buffer *vb, +static int vbi_buffer_prepare(struct videobuf_queue *q, + struct videobuf_buffer *vb, enum v4l2_field field) { - struct bttv_fh *fh = priv; + struct bttv_fh *fh = q->priv_data; struct bttv *btv = fh->btv; - struct bttv_buffer *buf = (struct bttv_buffer*)vb; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); int rc; buf->vb.size = fh->lines * 2 * 2048; @@ -107,11 +108,11 @@ static int vbi_buffer_prepare(void *priv, struct videobuf_buffer *vb, } static void -vbi_buffer_queue(void *priv, struct videobuf_buffer *vb) +vbi_buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct bttv_fh *fh = priv; + struct bttv_fh *fh = q->priv_data; struct bttv *btv = fh->btv; - struct bttv_buffer *buf = (struct bttv_buffer*)vb; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); dprintk("queue %p\n",vb); buf->vb.state = STATE_QUEUED; @@ -122,11 +123,11 @@ vbi_buffer_queue(void *priv, struct videobuf_buffer *vb) } } -static void vbi_buffer_release(void *priv, struct videobuf_buffer *vb) +static void vbi_buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct bttv_fh *fh = priv; + struct bttv_fh *fh = q->priv_data; struct bttv *btv = fh->btv; - struct bttv_buffer *buf = (struct bttv_buffer*)vb; + struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); dprintk("free %p\n",vb); bttv_dma_free(fh->btv,buf); 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); diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 996b8149f..3dec8dd3d 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-core.c,v 1.13 2004/10/19 16:02:05 kraxel Exp $ + * $Id: saa7134-core.c,v 1.14 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * driver core @@ -41,53 +41,49 @@ MODULE_LICENSE("GPL"); /* ------------------------------------------------------------------ */ static unsigned int irq_debug = 0; -MODULE_PARM(irq_debug,"i"); +module_param(irq_debug, int, 0644); MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]"); static unsigned int core_debug = 0; -MODULE_PARM(core_debug,"i"); +module_param(core_debug, int, 0644); MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); static unsigned int gpio_tracking = 0; -MODULE_PARM(gpio_tracking,"i"); +module_param(gpio_tracking, int, 0644); MODULE_PARM_DESC(gpio_tracking,"enable debug messages [gpio]"); -static unsigned int video_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(video_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(video_nr,"video device number"); - -static unsigned int vbi_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(vbi_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(vbi_nr,"vbi device number"); - -static unsigned int radio_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(radio_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(radio_nr,"radio device number"); - static unsigned int oss = 0; -MODULE_PARM(oss,"i"); +module_param(oss, int, 0444); MODULE_PARM_DESC(oss,"register oss devices (default: no)"); -static unsigned int dsp_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(dsp_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(dsp_nr,"oss dsp device number"); - -static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(mixer_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(mixer_nr,"oss mixer device number"); - -static unsigned int tuner[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(tuner,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(tuner,"tuner type"); - -static unsigned int card[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(card,"1-" __stringify(SAA7134_MAXBOARDS) "i"); -MODULE_PARM_DESC(card,"card type"); - static unsigned int latency = UNSET; -MODULE_PARM(latency,"i"); +module_param(latency, int, 0444); MODULE_PARM_DESC(latency,"pci latency timer"); +static unsigned int video_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int vbi_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int radio_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int dsp_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int tuner[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int card[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; + +module_param_array(video_nr, int, NULL, 0444); +module_param_array(vbi_nr, int, NULL, 0444); +module_param_array(radio_nr, int, NULL, 0444); +module_param_array(dsp_nr, int, NULL, 0444); +module_param_array(mixer_nr, int, NULL, 0444); +module_param_array(tuner, int, NULL, 0444); +module_param_array(card, int, NULL, 0444); + +MODULE_PARM_DESC(video_nr, "video device number"); +MODULE_PARM_DESC(vbi_nr, "vbi device number"); +MODULE_PARM_DESC(radio_nr, "radio device number"); +MODULE_PARM_DESC(dsp_nr, "oss dsp device number"); +MODULE_PARM_DESC(mixer_nr, "oss mixer device number"); +MODULE_PARM_DESC(tuner, "tuner type"); +MODULE_PARM_DESC(card, "card type"); + static DECLARE_MUTEX(devlist_lock); LIST_HEAD(saa7134_devlist); static LIST_HEAD(mops_list); diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c index 685297a9f..584cfe6fe 100644 --- a/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-dvb.c,v 1.2 2004/10/20 17:44:24 kraxel Exp $ + * $Id: saa7134-dvb.c,v 1.3 2004/11/07 13:17:15 kraxel Exp $ * * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] * @@ -39,18 +39,16 @@ static int dvb_init(struct saa7134_dev *dev) { printk("%s: %s\n",dev->name,__FUNCTION__); + /* init struct videobuf_dvb */ + dev->dvb.name = dev->name; videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops, dev->pci, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_TOP, - sizeof(struct saa7134_buf)); - init_MUTEX(&dev->dvb.dvbq.lock); - - /* init struct videobuf_dvb */ - dev->dvb.priv = dev; - dev->dvb.name = dev->name; - - /* TODO: init + register frontend */ + sizeof(struct saa7134_buf), + dev); + + /* TODO: init frontend */ if (NULL == dev->dvb.frontend) return -1; diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c index 683ef885c..d921af8a1 100644 --- a/linux/drivers/media/video/saa7134/saa7134-empress.c +++ b/linux/drivers/media/video/saa7134/saa7134-empress.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-empress.c,v 1.2 2004/10/20 17:44:24 kraxel Exp $ + * $Id: saa7134-empress.c,v 1.3 2004/11/07 13:17:15 kraxel Exp $ * * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] * @@ -40,11 +40,11 @@ MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); static unsigned int empress_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM(empress_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +module_param_array(empress_nr, int, NULL, 0444); MODULE_PARM_DESC(empress_nr,"ts device number"); static unsigned int debug = 0; -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"enable debug messages"); #define dprintk(fmt, arg...) if (debug) \ @@ -105,10 +105,10 @@ static int ts_release(struct inode *inode, struct file *file) struct saa7134_dev *dev = file->private_data; if (dev->empress_tsq.streaming) - videobuf_streamoff(file->private_data,&dev->empress_tsq); + videobuf_streamoff(&dev->empress_tsq); down(&dev->empress_tsq.lock); if (dev->empress_tsq.reading) - videobuf_read_stop(file->private_data,&dev->empress_tsq); + videobuf_read_stop(&dev->empress_tsq); dev->empress_users--; /* stop the encoder */ @@ -123,7 +123,7 @@ ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct saa7134_dev *dev = file->private_data; - return videobuf_read_stream(file->private_data, &dev->empress_tsq, + return videobuf_read_stream(&dev->empress_tsq, data, count, ppos, 0, file->f_flags & O_NONBLOCK); } @@ -133,8 +133,7 @@ ts_poll(struct file *file, struct poll_table_struct *wait) { struct saa7134_dev *dev = file->private_data; - return videobuf_poll_stream(file, file->private_data, - &dev->empress_tsq, wait); + return videobuf_poll_stream(file, &dev->empress_tsq, wait); } @@ -143,7 +142,7 @@ ts_mmap(struct file *file, struct vm_area_struct * vma) { struct saa7134_dev *dev = file->private_data; - return videobuf_mmap_mapper(vma, &dev->empress_tsq); + return videobuf_mmap_mapper(&dev->empress_tsq, vma); } /* @@ -263,23 +262,23 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, } case VIDIOC_REQBUFS: - return videobuf_reqbufs(file->private_data,&dev->empress_tsq,arg); + return videobuf_reqbufs(&dev->empress_tsq,arg); case VIDIOC_QUERYBUF: return videobuf_querybuf(&dev->empress_tsq,arg); case VIDIOC_QBUF: - return videobuf_qbuf(file->private_data,&dev->empress_tsq,arg); + return videobuf_qbuf(&dev->empress_tsq,arg); case VIDIOC_DQBUF: - return videobuf_dqbuf(file->private_data,&dev->empress_tsq,arg, + return videobuf_dqbuf(&dev->empress_tsq,arg, file->f_flags & O_NONBLOCK); case VIDIOC_STREAMON: - return videobuf_streamon(file->private_data,&dev->empress_tsq); + return videobuf_streamon(&dev->empress_tsq); case VIDIOC_STREAMOFF: - return videobuf_streamoff(file->private_data,&dev->empress_tsq); + return videobuf_streamoff(&dev->empress_tsq); case VIDIOC_QUERYCTRL: case VIDIOC_G_CTRL: @@ -354,11 +353,12 @@ static int empress_init(struct saa7134_dev *dev) printk(KERN_INFO "%s: registered device video%d [mpeg]\n", dev->name,dev->empress_dev->minor & 0x1f); - videobuf_queue_init(&dev->empress_tsq, - &saa7134_ts_qops, dev->pci, &dev->slock, + videobuf_queue_init(&dev->empress_tsq, &saa7134_ts_qops, + dev->pci, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_ALTERNATE, - sizeof(struct saa7134_buf)); + sizeof(struct saa7134_buf), + dev); return 0; } diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c index bcba52ba0..cce9ddc3e 100644 --- a/linux/drivers/media/video/saa7134/saa7134-i2c.c +++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-i2c.c,v 1.6 2004/10/13 10:39:00 kraxel Exp $ + * $Id: saa7134-i2c.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * i2c interface support @@ -34,11 +34,11 @@ /* ----------------------------------------------------------- */ static unsigned int i2c_debug = 0; -MODULE_PARM(i2c_debug,"i"); +module_param(i2c_debug, int, 0644); MODULE_PARM_DESC(i2c_debug,"enable debug messages [i2c]"); static unsigned int i2c_scan = 0; -MODULE_PARM(i2c_scan,"i"); +module_param(i2c_scan, int, 0444); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); #define d1printk if (1 == i2c_debug) printk diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c index b59a63f1a..07431c822 100644 --- a/linux/drivers/media/video/saa7134/saa7134-input.c +++ b/linux/drivers/media/video/saa7134/saa7134-input.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-input.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $ + * $Id: saa7134-input.c,v 1.12 2004/11/07 13:17:15 kraxel Exp $ * * handle saa7134 IR remotes via linux kernel input layer. * @@ -30,11 +30,11 @@ #include "saa7134.h" static unsigned int disable_ir = 0; -MODULE_PARM(disable_ir,"i"); +module_param(disable_ir, int, 0444); MODULE_PARM_DESC(disable_ir,"disable infrared remote support"); static unsigned int ir_debug = 0; -MODULE_PARM(ir_debug,"i"); +module_param(ir_debug, int, 0644); MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]"); #define dprintk(fmt, arg...) if (ir_debug) \ diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c index 4612eb399..55a4548cf 100644 --- a/linux/drivers/media/video/saa7134/saa7134-oss.c +++ b/linux/drivers/media/video/saa7134/saa7134-oss.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-oss.c,v 1.10 2004/10/13 10:39:00 kraxel Exp $ + * $Id: saa7134-oss.c,v 1.11 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * oss dsp interface @@ -34,11 +34,11 @@ /* ------------------------------------------------------------------ */ static unsigned int oss_debug = 0; -MODULE_PARM(oss_debug,"i"); +module_param(oss_debug, int, 0644); MODULE_PARM_DESC(oss_debug,"enable debug messages [oss]"); static unsigned int oss_rate = 0; -MODULE_PARM(oss_rate,"i"); +module_param(oss_rate, int, 0444); MODULE_PARM_DESC(oss_rate,"sample rate (valid are: 32000,48000)"); #define dprintk(fmt, arg...) if (oss_debug) \ diff --git a/linux/drivers/media/video/saa7134/saa7134-ts.c b/linux/drivers/media/video/saa7134/saa7134-ts.c index 3bcb51bf3..ed73f71a4 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.11 2004/10/19 16:02:05 kraxel Exp $ + * $Id: saa7134-ts.c,v 1.12 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -34,7 +34,7 @@ /* ------------------------------------------------------------------ */ static unsigned int ts_debug = 0; -MODULE_PARM(ts_debug,"i"); +module_param(ts_debug, int, 0644); MODULE_PARM_DESC(ts_debug,"enable debug messages [ts]"); #define dprintk(fmt, arg...) if (ts_debug) \ @@ -78,11 +78,11 @@ static int buffer_activate(struct saa7134_dev *dev, return 0; } -static int buffer_prepare(void *priv, struct videobuf_buffer *vb, +static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, enum v4l2_field field) { - struct saa7134_dev *dev = priv; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_dev *dev = q->priv_data; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); unsigned int lines, llength, size; int err; @@ -126,9 +126,9 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, } 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 saa7134_dev *dev = priv; + struct saa7134_dev *dev = q->priv_data; *size = TS_PACKET_SIZE * dev->ts.nr_packets; if (0 == *count) @@ -137,18 +137,18 @@ buffer_setup(void *priv, unsigned int *count, unsigned int *size) return 0; } -static void buffer_queue(void *priv, struct videobuf_buffer *vb) +static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_dev *dev = priv; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_dev *dev = q->priv_data; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_buffer_queue(dev,&dev->ts_q,buf); } -static void buffer_release(void *priv, struct videobuf_buffer *vb) +static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_dev *dev = priv; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_dev *dev = q->priv_data; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_dma_free(dev,buf); } @@ -165,11 +165,11 @@ EXPORT_SYMBOL_GPL(saa7134_ts_qops); /* exported stuff */ static unsigned int tsbufs = 4; -MODULE_PARM(tsbufs,"i"); +module_param(tsbufs, int, 0444); MODULE_PARM_DESC(tsbufs,"number of ts buffers, range 2-32"); static unsigned int ts_nr_packets = 30; -MODULE_PARM(ts_nr_packets,"i"); +module_param(ts_nr_packets, int, 0444); MODULE_PARM_DESC(ts_nr_packets,"size of a ts buffers (in ts packets)"); int saa7134_ts_init1(struct saa7134_dev *dev) diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index 1e687a5b5..799e7bd90 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-tvaudio.c,v 1.16 2004/10/19 16:02:05 kraxel Exp $ + * $Id: saa7134-tvaudio.c,v 1.17 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * tv audio decoder (fm stereo, nicam, ...) @@ -36,18 +36,18 @@ /* ------------------------------------------------------------------ */ static unsigned int audio_debug = 0; -MODULE_PARM(audio_debug,"i"); +module_param(audio_debug, int, 0644); MODULE_PARM_DESC(audio_debug,"enable debug messages [tv audio]"); static unsigned int audio_ddep = 0; -MODULE_PARM(audio_ddep,"i"); +module_param(audio_ddep, int, 0644); MODULE_PARM_DESC(audio_ddep,"audio ddep overwrite"); static int audio_clock_override = UNSET; -MODULE_PARM(audio_clock_override, "i"); +module_param(audio_clock_override, int, 0644); static int audio_clock_tweak = 0; -MODULE_PARM(audio_clock_tweak, "i"); +module_param(audio_clock_tweak, int, 0644); MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with audio crystal that's slightly off (range [-1024 .. 1024])"); #define dprintk(fmt, arg...) if (audio_debug) \ diff --git a/linux/drivers/media/video/saa7134/saa7134-vbi.c b/linux/drivers/media/video/saa7134/saa7134-vbi.c index ee4806d54..5707e9021 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.4 2004/10/13 10:39:00 kraxel Exp $ + * $Id: saa7134-vbi.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -33,11 +33,11 @@ /* ------------------------------------------------------------------ */ static unsigned int vbi_debug = 0; -MODULE_PARM(vbi_debug,"i"); +module_param(vbi_debug, int, 0644); MODULE_PARM_DESC(vbi_debug,"enable debug messages [vbi]"); static unsigned int vbibufs = 4; -MODULE_PARM(vbibufs,"i"); +module_param(vbibufs, int, 0444); MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32"); #define dprintk(fmt, arg...) if (vbi_debug) \ @@ -115,12 +115,13 @@ static int buffer_activate(struct saa7134_dev *dev, return 0; } -static int buffer_prepare(void *priv, struct videobuf_buffer *vb, +static int buffer_prepare(struct videobuf_queue *q, + struct videobuf_buffer *vb, enum v4l2_field field) { - struct saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; struct saa7134_dev *dev = fh->dev; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); struct saa7134_tvnorm *norm = dev->tvnorm; unsigned int lines, llength, size; int err; @@ -169,9 +170,9 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, } 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 saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; struct saa7134_dev *dev = fh->dev; int llength,lines; @@ -190,20 +191,20 @@ buffer_setup(void *priv, unsigned int *count, unsigned int *size) return 0; } -static void buffer_queue(void *priv, struct videobuf_buffer *vb) +static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; struct saa7134_dev *dev = fh->dev; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_buffer_queue(dev,&dev->vbi_q,buf); } -static void buffer_release(void *priv, struct videobuf_buffer *vb) +static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; struct saa7134_dev *dev = fh->dev; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_dma_free(dev,buf); } diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index be0057df0..885b1ab31 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.17 2004/10/19 16:02:05 kraxel Exp $ + * $Id: saa7134-video.c,v 1.18 2004/11/07 13:17:15 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -39,11 +39,11 @@ static unsigned int gbuffers = 8; static unsigned int noninterlaced = 0; static unsigned int gbufsize = 720*576*4; static unsigned int gbufsize_max = 720*576*4; -MODULE_PARM(video_debug,"i"); +module_param(video_debug, int, 0644); MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); -MODULE_PARM(gbuffers,"i"); +module_param(gbuffers, int, 0444); MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); -MODULE_PARM(noninterlaced,"i"); +module_param(noninterlaced, int, 0644); MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced"); #define dprintk(fmt, arg...) if (video_debug) \ @@ -918,12 +918,13 @@ static int buffer_activate(struct saa7134_dev *dev, return 0; } -static int buffer_prepare(void *priv, struct videobuf_buffer *vb, +static int buffer_prepare(struct videobuf_queue *q, + struct videobuf_buffer *vb, enum v4l2_field field) { - struct saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; struct saa7134_dev *dev = fh->dev; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); unsigned int size; int err; @@ -980,9 +981,9 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, } 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 saa7134_fh *fh = priv; + struct saa7134_fh *fh = q->priv_data; *size = fh->fmt->depth * fh->width * fh->height >> 3; if (0 == *count) @@ -991,18 +992,18 @@ buffer_setup(void *priv, unsigned int *count, unsigned int *size) return 0; } -static void buffer_queue(void *priv, struct videobuf_buffer *vb) +static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_fh *fh = priv; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_fh *fh = q->priv_data; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_buffer_queue(fh->dev,&fh->dev->video_q,buf); } -static void buffer_release(void *priv, struct videobuf_buffer *vb) +static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct saa7134_fh *fh = priv; - struct saa7134_buf *buf = (struct saa7134_buf *)vb; + struct saa7134_fh *fh = q->priv_data; + struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); saa7134_dma_free(fh->dev,buf); } @@ -1239,16 +1240,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 saa7134_buf)); - init_MUTEX(&fh->cap.lock); - saa7134_pgtable_alloc(dev->pci,&fh->pt_cap); - + sizeof(struct saa7134_buf), + fh); videobuf_queue_init(&fh->vbi, &saa7134_vbi_qops, dev->pci, &dev->slock, V4L2_BUF_TYPE_VBI_CAPTURE, V4L2_FIELD_SEQ_TB, - sizeof(struct saa7134_buf)); - init_MUTEX(&fh->vbi.lock); + sizeof(struct saa7134_buf), + fh); + saa7134_pgtable_alloc(dev->pci,&fh->pt_cap); saa7134_pgtable_alloc(dev->pci,&fh->pt_vbi); if (fh->radio) { @@ -1271,13 +1271,13 @@ 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->private_data, saa7134_queue(fh), + return videobuf_read_one(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->private_data, saa7134_queue(fh), + return videobuf_read_stream(saa7134_queue(fh), data, count, ppos, 1, file->f_flags & O_NONBLOCK); break; @@ -1294,8 +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, file->private_data, - &fh->vbi, wait); + return videobuf_poll_stream(file, &fh->vbi, wait); if (res_check(fh,RESOURCE_VIDEO)) { if (!list_empty(&fh->cap.stream)) @@ -1345,7 +1344,7 @@ static int video_release(struct inode *inode, struct file *file) /* stop video capture */ if (res_check(fh, RESOURCE_VIDEO)) { - videobuf_streamoff(file->private_data,&fh->cap); + videobuf_streamoff(&fh->cap); res_free(dev,fh,RESOURCE_VIDEO); } if (fh->cap.read_buf) { @@ -1356,9 +1355,9 @@ static int video_release(struct inode *inode, struct file *file) /* stop vbi capture */ if (res_check(fh, RESOURCE_VBI)) { if (fh->vbi.streaming) - videobuf_streamoff(file->private_data,&fh->vbi); + videobuf_streamoff(&fh->vbi); if (fh->vbi.reading) - videobuf_read_stop(file->private_data,&fh->vbi); + videobuf_read_stop(&fh->vbi); res_free(dev,fh,RESOURCE_VBI); } @@ -1378,7 +1377,7 @@ video_mmap(struct file *file, struct vm_area_struct * vma) { struct saa7134_fh *fh = file->private_data; - return videobuf_mmap_mapper(vma,saa7134_queue(fh)); + return videobuf_mmap_mapper(saa7134_queue(fh), vma); } /* ------------------------------------------------------------------ */ @@ -2035,7 +2034,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->private_data,q,&req); + err = videobuf_reqbufs(q,&req); if (err < 0) return err; memset(mbuf,0,sizeof(*mbuf)); @@ -2048,16 +2047,16 @@ static int video_do_ioctl(struct inode *inode, struct file *file, return 0; } case VIDIOC_REQBUFS: - return videobuf_reqbufs(file->private_data,saa7134_queue(fh),arg); + return videobuf_reqbufs(saa7134_queue(fh),arg); case VIDIOC_QUERYBUF: return videobuf_querybuf(saa7134_queue(fh),arg); case VIDIOC_QBUF: - return videobuf_qbuf(file->private_data,saa7134_queue(fh),arg); + return videobuf_qbuf(saa7134_queue(fh),arg); case VIDIOC_DQBUF: - return videobuf_dqbuf(file->private_data,saa7134_queue(fh),arg, + return videobuf_dqbuf(saa7134_queue(fh),arg, file->f_flags & O_NONBLOCK); case VIDIOC_STREAMON: @@ -2066,13 +2065,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,saa7134_queue(fh)); + return videobuf_streamon(saa7134_queue(fh)); } case VIDIOC_STREAMOFF: { int res = saa7134_resource(fh); - err = videobuf_streamoff(file->private_data,saa7134_queue(fh)); + err = videobuf_streamoff(saa7134_queue(fh)); if (err < 0) return err; res_free(dev,fh,res); diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index 6c5d72b31..9c23709e8 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -43,7 +43,7 @@ I2C_CLIENT_INSMOD; /* insmod options */ static unsigned int debug = 0; -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); MODULE_LICENSE("GPL"); /* ---------------------------------------------------------------------- */ @@ -384,10 +384,10 @@ static unsigned int port1 = 1; static unsigned int port2 = 1; static unsigned int qss = UNSET; static unsigned int adjust = 0x10; -MODULE_PARM(port1,"i"); -MODULE_PARM(port2,"i"); -MODULE_PARM(qss,"i"); -MODULE_PARM(adjust,"i"); +module_param(port1, int, 0644); +module_param(port2, int, 0644); +module_param(qss, int, 0644); +module_param(adjust, int, 0644); static int tda9887_set_insmod(struct tda9887 *t, char *buf) { @@ -467,10 +467,10 @@ static int tda9887_set_pinnacle(struct tda9887 *t, char *buf) /* ---------------------------------------------------------------------- */ -static char *pal = "-"; -MODULE_PARM(pal,"s"); -static char *secam = "-"; -MODULE_PARM(secam,"s"); +static char pal[] = "-"; +module_param_string(pal, pal, 0644, sizeof(pal)); +static char secam[] = "-"; +module_param_string(secam, secam, 0644, sizeof(secam)); static int tda9887_fixup_std(struct tda9887 *t) { diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c index 71c8f9174..0c2f4db46 100644 --- a/linux/drivers/media/video/v4l1-compat.c +++ b/linux/drivers/media/video/v4l1-compat.c @@ -45,7 +45,7 @@ #endif static unsigned int debug = 0; -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"enable debug messages"); MODULE_AUTHOR("Bill Dirks"); MODULE_DESCRIPTION("v4l(1) compatibility layer for v4l2 drivers."); diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c index 946bbf6ac..6f3d6ace5 100644 --- a/linux/drivers/media/video/video-buf-dvb.c +++ b/linux/drivers/media/video/video-buf-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: video-buf-dvb.c,v 1.4 2004/10/21 12:51:54 kraxel Exp $ + * $Id: video-buf-dvb.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ * * some helper function for simple DVB cards which simply DMA the * complete transport stream and let the computer sort everything else @@ -31,7 +31,7 @@ MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); static unsigned int debug = 0; -MODULE_PARM(debug,"i"); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"enable debug messages"); #define dprintk(fmt, arg...) if (debug) \ @@ -47,7 +47,7 @@ static int videobuf_dvb_thread(void *data) int err; dprintk("dvb thread started\n"); - videobuf_read_start(dvb->priv, &dvb->dvbq); + videobuf_read_start(&dvb->dvbq); for (;;) { /* fetch next buffer */ @@ -73,11 +73,11 @@ static int videobuf_dvb_thread(void *data) /* requeue buffer */ list_add_tail(&buf->stream,&dvb->dvbq.stream); spin_lock_irqsave(dvb->dvbq.irqlock,flags); - dvb->dvbq.ops->buf_queue(dvb->priv,buf); + dvb->dvbq.ops->buf_queue(&dvb->dvbq,buf); spin_unlock_irqrestore(dvb->dvbq.irqlock,flags); } - videobuf_read_stop(dvb, &dvb->dvbq); + videobuf_read_stop(&dvb->dvbq); dprintk("dvb thread stopped\n"); /* Hmm, linux becomes *very* unhappy without this ... */ diff --git a/linux/drivers/media/video/video-buf.c b/linux/drivers/media/video/video-buf.c index 96964242a..a4f847ff7 100644 --- a/linux/drivers/media/video/video-buf.c +++ b/linux/drivers/media/video/video-buf.c @@ -1,5 +1,5 @@ /* - * $Id: video-buf.c,v 1.13 2004/10/13 10:39:00 kraxel Exp $ + * $Id: video-buf.c,v 1.14 2004/11/07 13:17:15 kraxel Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -41,11 +41,11 @@ { printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); } static int debug = 0; +module_param(debug, int, 0644); MODULE_DESCRIPTION("helper module to manage video4linux pci dma buffers"); MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); -MODULE_PARM(debug,"i"); #define dprintk(level, fmt, arg...) if (debug >= level) \ printk(KERN_DEBUG "vbuf: " fmt , ## arg) @@ -371,28 +371,35 @@ videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb, /* --------------------------------------------------------------------- */ -void -videobuf_queue_init(struct videobuf_queue *q, - struct videobuf_queue_ops *ops, - struct pci_dev *pci, - spinlock_t *irqlock, - enum v4l2_buf_type type, - enum v4l2_field field, - unsigned int msize) +void videobuf_queue_init(struct videobuf_queue* q, + struct videobuf_queue_ops *ops, + struct pci_dev *pci, + spinlock_t *irqlock, + enum v4l2_buf_type type, + enum v4l2_field field, + unsigned int msize, + void *priv) { memset(q,0,sizeof(*q)); - q->irqlock = irqlock; q->pci = pci; q->type = type; q->field = field; q->msize = msize; q->ops = ops; + q->priv_data = priv; init_MUTEX(&q->lock); INIT_LIST_HEAD(&q->stream); } +void videobuf_queue_free(struct videobuf_queue *q) +{ + BUG_ON(q->streaming); + BUG_ON(q->reading); + kfree(q); +} + int videobuf_queue_is_busy(struct videobuf_queue *q) { @@ -430,7 +437,7 @@ videobuf_queue_is_busy(struct videobuf_queue *q) } void -videobuf_queue_cancel(void *priv, struct videobuf_queue *q) +videobuf_queue_cancel(struct videobuf_queue *q) { unsigned long flags; int i; @@ -451,7 +458,7 @@ videobuf_queue_cancel(void *priv, struct videobuf_queue *q) for (i = 0; i < VIDEO_MAX_FRAME; i++) { if (NULL == q->bufs[i]) continue; - q->ops->buf_release(priv,q->bufs[i]); + q->ops->buf_release(q,q->bufs[i]); } INIT_LIST_HEAD(&q->stream); } @@ -533,7 +540,7 @@ videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb, } int -videobuf_reqbufs(void *priv, struct videobuf_queue *q, +videobuf_reqbufs(struct videobuf_queue *q, struct v4l2_requestbuffers *req) { unsigned int size,count; @@ -558,12 +565,12 @@ videobuf_reqbufs(void *priv, struct videobuf_queue *q, if (count > VIDEO_MAX_FRAME) count = VIDEO_MAX_FRAME; size = 0; - q->ops->buf_setup(priv,&count,&size); + q->ops->buf_setup(q,&count,&size); size = PAGE_ALIGN(size); dprintk(1,"reqbufs: bufs=%d, size=0x%x [%d pages total]\n", count, size, (count*size)>>PAGE_SHIFT); - retval = videobuf_mmap_setup(priv,q,count,size,req->memory); + retval = videobuf_mmap_setup(q,count,size,req->memory); if (retval < 0) goto done; @@ -588,7 +595,7 @@ videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b) } int -videobuf_qbuf(void *priv, struct videobuf_queue *q, +videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) { struct videobuf_buffer *buf; @@ -632,7 +639,7 @@ videobuf_qbuf(void *priv, struct videobuf_queue *q, if (b->length < buf->bsize) goto done; if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) - q->ops->buf_release(priv,buf); + q->ops->buf_release(q,buf); buf->baddr = b->m.userptr; break; case V4L2_MEMORY_OVERLAY: @@ -643,14 +650,14 @@ videobuf_qbuf(void *priv, struct videobuf_queue *q, } field = videobuf_next_field(q); - retval = q->ops->buf_prepare(priv,buf,field); + retval = q->ops->buf_prepare(q,buf,field); if (0 != retval) goto done; list_add_tail(&buf->stream,&q->stream); if (q->streaming) { spin_lock_irqsave(q->irqlock,flags); - q->ops->buf_queue(priv,buf); + q->ops->buf_queue(q,buf); spin_unlock_irqrestore(q->irqlock,flags); } retval = 0; @@ -661,7 +668,7 @@ videobuf_qbuf(void *priv, struct videobuf_queue *q, } int -videobuf_dqbuf(void *priv, struct videobuf_queue *q, +videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b, int nonblocking) { struct videobuf_buffer *buf; @@ -701,7 +708,7 @@ videobuf_dqbuf(void *priv, struct videobuf_queue *q, return retval; } -int videobuf_streamon(void *priv, struct videobuf_queue *q) +int videobuf_streamon(struct videobuf_queue *q) { struct videobuf_buffer *buf; struct list_head *list; @@ -720,7 +727,7 @@ int videobuf_streamon(void *priv, struct videobuf_queue *q) list_for_each(list,&q->stream) { buf = list_entry(list, struct videobuf_buffer, stream); if (buf->state == STATE_PREPARED) - q->ops->buf_queue(priv,buf); + q->ops->buf_queue(q,buf); } spin_unlock_irqrestore(q->irqlock,flags); @@ -729,14 +736,14 @@ int videobuf_streamon(void *priv, struct videobuf_queue *q) return retval; } -int videobuf_streamoff(void *priv, struct videobuf_queue *q) +int videobuf_streamoff(struct videobuf_queue *q) { int retval = -EINVAL; down(&q->lock); if (!q->streaming) goto done; - videobuf_queue_cancel(priv,q); + videobuf_queue_cancel(q); q->streaming = 0; retval = 0; @@ -746,8 +753,8 @@ int videobuf_streamoff(void *priv, struct videobuf_queue *q) } static ssize_t -videobuf_read_zerocopy(void *priv, struct videobuf_queue *q, - char __user *data, size_t count, loff_t *ppos) +videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data, + size_t count, loff_t *ppos) { enum v4l2_field field; unsigned long flags; @@ -763,13 +770,13 @@ videobuf_read_zerocopy(void *priv, struct videobuf_queue *q, q->read_buf->baddr = (unsigned long)data; q->read_buf->bsize = count; field = videobuf_next_field(q); - retval = q->ops->buf_prepare(priv,q->read_buf,field); + retval = q->ops->buf_prepare(q,q->read_buf,field); if (0 != retval) goto done; /* start capture & wait */ spin_lock_irqsave(q->irqlock,flags); - q->ops->buf_queue(priv,q->read_buf); + q->ops->buf_queue(q,q->read_buf); spin_unlock_irqrestore(q->irqlock,flags); retval = videobuf_waiton(q->read_buf,0,0); if (0 == retval) { @@ -782,13 +789,13 @@ videobuf_read_zerocopy(void *priv, struct videobuf_queue *q, done: /* cleanup */ - q->ops->buf_release(priv,q->read_buf); + q->ops->buf_release(q,q->read_buf); kfree(q->read_buf); q->read_buf = NULL; return retval; } -ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, +ssize_t videobuf_read_one(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int nonblocking) { @@ -800,11 +807,11 @@ ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, down(&q->lock); nbufs = 1; size = 0; - q->ops->buf_setup(priv,&nbufs,&size); + q->ops->buf_setup(q,&nbufs,&size); if (NULL == q->read_buf && count >= size && !nonblocking) { - retval = videobuf_read_zerocopy(priv,q,data,count,ppos); + retval = videobuf_read_zerocopy(q,data,count,ppos); if (retval >= 0 || retval == -EIO) /* ok, all done */ goto done; @@ -819,11 +826,11 @@ ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, goto done; q->read_buf->memory = V4L2_MEMORY_USERPTR; field = videobuf_next_field(q); - retval = q->ops->buf_prepare(priv,q->read_buf,field); + retval = q->ops->buf_prepare(q,q->read_buf,field); if (0 != retval) goto done; spin_lock_irqsave(q->irqlock,flags); - q->ops->buf_queue(priv,q->read_buf); + q->ops->buf_queue(q,q->read_buf); spin_unlock_irqrestore(q->irqlock,flags); q->read_off = 0; } @@ -836,7 +843,7 @@ ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, if (STATE_ERROR == q->read_buf->state) { /* catch I/O errors */ - q->ops->buf_release(priv,q->read_buf); + q->ops->buf_release(q,q->read_buf); kfree(q->read_buf); q->read_buf = NULL; retval = -EIO; @@ -855,7 +862,7 @@ ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, q->read_off += bytes; if (q->read_off == q->read_buf->size) { /* all data copied, cleanup */ - q->ops->buf_release(priv,q->read_buf); + q->ops->buf_release(q,q->read_buf); kfree(q->read_buf); q->read_buf = NULL; } @@ -865,43 +872,43 @@ ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, return retval; } -int videobuf_read_start(void *priv, struct videobuf_queue *q) +int videobuf_read_start(struct videobuf_queue *q) { enum v4l2_field field; unsigned long flags; int count = 0, size = 0; int err, i; - q->ops->buf_setup(priv,&count,&size); + q->ops->buf_setup(q,&count,&size); if (count < 2) count = 2; if (count > VIDEO_MAX_FRAME) count = VIDEO_MAX_FRAME; size = PAGE_ALIGN(size); - err = videobuf_mmap_setup(priv, q, count, size, V4L2_MEMORY_USERPTR); + err = videobuf_mmap_setup(q, count, size, V4L2_MEMORY_USERPTR); if (err) return err; for (i = 0; i < count; i++) { field = videobuf_next_field(q); - err = q->ops->buf_prepare(priv,q->bufs[i],field); + err = q->ops->buf_prepare(q,q->bufs[i],field); if (err) return err; list_add_tail(&q->bufs[i]->stream, &q->stream); } spin_lock_irqsave(q->irqlock,flags); for (i = 0; i < count; i++) - q->ops->buf_queue(priv,q->bufs[i]); + q->ops->buf_queue(q,q->bufs[i]); spin_unlock_irqrestore(q->irqlock,flags); q->reading = 1; return 0; } -void videobuf_read_stop(void *priv, struct videobuf_queue *q) +void videobuf_read_stop(struct videobuf_queue *q) { int i; - videobuf_queue_cancel(priv,q); + videobuf_queue_cancel(q); INIT_LIST_HEAD(&q->stream); for (i = 0; i < VIDEO_MAX_FRAME; i++) { if (NULL == q->bufs[i]) @@ -913,7 +920,7 @@ void videobuf_read_stop(void *priv, struct videobuf_queue *q) q->reading = 0; } -ssize_t videobuf_read_stream(void *priv, struct videobuf_queue *q, +ssize_t videobuf_read_stream(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int vbihack, int nonblocking) { @@ -927,7 +934,7 @@ ssize_t videobuf_read_stream(void *priv, struct videobuf_queue *q, if (q->streaming) goto done; if (!q->reading) { - retval = videobuf_read_start(priv,q); + retval = videobuf_read_start(q); if (retval < 0) goto done; } @@ -987,7 +994,7 @@ ssize_t videobuf_read_stream(void *priv, struct videobuf_queue *q, list_add_tail(&q->read_buf->stream, &q->stream); spin_lock_irqsave(q->irqlock,flags); - q->ops->buf_queue(priv,q->read_buf); + q->ops->buf_queue(q,q->read_buf); spin_unlock_irqrestore(q->irqlock,flags); q->read_buf = NULL; } @@ -1000,7 +1007,7 @@ ssize_t videobuf_read_stream(void *priv, struct videobuf_queue *q, return retval; } -unsigned int videobuf_poll_stream(struct file *file, void *priv, +unsigned int videobuf_poll_stream(struct file *file, struct videobuf_queue *q, poll_table *wait) { @@ -1014,7 +1021,7 @@ unsigned int videobuf_poll_stream(struct file *file, void *priv, struct videobuf_buffer, stream); } else { if (!q->reading) - videobuf_read_start(priv,q); + videobuf_read_start(q); if (!q->reading) { rc = POLLERR; } else if (NULL == q->read_buf) { @@ -1055,29 +1062,30 @@ static void videobuf_vm_close(struct vm_area_struct *vma) { struct videobuf_mapping *map = vma->vm_private_data; + struct videobuf_queue *q = map->q; int i; dprintk(2,"vm_close %p [count=%d,vma=%08lx-%08lx]\n",map, map->count,vma->vm_start,vma->vm_end); - /* down(&fh->lock); FIXME */ map->count--; if (0 == map->count) { - dprintk(1,"munmap %p\n",map); + dprintk(1,"munmap %p q=%p\n",map,q); + down(&q->lock); for (i = 0; i < VIDEO_MAX_FRAME; i++) { - if (NULL == map->q->bufs[i]) + if (NULL == q->bufs[i]) continue; - if (map->q->bufs[i]) + if (q->bufs[i]) ; - if (map->q->bufs[i]->map != map) + if (q->bufs[i]->map != map) continue; - map->q->bufs[i]->map = NULL; - map->q->bufs[i]->baddr = 0; - map->q->ops->buf_release(vma->vm_file,map->q->bufs[i]); + q->bufs[i]->map = NULL; + q->bufs[i]->baddr = 0; + q->ops->buf_release(q,q->bufs[i]); } + up(&q->lock); kfree(map); } - /* up(&fh->lock); FIXME */ return; } @@ -1124,14 +1132,14 @@ static struct vm_operations_struct videobuf_vm_ops = .nopage = videobuf_vm_nopage, }; -int videobuf_mmap_setup(void *priv, struct videobuf_queue *q, +int videobuf_mmap_setup(struct videobuf_queue *q, unsigned int bcount, unsigned int bsize, enum v4l2_memory memory) { unsigned int i; int err; - err = videobuf_mmap_free(priv,q); + err = videobuf_mmap_free(q); if (0 != err) return err; @@ -1156,7 +1164,7 @@ int videobuf_mmap_setup(void *priv, struct videobuf_queue *q, return 0; } -int videobuf_mmap_free(void *priv, struct videobuf_queue *q) +int videobuf_mmap_free(struct videobuf_queue *q) { int i; @@ -1166,15 +1174,15 @@ int videobuf_mmap_free(void *priv, struct videobuf_queue *q) for (i = 0; i < VIDEO_MAX_FRAME; i++) { if (NULL == q->bufs[i]) continue; - q->ops->buf_release(priv,q->bufs[i]); + q->ops->buf_release(q,q->bufs[i]); kfree(q->bufs[i]); q->bufs[i] = NULL; } return 0; } -int videobuf_mmap_mapper(struct vm_area_struct *vma, - struct videobuf_queue *q) +int videobuf_mmap_mapper(struct videobuf_queue *q, + struct vm_area_struct *vma) { struct videobuf_mapping *map; unsigned int first,last,size,i; @@ -1243,8 +1251,8 @@ int videobuf_mmap_mapper(struct vm_area_struct *vma, vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */ vma->vm_private_data = map; - dprintk(1,"mmap %p: %08lx-%08lx pgoff %08lx bufs %d-%d\n", - map,vma->vm_start,vma->vm_end,vma->vm_pgoff,first,last); + dprintk(1,"mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n", + map,q,vma->vm_start,vma->vm_end,vma->vm_pgoff,first,last); retval = 0; done: diff --git a/linux/include/media/video-buf-dvb.h b/linux/include/media/video-buf-dvb.h index 40383d2e0..53eac765a 100644 --- a/linux/include/media/video-buf-dvb.h +++ b/linux/include/media/video-buf-dvb.h @@ -9,7 +9,6 @@ struct videobuf_dvb { char *name; struct dvb_frontend *frontend; struct videobuf_queue dvbq; - void *priv; /* video-buf-dvb state info */ struct semaphore lock; diff --git a/linux/include/media/video-buf.h b/linux/include/media/video-buf.h index fdf5c71e2..ae6da6de9 100644 --- a/linux/include/media/video-buf.h +++ b/linux/include/media/video-buf.h @@ -1,5 +1,5 @@ /* - * $Id: video-buf.h,v 1.8 2004/10/13 10:39:00 kraxel Exp $ + * $Id: video-buf.h,v 1.9 2004/11/07 13:17:15 kraxel Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -121,7 +121,6 @@ struct videobuf_queue; struct videobuf_mapping { unsigned int count; - int highmem_ok; unsigned long start; unsigned long end; struct videobuf_queue *q; @@ -167,12 +166,15 @@ struct videobuf_buffer { }; struct videobuf_queue_ops { - int (*buf_setup)(void *priv, + int (*buf_setup)(struct videobuf_queue *q, unsigned int *count, unsigned int *size); - int (*buf_prepare)(void *priv,struct videobuf_buffer *vb, + int (*buf_prepare)(struct videobuf_queue *q, + struct videobuf_buffer *vb, enum v4l2_field field); - void (*buf_queue)(void *priv,struct videobuf_buffer *vb); - void (*buf_release)(void *priv,struct videobuf_buffer *vb); + void (*buf_queue)(struct videobuf_queue *q, + struct videobuf_buffer *vb); + void (*buf_release)(struct videobuf_queue *q, + struct videobuf_buffer *vb); }; struct videobuf_queue { @@ -196,6 +198,9 @@ struct videobuf_queue { unsigned int reading; unsigned int read_off; struct videobuf_buffer *read_buf; + + /* driver private data */ + void *priv_data; }; void* videobuf_alloc(unsigned int size); @@ -205,44 +210,46 @@ int videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb, void videobuf_queue_init(struct videobuf_queue *q, struct videobuf_queue_ops *ops, - struct pci_dev *pci, spinlock_t *irqlock, + struct pci_dev *pci, + spinlock_t *irqlock, enum v4l2_buf_type type, enum v4l2_field field, - unsigned int msize); + unsigned int msize, + void *priv); int videobuf_queue_is_busy(struct videobuf_queue *q); -void videobuf_queue_cancel(void *priv, struct videobuf_queue *q); +void videobuf_queue_cancel(struct videobuf_queue *q); enum v4l2_field videobuf_next_field(struct videobuf_queue *q); void videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb, enum v4l2_buf_type type); -int videobuf_reqbufs(void *priv, struct videobuf_queue *q, +int videobuf_reqbufs(struct videobuf_queue *q, struct v4l2_requestbuffers *req); int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b); -int videobuf_qbuf(void *priv, struct videobuf_queue *q, +int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b); -int videobuf_dqbuf(void *priv, struct videobuf_queue *q, +int videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b, int nonblocking); -int videobuf_streamon(void *priv, struct videobuf_queue *q); -int videobuf_streamoff(void *priv, struct videobuf_queue *q); +int videobuf_streamon(struct videobuf_queue *q); +int videobuf_streamoff(struct videobuf_queue *q); -int videobuf_read_start(void *priv, struct videobuf_queue *q); -void videobuf_read_stop(void *priv, struct videobuf_queue *q); -ssize_t videobuf_read_stream(void *priv, struct videobuf_queue *q, +int videobuf_read_start(struct videobuf_queue *q); +void videobuf_read_stop(struct videobuf_queue *q); +ssize_t videobuf_read_stream(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int vbihack, int nonblocking); -ssize_t videobuf_read_one(void *priv, struct videobuf_queue *q, +ssize_t videobuf_read_one(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int nonblocking); -unsigned int videobuf_poll_stream(struct file *file, void *priv, +unsigned int videobuf_poll_stream(struct file *file, struct videobuf_queue *q, poll_table *wait); -int videobuf_mmap_setup(void *priv, struct videobuf_queue *q, +int videobuf_mmap_setup(struct videobuf_queue *q, unsigned int bcount, unsigned int bsize, enum v4l2_memory memory); -int videobuf_mmap_free(void *priv, struct videobuf_queue *q); -int videobuf_mmap_mapper(struct vm_area_struct *vma, - struct videobuf_queue *q); +int videobuf_mmap_free(struct videobuf_queue *q); +int videobuf_mmap_mapper(struct videobuf_queue *q, + struct vm_area_struct *vma); /* --------------------------------------------------------------------- */ diff --git a/v4l/scripts/update b/v4l/scripts/update index b5ad0b75b..173dfe1ee 100644 --- a/v4l/scripts/update +++ b/v4l/scripts/update @@ -59,12 +59,11 @@ sync; sleep 1; # common v4l2basic -#xrmmod video-buf +xrmmod video-buf xinsmod video-buf debug=0 #xrmmod v4l1-compat #xinsmod v4l1-compat debug=1 -xinsmod video-buf-dvb xinsmod btcx-risc debug=0 xinsmod ir-common debug=0 repeat=0 xinsmod tuner debug=0 @@ -72,10 +71,10 @@ xinsmod tda9887 debug=0 xinsmod msp3400 debug=0 # bttv +xinsmod ir-kbd-i2c debug=0 xinsmod bttv bttv_debug=0 vbi_debug=0 irq_debug=0 \ fdsr=0 chroma_agc=1 vbibufs=4 irq_iswitch=0 i2c_scan=1 $btopt -test -f ir-kbd-i2c.ko && xinsmod ir-kbd-i2c debug=0 -test -f ir-kbd-gpio.ko && xinsmod ir-kbd-gpio debug=0 +xinsmod ir-kbd-gpio debug=0 # cx88 xinsmod cx22702 debug=0 @@ -84,9 +83,12 @@ xinsmod cx8800 video_debug=0 vbi_debug=0 xinsmod cx8801 xinsmod cx8802 xinsmod cx88-blackbird -xinsmod cx88-dvb # saa7134 xinsmod saa7134 audio_debug=0 i2c_scan=1 $saopt xinsmod saa7134-empress + +# dvb stuff +xinsmod video-buf-dvb +xinsmod cx88-dvb xinsmod saa7134-dvb |