diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-22 13:42:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:44 -0400 |
commit | 0705135e59f8503e4dade4b3580fed77b1743b7c (patch) | |
tree | 9ab28abeff6cb8ffa50e565204ed4394524d28d7 /drivers/media/video/saa7134 | |
parent | f13613acfb1a71895ac886dc831d6ae4e20e241a (diff) |
V4L/DVB (7237): Convert videobuf-dma-sg to generic DMA API
videobuf-dma-sg does not need to depend on PCI. Switch it to using generic
DMA API, convert all affected drivers, relax Kconfig restriction, improve
compile-time type checking, fix some Coding Style violations while at it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 10 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 4 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 4 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 505bc0a478af..048081be91fe 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -503,7 +503,7 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, | |||
503 | /* release the old buffer */ | 503 | /* release the old buffer */ |
504 | if (substream->runtime->dma_area) { | 504 | if (substream->runtime->dma_area) { |
505 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); | 505 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); |
506 | videobuf_pci_dma_unmap(dev->pci, &dev->dmasound.dma); | 506 | videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma); |
507 | dsp_buffer_free(dev); | 507 | dsp_buffer_free(dev); |
508 | substream->runtime->dma_area = NULL; | 508 | substream->runtime->dma_area = NULL; |
509 | } | 509 | } |
@@ -519,12 +519,12 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, | |||
519 | return err; | 519 | return err; |
520 | } | 520 | } |
521 | 521 | ||
522 | if (0 != (err = videobuf_pci_dma_map(dev->pci, &dev->dmasound.dma))) { | 522 | if (0 != (err = videobuf_sg_dma_map(&dev->pci->dev, &dev->dmasound.dma))) { |
523 | dsp_buffer_free(dev); | 523 | dsp_buffer_free(dev); |
524 | return err; | 524 | return err; |
525 | } | 525 | } |
526 | if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->dmasound.pt))) { | 526 | if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->dmasound.pt))) { |
527 | videobuf_pci_dma_unmap(dev->pci, &dev->dmasound.dma); | 527 | videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma); |
528 | dsp_buffer_free(dev); | 528 | dsp_buffer_free(dev); |
529 | return err; | 529 | return err; |
530 | } | 530 | } |
@@ -533,7 +533,7 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, | |||
533 | dev->dmasound.dma.sglen, | 533 | dev->dmasound.dma.sglen, |
534 | 0))) { | 534 | 0))) { |
535 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); | 535 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); |
536 | videobuf_pci_dma_unmap(dev->pci, &dev->dmasound.dma); | 536 | videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma); |
537 | dsp_buffer_free(dev); | 537 | dsp_buffer_free(dev); |
538 | return err; | 538 | return err; |
539 | } | 539 | } |
@@ -569,7 +569,7 @@ static int snd_card_saa7134_hw_free(struct snd_pcm_substream * substream) | |||
569 | 569 | ||
570 | if (substream->runtime->dma_area) { | 570 | if (substream->runtime->dma_area) { |
571 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); | 571 | saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); |
572 | videobuf_pci_dma_unmap(dev->pci, &dev->dmasound.dma); | 572 | videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma); |
573 | dsp_buffer_free(dev); | 573 | dsp_buffer_free(dev); |
574 | substream->runtime->dma_area = NULL; | 574 | substream->runtime->dma_area = NULL; |
575 | } | 575 | } |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index b55df4877aff..eabc67d03b2c 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -899,8 +899,8 @@ static int dvb_init(struct saa7134_dev *dev) | |||
899 | dev->ts.nr_bufs = 32; | 899 | dev->ts.nr_bufs = 32; |
900 | dev->ts.nr_packets = 32*4; | 900 | dev->ts.nr_packets = 32*4; |
901 | dev->dvb.name = dev->name; | 901 | dev->dvb.name = dev->name; |
902 | videobuf_queue_pci_init(&dev->dvb.dvbq, &saa7134_ts_qops, | 902 | videobuf_queue_sg_init(&dev->dvb.dvbq, &saa7134_ts_qops, |
903 | dev->pci, &dev->slock, | 903 | &dev->pci->dev, &dev->slock, |
904 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 904 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
905 | V4L2_FIELD_ALTERNATE, | 905 | V4L2_FIELD_ALTERNATE, |
906 | sizeof(struct saa7134_buf), | 906 | sizeof(struct saa7134_buf), |
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 40d4a66b77f5..e002be568c21 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -427,8 +427,8 @@ static int empress_init(struct saa7134_dev *dev) | |||
427 | printk(KERN_INFO "%s: registered device video%d [mpeg]\n", | 427 | printk(KERN_INFO "%s: registered device video%d [mpeg]\n", |
428 | dev->name,dev->empress_dev->minor & 0x1f); | 428 | dev->name,dev->empress_dev->minor & 0x1f); |
429 | 429 | ||
430 | videobuf_queue_pci_init(&dev->empress_tsq, &saa7134_ts_qops, | 430 | videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops, |
431 | dev->pci, &dev->slock, | 431 | &dev->pci->dev, &dev->slock, |
432 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 432 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
433 | V4L2_FIELD_ALTERNATE, | 433 | V4L2_FIELD_ALTERNATE, |
434 | sizeof(struct saa7134_buf), | 434 | sizeof(struct saa7134_buf), |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 5385026a85ef..ecc5243da57e 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1350,14 +1350,14 @@ static int video_open(struct inode *inode, struct file *file) | |||
1350 | fh->height = 576; | 1350 | fh->height = 576; |
1351 | v4l2_prio_open(&dev->prio,&fh->prio); | 1351 | v4l2_prio_open(&dev->prio,&fh->prio); |
1352 | 1352 | ||
1353 | videobuf_queue_pci_init(&fh->cap, &video_qops, | 1353 | videobuf_queue_sg_init(&fh->cap, &video_qops, |
1354 | dev->pci, &dev->slock, | 1354 | &dev->pci->dev, &dev->slock, |
1355 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 1355 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
1356 | V4L2_FIELD_INTERLACED, | 1356 | V4L2_FIELD_INTERLACED, |
1357 | sizeof(struct saa7134_buf), | 1357 | sizeof(struct saa7134_buf), |
1358 | fh); | 1358 | fh); |
1359 | videobuf_queue_pci_init(&fh->vbi, &saa7134_vbi_qops, | 1359 | videobuf_queue_sg_init(&fh->vbi, &saa7134_vbi_qops, |
1360 | dev->pci, &dev->slock, | 1360 | &dev->pci->dev, &dev->slock, |
1361 | V4L2_BUF_TYPE_VBI_CAPTURE, | 1361 | V4L2_BUF_TYPE_VBI_CAPTURE, |
1362 | V4L2_FIELD_SEQ_TB, | 1362 | V4L2_FIELD_SEQ_TB, |
1363 | sizeof(struct saa7134_buf), | 1363 | sizeof(struct saa7134_buf), |