diff options
Diffstat (limited to 'linux/drivers/media/video/saa7134')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-core.c | 64 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-dvb.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-empress.c | 34 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-i2c.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-input.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-oss.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-ts.c | 30 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-vbi.c | 29 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 69 |
10 files changed, 132 insertions, 138 deletions
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); |