diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/memalloc.c | 8 | ||||
-rw-r--r-- | sound/sparc/dbri.c | 41 |
2 files changed, 25 insertions, 24 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index cc803972c0fb..ccaaac45fafb 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c | |||
@@ -192,8 +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->ofdev.dev, PAGE_SIZE * (1 << pg), | 195 | res = dma_alloc_coherent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), |
196 | dma_addr); | 196 | dma_addr, GFP_ATOMIC); |
197 | if (res != NULL) | 197 | if (res != NULL) |
198 | inc_snd_pages(pg); | 198 | inc_snd_pages(pg); |
199 | return res; | 199 | return res; |
@@ -209,8 +209,8 @@ static void snd_free_sbus_pages(struct device *dev, size_t size, | |||
209 | return; | 209 | return; |
210 | pg = get_order(size); | 210 | pg = get_order(size); |
211 | dec_snd_pages(pg); | 211 | dec_snd_pages(pg); |
212 | sbus_free_consistent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), | 212 | dma_free_coherent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), |
213 | ptr, dma_addr); | 213 | ptr, dma_addr); |
214 | } | 214 | } |
215 | 215 | ||
216 | #endif /* CONFIG_SBUS */ | 216 | #endif /* CONFIG_SBUS */ |
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 | ||
2585 | static int __devinit dbri_probe(struct of_device *of_dev, | 2586 | static int __devinit dbri_probe(struct of_device *of_dev, |