From 738f2b7b813913e651f39387d007dd961755dee2 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 27 Aug 2008 18:09:11 -0700 Subject: 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 --- sound/core/memalloc.c | 8 ++++---- sound/sparc/dbri.c | 41 +++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'sound') 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, snd_assert(size > 0, return NULL); snd_assert(dma_addr != NULL, return NULL); pg = get_order(size); - res = sbus_alloc_consistent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), - dma_addr); + res = dma_alloc_coherent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), + dma_addr, GFP_ATOMIC); if (res != NULL) inc_snd_pages(pg); return res; @@ -209,8 +209,8 @@ static void snd_free_sbus_pages(struct device *dev, size_t size, return; pg = get_order(size); dec_snd_pages(pg); - sbus_free_consistent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), - ptr, dma_addr); + dma_free_coherent(&sdev->ofdev.dev, PAGE_SIZE * (1 << pg), + ptr, dma_addr); } #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 @@ #include #include #include +#include #include #include @@ -2093,15 +2094,15 @@ static int snd_dbri_hw_params(struct snd_pcm_substream *substream, */ if (info->dvma_buffer == 0) { if (DBRI_STREAMNO(substream) == DBRI_PLAY) - direction = SBUS_DMA_TODEVICE; + direction = DMA_TO_DEVICE; else - direction = SBUS_DMA_FROMDEVICE; + direction = DMA_FROM_DEVICE; info->dvma_buffer = - sbus_map_single(&dbri->sdev->ofdev.dev, - runtime->dma_area, - params_buffer_bytes(hw_params), - direction); + dma_map_single(&dbri->sdev->ofdev.dev, + runtime->dma_area, + params_buffer_bytes(hw_params), + direction); } direction = params_buffer_bytes(hw_params); @@ -2122,12 +2123,12 @@ static int snd_dbri_hw_free(struct snd_pcm_substream *substream) */ if (info->dvma_buffer) { if (DBRI_STREAMNO(substream) == DBRI_PLAY) - direction = SBUS_DMA_TODEVICE; + direction = DMA_TO_DEVICE; else - direction = SBUS_DMA_FROMDEVICE; + direction = DMA_FROM_DEVICE; - sbus_unmap_single(&dbri->sdev->ofdev.dev, info->dvma_buffer, - substream->runtime->buffer_size, direction); + dma_unmap_single(&dbri->sdev->ofdev.dev, info->dvma_buffer, + substream->runtime->buffer_size, direction); info->dvma_buffer = 0; } if (info->pipe != -1) { @@ -2525,9 +2526,9 @@ static int __devinit snd_dbri_create(struct snd_card *card, dbri->sdev = sdev; dbri->irq = irq; - dbri->dma = sbus_alloc_consistent(&sdev->ofdev.dev, - sizeof(struct dbri_dma), - &dbri->dma_dvma); + dbri->dma = dma_alloc_coherent(&sdev->ofdev.dev, + sizeof(struct dbri_dma), + &dbri->dma_dvma, GFP_ATOMIC); memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); 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, dbri->regs_size, "DBRI Registers"); if (!dbri->regs) { printk(KERN_ERR "DBRI: could not allocate registers\n"); - sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma), - (void *)dbri->dma, dbri->dma_dvma); + dma_free_coherent(&sdev->ofdev.dev, sizeof(struct dbri_dma), + (void *)dbri->dma, dbri->dma_dvma); return -EIO; } @@ -2549,8 +2550,8 @@ static int __devinit snd_dbri_create(struct snd_card *card, if (err) { printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq); sbus_iounmap(dbri->regs, dbri->regs_size); - sbus_free_consistent(&sdev->ofdev.dev, sizeof(struct dbri_dma), - (void *)dbri->dma, dbri->dma_dvma); + dma_free_coherent(&sdev->ofdev.dev, sizeof(struct dbri_dma), + (void *)dbri->dma, dbri->dma_dvma); return err; } @@ -2577,9 +2578,9 @@ static void snd_dbri_free(struct snd_dbri *dbri) sbus_iounmap(dbri->regs, dbri->regs_size); if (dbri->dma) - sbus_free_consistent(&dbri->sdev->ofdev.dev, - sizeof(struct dbri_dma), - (void *)dbri->dma, dbri->dma_dvma); + dma_free_coherent(&dbri->sdev->ofdev.dev, + sizeof(struct dbri_dma), + (void *)dbri->dma, dbri->dma_dvma); } static int __devinit dbri_probe(struct of_device *of_dev, -- cgit v1.2.3