aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-08-23 15:37:49 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:14:55 -0400
commitc1accaa21bdef38ec0f36eaaf7ce3384fff9d0c5 (patch)
tree3a2c8206555af6c9e2eecdb20b052be70e6b93dd /drivers/media/video/saa7134
parent7a7d9a89d0307b1743d782197e2c5fc5ddf183f3 (diff)
V4L/DVB (6252): Adapt drivers to use the newer videobuf modules
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo. Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct. So, to access it, a subroutine call is needed. This patch renames all occurences of those function calls to be consistent with the video-buf split. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981 Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r--drivers/media/video/saa7134/Kconfig2
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-ts.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-vbi.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c34
-rw-r--r--drivers/media/video/saa7134/saa7134.h2
8 files changed, 24 insertions, 38 deletions
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig
index 9f1417a4f7d2..82bc4ef414ac 100644
--- a/drivers/media/video/saa7134/Kconfig
+++ b/drivers/media/video/saa7134/Kconfig
@@ -1,7 +1,7 @@
1config VIDEO_SAA7134 1config VIDEO_SAA7134
2 tristate "Philips SAA7134 support" 2 tristate "Philips SAA7134 support"
3 depends on VIDEO_DEV && PCI && I2C 3 depends on VIDEO_DEV && PCI && I2C
4 select VIDEO_BUF 4 select VIDEOBUF_DMA_SG
5 select VIDEO_IR 5 select VIDEO_IR
6 select VIDEO_TUNER 6 select VIDEO_TUNER
7 select CRC32 7 select CRC32
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 80108ddf4834..a1d986e01a30 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -236,9 +236,10 @@ int saa7134_buffer_startpage(struct saa7134_buf *buf)
236unsigned long saa7134_buffer_base(struct saa7134_buf *buf) 236unsigned long saa7134_buffer_base(struct saa7134_buf *buf)
237{ 237{
238 unsigned long base; 238 unsigned long base;
239 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
239 240
240 base = saa7134_buffer_startpage(buf) * 4096; 241 base = saa7134_buffer_startpage(buf) * 4096;
241 base += buf->vb.dma.sglist[0].offset; 242 base += dma->sglist[0].offset;
242 return base; 243 return base;
243} 244}
244 245
@@ -286,11 +287,12 @@ void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt)
286 287
287void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf) 288void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf)
288{ 289{
290 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
289 BUG_ON(in_interrupt()); 291 BUG_ON(in_interrupt());
290 292
291 videobuf_waiton(&buf->vb,0,0); 293 videobuf_waiton(&buf->vb,0,0);
292 videobuf_dma_unmap(q, &buf->vb.dma); 294 videobuf_dma_unmap(q, dma);
293 videobuf_dma_free(&buf->vb.dma); 295 videobuf_dma_free(dma);
294 buf->vb.state = STATE_NEEDS_INIT; 296 buf->vb.state = STATE_NEEDS_INIT;
295} 297}
296 298
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index bbab252cbeee..38d87332cc5d 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -850,7 +850,7 @@ static int dvb_init(struct saa7134_dev *dev)
850 dev->ts.nr_bufs = 32; 850 dev->ts.nr_bufs = 32;
851 dev->ts.nr_packets = 32*4; 851 dev->ts.nr_packets = 32*4;
852 dev->dvb.name = dev->name; 852 dev->dvb.name = dev->name;
853 videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops, 853 videobuf_queue_pci_init(&dev->dvb.dvbq, &saa7134_ts_qops,
854 dev->pci, &dev->slock, 854 dev->pci, &dev->slock,
855 V4L2_BUF_TYPE_VIDEO_CAPTURE, 855 V4L2_BUF_TYPE_VIDEO_CAPTURE,
856 V4L2_FIELD_ALTERNATE, 856 V4L2_FIELD_ALTERNATE,
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 7ed4eaf05e13..a16df57af63a 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -400,7 +400,7 @@ static int empress_init(struct saa7134_dev *dev)
400 printk(KERN_INFO "%s: registered device video%d [mpeg]\n", 400 printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
401 dev->name,dev->empress_dev->minor & 0x1f); 401 dev->name,dev->empress_dev->minor & 0x1f);
402 402
403 videobuf_queue_init(&dev->empress_tsq, &saa7134_ts_qops, 403 videobuf_queue_pci_init(&dev->empress_tsq, &saa7134_ts_qops,
404 dev->pci, &dev->slock, 404 dev->pci, &dev->slock,
405 V4L2_BUF_TYPE_VIDEO_CAPTURE, 405 V4L2_BUF_TYPE_VIDEO_CAPTURE,
406 V4L2_FIELD_ALTERNATE, 406 V4L2_FIELD_ALTERNATE,
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
index 7780b2cce80d..5b1d1dafb5a5 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -92,6 +92,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
92 } 92 }
93 93
94 if (STATE_NEEDS_INIT == buf->vb.state) { 94 if (STATE_NEEDS_INIT == buf->vb.state) {
95 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
96
95 buf->vb.width = llength; 97 buf->vb.width = llength;
96 buf->vb.height = lines; 98 buf->vb.height = lines;
97 buf->vb.size = size; 99 buf->vb.size = size;
@@ -101,8 +103,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
101 if (err) 103 if (err)
102 goto oops; 104 goto oops;
103 err = saa7134_pgtable_build(dev->pci,buf->pt, 105 err = saa7134_pgtable_build(dev->pci,buf->pt,
104 buf->vb.dma.sglist, 106 dma->sglist,
105 buf->vb.dma.sglen, 107 dma->sglen,
106 saa7134_buffer_startpage(buf)); 108 saa7134_buffer_startpage(buf));
107 if (err) 109 if (err)
108 goto oops; 110 goto oops;
diff --git a/drivers/media/video/saa7134/saa7134-vbi.c b/drivers/media/video/saa7134/saa7134-vbi.c
index 0044079f5da2..81a2aedeff5c 100644
--- a/drivers/media/video/saa7134/saa7134-vbi.c
+++ b/drivers/media/video/saa7134/saa7134-vbi.c
@@ -137,6 +137,8 @@ static int buffer_prepare(struct videobuf_queue *q,
137 saa7134_dma_free(q,buf); 137 saa7134_dma_free(q,buf);
138 138
139 if (STATE_NEEDS_INIT == buf->vb.state) { 139 if (STATE_NEEDS_INIT == buf->vb.state) {
140 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
141
140 buf->vb.width = llength; 142 buf->vb.width = llength;
141 buf->vb.height = lines; 143 buf->vb.height = lines;
142 buf->vb.size = size; 144 buf->vb.size = size;
@@ -146,8 +148,8 @@ static int buffer_prepare(struct videobuf_queue *q,
146 if (err) 148 if (err)
147 goto oops; 149 goto oops;
148 err = saa7134_pgtable_build(dev->pci,buf->pt, 150 err = saa7134_pgtable_build(dev->pci,buf->pt,
149 buf->vb.dma.sglist, 151 dma->sglist,
150 buf->vb.dma.sglen, 152 dma->sglen,
151 saa7134_buffer_startpage(buf)); 153 saa7134_buffer_startpage(buf));
152 if (err) 154 if (err)
153 goto oops; 155 goto oops;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 9c317ed6b210..cf40a9690a50 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1037,6 +1037,8 @@ static int buffer_prepare(struct videobuf_queue *q,
1037 } 1037 }
1038 1038
1039 if (STATE_NEEDS_INIT == buf->vb.state) { 1039 if (STATE_NEEDS_INIT == buf->vb.state) {
1040 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
1041
1040 buf->vb.width = fh->width; 1042 buf->vb.width = fh->width;
1041 buf->vb.height = fh->height; 1043 buf->vb.height = fh->height;
1042 buf->vb.size = size; 1044 buf->vb.size = size;
@@ -1048,8 +1050,8 @@ static int buffer_prepare(struct videobuf_queue *q,
1048 if (err) 1050 if (err)
1049 goto oops; 1051 goto oops;
1050 err = saa7134_pgtable_build(dev->pci,buf->pt, 1052 err = saa7134_pgtable_build(dev->pci,buf->pt,
1051 buf->vb.dma.sglist, 1053 dma->sglist,
1052 buf->vb.dma.sglen, 1054 dma->sglen,
1053 saa7134_buffer_startpage(buf)); 1055 saa7134_buffer_startpage(buf));
1054 if (err) 1056 if (err)
1055 goto oops; 1057 goto oops;
@@ -1309,13 +1311,13 @@ static int video_open(struct inode *inode, struct file *file)
1309 fh->height = 576; 1311 fh->height = 576;
1310 v4l2_prio_open(&dev->prio,&fh->prio); 1312 v4l2_prio_open(&dev->prio,&fh->prio);
1311 1313
1312 videobuf_queue_init(&fh->cap, &video_qops, 1314 videobuf_queue_pci_init(&fh->cap, &video_qops,
1313 dev->pci, &dev->slock, 1315 dev->pci, &dev->slock,
1314 V4L2_BUF_TYPE_VIDEO_CAPTURE, 1316 V4L2_BUF_TYPE_VIDEO_CAPTURE,
1315 V4L2_FIELD_INTERLACED, 1317 V4L2_FIELD_INTERLACED,
1316 sizeof(struct saa7134_buf), 1318 sizeof(struct saa7134_buf),
1317 fh); 1319 fh);
1318 videobuf_queue_init(&fh->vbi, &saa7134_vbi_qops, 1320 videobuf_queue_pci_init(&fh->vbi, &saa7134_vbi_qops,
1319 dev->pci, &dev->slock, 1321 dev->pci, &dev->slock,
1320 V4L2_BUF_TYPE_VBI_CAPTURE, 1322 V4L2_BUF_TYPE_VBI_CAPTURE,
1321 V4L2_FIELD_SEQ_TB, 1323 V4L2_FIELD_SEQ_TB,
@@ -2137,29 +2139,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
2137 } 2139 }
2138#ifdef CONFIG_VIDEO_V4L1_COMPAT 2140#ifdef CONFIG_VIDEO_V4L1_COMPAT
2139 case VIDIOCGMBUF: 2141 case VIDIOCGMBUF:
2140 { 2142 return videobuf_cgmbuf(saa7134_queue(fh), arg, gbuffers);
2141 struct video_mbuf *mbuf = arg;
2142 struct videobuf_queue *q;
2143 struct v4l2_requestbuffers req;
2144 unsigned int i;
2145
2146 q = saa7134_queue(fh);
2147 memset(&req,0,sizeof(req));
2148 req.type = q->type;
2149 req.count = gbuffers;
2150 req.memory = V4L2_MEMORY_MMAP;
2151 err = videobuf_reqbufs(q,&req);
2152 if (err < 0)
2153 return err;
2154 memset(mbuf,0,sizeof(*mbuf));
2155 mbuf->frames = req.count;
2156 mbuf->size = 0;
2157 for (i = 0; i < mbuf->frames; i++) {
2158 mbuf->offsets[i] = q->bufs[i]->boff;
2159 mbuf->size += q->bufs[i]->bsize;
2160 }
2161 return 0;
2162 }
2163#endif 2143#endif
2164 case VIDIOC_REQBUFS: 2144 case VIDIOC_REQBUFS:
2165 return videobuf_reqbufs(saa7134_queue(fh),arg); 2145 return videobuf_reqbufs(saa7134_queue(fh),arg);
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index fd12942b3a10..dae608f9bf3b 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -37,7 +37,7 @@
37#include <media/tuner.h> 37#include <media/tuner.h>
38#include <media/ir-common.h> 38#include <media/ir-common.h>
39#include <media/ir-kbd-i2c.h> 39#include <media/ir-kbd-i2c.h>
40#include <media/video-buf.h> 40#include <media/videobuf-dma-sg.h>
41#include <sound/driver.h> 41#include <sound/driver.h>
42#include <sound/core.h> 42#include <sound/core.h>
43#include <sound/pcm.h> 43#include <sound/pcm.h>