aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sparc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:09:11 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:15 -0400
commit738f2b7b813913e651f39387d007dd961755dee2 (patch)
tree022ca4d144cba51495e6f26a8f55d3046d16c2e3 /sound/sparc
parent944c67dff7a88f0a775e5b604937f9e30d2de555 (diff)
sparc: Convert all SBUS drivers to dma_*() interfaces.
And all the SBUS dma interfaces are deleted. A private implementation remains inside of the 32-bit sparc port which exists only for the sake of the implementation of dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/sparc')
-rw-r--r--sound/sparc/dbri.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index a6b32ec34bde..5242ecbb91d5 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -57,6 +57,7 @@
57#include <linux/delay.h> 57#include <linux/delay.h>
58#include <linux/irq.h> 58#include <linux/irq.h>
59#include <linux/io.h> 59#include <linux/io.h>
60#include <linux/dma-mapping.h>
60 61
61#include <sound/core.h> 62#include <sound/core.h>
62#include <sound/pcm.h> 63#include <sound/pcm.h>
@@ -2093,15 +2094,15 @@ static int snd_dbri_hw_params(struct snd_pcm_substream *substream,
2093 */ 2094 */
2094 if (info->dvma_buffer == 0) { 2095 if (info->dvma_buffer == 0) {
2095 if (DBRI_STREAMNO(substream) == DBRI_PLAY) 2096 if (DBRI_STREAMNO(substream) == DBRI_PLAY)
2096 direction = SBUS_DMA_TODEVICE; 2097 direction = DMA_TO_DEVICE;
2097 else 2098 else
2098 direction = SBUS_DMA_FROMDEVICE; 2099 direction = DMA_FROM_DEVICE;
2099 2100
2100 info->dvma_buffer = 2101 info->dvma_buffer =
2101 sbus_map_single(&dbri->sdev->ofdev.dev, 2102 dma_map_single(&dbri->sdev->ofdev.dev,
2102 runtime->dma_area, 2103 runtime->dma_area,
2103 params_buffer_bytes(hw_params), 2104 params_buffer_bytes(hw_params),
2104 direction); 2105 direction);
2105 } 2106 }
2106 2107
2107 direction = params_buffer_bytes(hw_params); 2108 direction = params_buffer_bytes(hw_params);
@@ -2122,12 +2123,12 @@ static int snd_dbri_hw_free(struct snd_pcm_substream *substream)
2122 */ 2123 */
2123 if (info->dvma_buffer) { 2124 if (info->dvma_buffer) {
2124 if (DBRI_STREAMNO(substream) == DBRI_PLAY) 2125 if (DBRI_STREAMNO(substream) == DBRI_PLAY)
2125 direction = SBUS_DMA_TODEVICE; 2126 direction = DMA_TO_DEVICE;
2126 else 2127 else
2127 direction = SBUS_DMA_FROMDEVICE; 2128 direction = DMA_FROM_DEVICE;
2128 2129
2129 sbus_unmap_single(&dbri->sdev->ofdev.dev, info->dvma_buffer, 2130 dma_unmap_single(&dbri->sdev->ofdev.dev, info->dvma_buffer,
2130 substream->runtime->buffer_size, direction); 2131 substream->runtime->buffer_size, direction);
2131 info->dvma_buffer = 0; 2132 info->dvma_buffer = 0;
2132 } 2133 }
2133 if (info->pipe != -1) { 2134 if (info->pipe != -1) {
@@ -2525,9 +2526,9 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2525 dbri->sdev = sdev; 2526 dbri->sdev = sdev;
2526 dbri->irq = irq; 2527 dbri->irq = irq;
2527 2528
2528 dbri->dma = sbus_alloc_consistent(&sdev->ofdev.dev, 2529 dbri->dma = dma_alloc_coherent(&sdev->ofdev.dev,
2529 sizeof(struct dbri_dma), 2530 sizeof(struct dbri_dma),
2530 &dbri->dma_dvma); 2531 &dbri->dma_dvma, GFP_ATOMIC);
2531 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); 2532 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
2532 2533
2533 dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", 2534 dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n",
@@ -2539,8 +2540,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2539 dbri->regs_size, "DBRI Registers"); 2540 dbri->regs_size, "DBRI Registers");
2540 if (!dbri->regs) { 2541 if (!dbri->regs) {
2541 printk(KERN_ERR "DBRI: could not allocate registers\n"); 2542 printk(KERN_ERR "DBRI: could not allocate registers\n");
2542 sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma), 2543 dma_free_coherent(&sdev->ofdev.dev, sizeof(struct dbri_dma),
2543 (void *)dbri->dma, dbri->dma_dvma); 2544 (void *)dbri->dma, dbri->dma_dvma);
2544 return -EIO; 2545 return -EIO;
2545 } 2546 }
2546 2547
@@ -2549,8 +2550,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2549 if (err) { 2550 if (err) {
2550 printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq); 2551 printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq);
2551 sbus_iounmap(dbri->regs, dbri->regs_size); 2552 sbus_iounmap(dbri->regs, dbri->regs_size);
2552 sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma), 2553 dma_free_coherent(&sdev->ofdev.dev, sizeof(struct dbri_dma),
2553 (void *)dbri->dma, dbri->dma_dvma); 2554 (void *)dbri->dma, dbri->dma_dvma);
2554 return err; 2555 return err;
2555 } 2556 }
2556 2557
@@ -2577,9 +2578,9 @@ static void snd_dbri_free(struct snd_dbri *dbri)
2577 sbus_iounmap(dbri->regs, dbri->regs_size); 2578 sbus_iounmap(dbri->regs, dbri->regs_size);
2578 2579
2579 if (dbri->dma) 2580 if (dbri->dma)
2580 sbus_free_consistent(&dbri->sdev->ofdev.dev, 2581 dma_free_coherent(&dbri->sdev->ofdev.dev,
2581 sizeof(struct dbri_dma), 2582 sizeof(struct dbri_dma),
2582 (void *)dbri->dma, dbri->dma_dvma); 2583 (void *)dbri->dma, dbri->dma_dvma);
2583} 2584}
2584 2585
2585static int __devinit dbri_probe(struct of_device *of_dev, 2586static int __devinit dbri_probe(struct of_device *of_dev,