aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:37:58 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:12 -0400
commit7a715f46012f3552294154978aed59cba9804928 (patch)
tree9e7079ae4ad370b63ac6c8a4face573d6cf60533 /sound
parent5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (diff)
sparc: Make SBUS DMA interfaces take struct device.
This is the first step in converting all the SBUS drivers over to generic dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/memalloc.c6
-rw-r--r--sound/sparc/dbri.c15
2 files changed, 13 insertions, 8 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index f5d6d8d12979..cc803972c0fb 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -192,7 +192,8 @@ static void *snd_malloc_sbus_pages(struct device *dev, size_t size,
192 snd_assert(size > 0, return NULL); 192 snd_assert(size > 0, return NULL);
193 snd_assert(dma_addr != NULL, return NULL); 193 snd_assert(dma_addr != NULL, return NULL);
194 pg = get_order(size); 194 pg = get_order(size);
195 res = sbus_alloc_consistent(sdev, PAGE_SIZE * (1 << pg), dma_addr); 195 res = sbus_alloc_consistent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg),
196 dma_addr);
196 if (res != NULL) 197 if (res != NULL)
197 inc_snd_pages(pg); 198 inc_snd_pages(pg);
198 return res; 199 return res;
@@ -208,7 +209,8 @@ static void snd_free_sbus_pages(struct device *dev, size_t size,
208 return; 209 return;
209 pg = get_order(size); 210 pg = get_order(size);
210 dec_snd_pages(pg); 211 dec_snd_pages(pg);
211 sbus_free_consistent(sdev, PAGE_SIZE * (1 << pg), ptr, dma_addr); 212 sbus_free_consistent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg),
213 ptr, dma_addr);
212} 214}
213 215
214#endif /* CONFIG_SBUS */ 216#endif /* CONFIG_SBUS */
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index ee2e1b4f3551..a6b32ec34bde 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -2097,7 +2097,8 @@ static int snd_dbri_hw_params(struct snd_pcm_substream *substream,
2097 else 2097 else
2098 direction = SBUS_DMA_FROMDEVICE; 2098 direction = SBUS_DMA_FROMDEVICE;
2099 2099
2100 info->dvma_buffer = sbus_map_single(dbri->sdev, 2100 info->dvma_buffer =
2101 sbus_map_single(&dbri->sdev->ofdev.dev,
2101 runtime->dma_area, 2102 runtime->dma_area,
2102 params_buffer_bytes(hw_params), 2103 params_buffer_bytes(hw_params),
2103 direction); 2104 direction);
@@ -2125,7 +2126,7 @@ static int snd_dbri_hw_free(struct snd_pcm_substream *substream)
2125 else 2126 else
2126 direction = SBUS_DMA_FROMDEVICE; 2127 direction = SBUS_DMA_FROMDEVICE;
2127 2128
2128 sbus_unmap_single(dbri->sdev, info->dvma_buffer, 2129 sbus_unmap_single(&dbri->sdev->ofdev.dev, info->dvma_buffer,
2129 substream->runtime->buffer_size, direction); 2130 substream->runtime->buffer_size, direction);
2130 info->dvma_buffer = 0; 2131 info->dvma_buffer = 0;
2131 } 2132 }
@@ -2524,7 +2525,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2524 dbri->sdev = sdev; 2525 dbri->sdev = sdev;
2525 dbri->irq = irq; 2526 dbri->irq = irq;
2526 2527
2527 dbri->dma = sbus_alloc_consistent(sdev, sizeof(struct dbri_dma), 2528 dbri->dma = sbus_alloc_consistent(&sdev->ofdev.dev,
2529 sizeof(struct dbri_dma),
2528 &dbri->dma_dvma); 2530 &dbri->dma_dvma);
2529 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); 2531 memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
2530 2532
@@ -2537,7 +2539,7 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2537 dbri->regs_size, "DBRI Registers"); 2539 dbri->regs_size, "DBRI Registers");
2538 if (!dbri->regs) { 2540 if (!dbri->regs) {
2539 printk(KERN_ERR "DBRI: could not allocate registers\n"); 2541 printk(KERN_ERR "DBRI: could not allocate registers\n");
2540 sbus_free_consistent(sdev, sizeof(struct dbri_dma), 2542 sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma),
2541 (void *)dbri->dma, dbri->dma_dvma); 2543 (void *)dbri->dma, dbri->dma_dvma);
2542 return -EIO; 2544 return -EIO;
2543 } 2545 }
@@ -2547,7 +2549,7 @@ static int __devinit snd_dbri_create(struct snd_card *card,
2547 if (err) { 2549 if (err) {
2548 printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq); 2550 printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq);
2549 sbus_iounmap(dbri->regs, dbri->regs_size); 2551 sbus_iounmap(dbri->regs, dbri->regs_size);
2550 sbus_free_consistent(sdev, sizeof(struct dbri_dma), 2552 sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma),
2551 (void *)dbri->dma, dbri->dma_dvma); 2553 (void *)dbri->dma, dbri->dma_dvma);
2552 return err; 2554 return err;
2553 } 2555 }
@@ -2575,7 +2577,8 @@ static void snd_dbri_free(struct snd_dbri *dbri)
2575 sbus_iounmap(dbri->regs, dbri->regs_size); 2577 sbus_iounmap(dbri->regs, dbri->regs_size);
2576 2578
2577 if (dbri->dma) 2579 if (dbri->dma)
2578 sbus_free_consistent(dbri->sdev, sizeof(struct dbri_dma), 2580 sbus_free_consistent(&dbri->sdev->ofdev.dev,
2581 sizeof(struct dbri_dma),
2579 (void *)dbri->dma, dbri->dma_dvma); 2582 (void *)dbri->dma, dbri->dma_dvma);
2580} 2583}
2581 2584