aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2009-10-13 14:22:34 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:52:54 -0500
commitea071cc705e8bfba0c8bf84be8d4f9f4e9da6962 (patch)
tree9dafff9da1740dcfc475100b4d5dae963650cfd1
parentf1fc6645a4d2cb944320ce8ed1e40f88059779e1 (diff)
MIPS: Alchemy: remove dbdma compat macros
Remove dbdma compat macros, move remaining users over to default queueing functions and -flags. (Queueing function signature has changed in order to give a build failure instead of silent functional changes due to the no longer implicitly specified DDMA_FLAGS_IE flag) Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/alchemy/common/dbdma.c9
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h23
-rw-r--r--drivers/ide/au1xxx-ide.c21
-rw-r--r--drivers/mmc/host/au1xmmc.c4
-rw-r--r--drivers/spi/au1550_spi.c6
-rw-r--r--sound/oss/au1550_ac97.c12
-rw-r--r--sound/soc/au1x/dbdma2.c8
7 files changed, 32 insertions, 51 deletions
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index 549b18f3c18..864b6dab636 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -571,7 +571,7 @@ EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
571 * This updates the source pointer and byte count. Normally used 571 * This updates the source pointer and byte count. Normally used
572 * for memory to fifo transfers. 572 * for memory to fifo transfers.
573 */ 573 */
574u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags) 574u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
575{ 575{
576 chan_tab_t *ctp; 576 chan_tab_t *ctp;
577 au1x_ddma_desc_t *dp; 577 au1x_ddma_desc_t *dp;
@@ -624,14 +624,13 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
624 /* Return something non-zero. */ 624 /* Return something non-zero. */
625 return nbytes; 625 return nbytes;
626} 626}
627EXPORT_SYMBOL(_au1xxx_dbdma_put_source); 627EXPORT_SYMBOL(au1xxx_dbdma_put_source);
628 628
629/* Put a destination buffer into the DMA ring. 629/* Put a destination buffer into the DMA ring.
630 * This updates the destination pointer and byte count. Normally used 630 * This updates the destination pointer and byte count. Normally used
631 * to place an empty buffer into the ring for fifo to memory transfers. 631 * to place an empty buffer into the ring for fifo to memory transfers.
632 */ 632 */
633u32 633u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
634_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
635{ 634{
636 chan_tab_t *ctp; 635 chan_tab_t *ctp;
637 au1x_ddma_desc_t *dp; 636 au1x_ddma_desc_t *dp;
@@ -687,7 +686,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
687 /* Return something non-zero. */ 686 /* Return something non-zero. */
688 return nbytes; 687 return nbytes;
689} 688}
690EXPORT_SYMBOL(_au1xxx_dbdma_put_dest); 689EXPORT_SYMBOL(au1xxx_dbdma_put_dest);
691 690
692/* 691/*
693 * Get a destination buffer into the DMA ring. 692 * Get a destination buffer into the DMA ring.
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
index d206000fbfe..b417c3bcdcb 100644
--- a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
@@ -339,8 +339,8 @@ u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits);
339u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries); 339u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries);
340 340
341/* Put buffers on source/destination descriptors. */ 341/* Put buffers on source/destination descriptors. */
342u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags); 342u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
343u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags); 343u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
344 344
345/* Get a buffer from the destination descriptor. */ 345/* Get a buffer from the destination descriptor. */
346u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes); 346u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes);
@@ -363,25 +363,6 @@ void au1xxx_dbdma_suspend(void);
363void au1xxx_dbdma_resume(void); 363void au1xxx_dbdma_resume(void);
364#endif 364#endif
365 365
366
367/*
368 * Some compatibilty macros -- needed to make changes to API
369 * without breaking existing drivers.
370 */
371#define au1xxx_dbdma_put_source(chanid, buf, nbytes) \
372 _au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
373#define au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags) \
374 _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
375#define put_source_flags(chanid, buf, nbytes, flags) \
376 au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags)
377
378#define au1xxx_dbdma_put_dest(chanid, buf, nbytes) \
379 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
380#define au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags) \
381 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
382#define put_dest_flags(chanid, buf, nbytes, flags) \
383 au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags)
384
385/* 366/*
386 * Flags for the put_source/put_dest functions. 367 * Flags for the put_source/put_dest functions.
387 */ 368 */
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index 87cef0c440a..377412e1d32 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -56,8 +56,8 @@ static inline void auide_insw(unsigned long port, void *addr, u32 count)
56 chan_tab_t *ctp; 56 chan_tab_t *ctp;
57 au1x_ddma_desc_t *dp; 57 au1x_ddma_desc_t *dp;
58 58
59 if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, 59 if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, (void*)addr,
60 DDMA_FLAGS_NOIE)) { 60 count << 1, DDMA_FLAGS_NOIE)) {
61 printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); 61 printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
62 return; 62 return;
63 } 63 }
@@ -74,8 +74,8 @@ static inline void auide_outsw(unsigned long port, void *addr, u32 count)
74 chan_tab_t *ctp; 74 chan_tab_t *ctp;
75 au1x_ddma_desc_t *dp; 75 au1x_ddma_desc_t *dp;
76 76
77 if(!put_source_flags(ahwif->tx_chan, (void*)addr, 77 if (!au1xxx_dbdma_put_source(ahwif->tx_chan, (void*)addr,
78 count << 1, DDMA_FLAGS_NOIE)) { 78 count << 1, DDMA_FLAGS_NOIE)) {
79 printk(KERN_ERR "%s failed %d\n", __func__, __LINE__); 79 printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
80 return; 80 return;
81 } 81 }
@@ -246,17 +246,14 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
246 flags = DDMA_FLAGS_NOIE; 246 flags = DDMA_FLAGS_NOIE;
247 247
248 if (iswrite) { 248 if (iswrite) {
249 if(!put_source_flags(ahwif->tx_chan, 249 if (!au1xxx_dbdma_put_source(ahwif->tx_chan,
250 (void*) sg_virt(sg), 250 (void *)sg_virt(sg), tc, flags)) {
251 tc, flags)) {
252 printk(KERN_ERR "%s failed %d\n", 251 printk(KERN_ERR "%s failed %d\n",
253 __func__, __LINE__); 252 __func__, __LINE__);
254 } 253 }
255 } else 254 } else {
256 { 255 if (!au1xxx_dbdma_put_dest(ahwif->rx_chan,
257 if(!put_dest_flags(ahwif->rx_chan, 256 (void *)sg_virt(sg), tc, flags)) {
258 (void*) sg_virt(sg),
259 tc, flags)) {
260 printk(KERN_ERR "%s failed %d\n", 257 printk(KERN_ERR "%s failed %d\n",
261 __func__, __LINE__); 258 __func__, __LINE__);
262 } 259 }
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index d3f55615c09..d295dc5e4f6 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -650,10 +650,10 @@ static int au1xmmc_prepare_data(struct au1xmmc_host *host,
650 flags = DDMA_FLAGS_IE; 650 flags = DDMA_FLAGS_IE;
651 651
652 if (host->flags & HOST_F_XMIT) { 652 if (host->flags & HOST_F_XMIT) {
653 ret = au1xxx_dbdma_put_source_flags(channel, 653 ret = au1xxx_dbdma_put_source(channel,
654 (void *)sg_virt(sg), len, flags); 654 (void *)sg_virt(sg), len, flags);
655 } else { 655 } else {
656 ret = au1xxx_dbdma_put_dest_flags(channel, 656 ret = au1xxx_dbdma_put_dest(channel,
657 (void *)sg_virt(sg), len, flags); 657 (void *)sg_virt(sg), len, flags);
658 } 658 }
659 659
diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c
index cfd5ff9508f..22f7d729478 100644
--- a/drivers/spi/au1550_spi.c
+++ b/drivers/spi/au1550_spi.c
@@ -412,11 +412,13 @@ static int au1550_spi_dma_txrxb(struct spi_device *spi, struct spi_transfer *t)
412 } 412 }
413 413
414 /* put buffers on the ring */ 414 /* put buffers on the ring */
415 res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx, t->len); 415 res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx,
416 t->len, DDMA_FLAGS_IE);
416 if (!res) 417 if (!res)
417 dev_err(hw->dev, "rx dma put dest error\n"); 418 dev_err(hw->dev, "rx dma put dest error\n");
418 419
419 res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx, t->len); 420 res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx,
421 t->len, DDMA_FLAGS_IE);
420 if (!res) 422 if (!res)
421 dev_err(hw->dev, "tx dma put source error\n"); 423 dev_err(hw->dev, "tx dma put source error\n");
422 424
diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
index 4191acccbcd..b9ff0b79803 100644
--- a/sound/oss/au1550_ac97.c
+++ b/sound/oss/au1550_ac97.c
@@ -614,7 +614,8 @@ start_adc(struct au1550_state *s)
614 /* Put two buffers on the ring to get things started. 614 /* Put two buffers on the ring to get things started.
615 */ 615 */
616 for (i=0; i<2; i++) { 616 for (i=0; i<2; i++) {
617 au1xxx_dbdma_put_dest(db->dmanr, db->nextIn, db->dma_fragsize); 617 au1xxx_dbdma_put_dest(db->dmanr, db->nextIn,
618 db->dma_fragsize, DDMA_FLAGS_IE);
618 619
619 db->nextIn += db->dma_fragsize; 620 db->nextIn += db->dma_fragsize;
620 if (db->nextIn >= db->rawbuf + db->dmasize) 621 if (db->nextIn >= db->rawbuf + db->dmasize)
@@ -733,7 +734,7 @@ static void dac_dma_interrupt(int irq, void *dev_id)
733 734
734 if (db->count >= db->fragsize) { 735 if (db->count >= db->fragsize) {
735 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, 736 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
736 db->fragsize) == 0) { 737 db->fragsize, DDMA_FLAGS_IE) == 0) {
737 err("qcount < 2 and no ring room!"); 738 err("qcount < 2 and no ring room!");
738 } 739 }
739 db->nextOut += db->fragsize; 740 db->nextOut += db->fragsize;
@@ -777,7 +778,8 @@ static void adc_dma_interrupt(int irq, void *dev_id)
777 778
778 /* Put a new empty buffer on the destination DMA. 779 /* Put a new empty buffer on the destination DMA.
779 */ 780 */
780 au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn, dp->dma_fragsize); 781 au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn,
782 dp->dma_fragsize, DDMA_FLAGS_IE);
781 783
782 dp->nextIn += dp->dma_fragsize; 784 dp->nextIn += dp->dma_fragsize;
783 if (dp->nextIn >= dp->rawbuf + dp->dmasize) 785 if (dp->nextIn >= dp->rawbuf + dp->dmasize)
@@ -1177,8 +1179,8 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
1177 * we know the dma has stopped. 1179 * we know the dma has stopped.
1178 */ 1180 */
1179 while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) { 1181 while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
1180 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, 1182 if (au1xxx_dbdma_put_source(db->dmanr,
1181 db->fragsize) == 0) { 1183 db->nextOut, db->fragsize, DDMA_FLAGS_IE) == 0) {
1182 err("qcount < 2 and no ring room!"); 1184 err("qcount < 2 and no ring room!");
1183 } 1185 }
1184 db->nextOut += db->fragsize; 1186 db->nextOut += db->fragsize;
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c
index 19e4d37eba1..2929f1c4226 100644
--- a/sound/soc/au1x/dbdma2.c
+++ b/sound/soc/au1x/dbdma2.c
@@ -94,7 +94,7 @@ static const struct snd_pcm_hardware au1xpsc_pcm_hardware = {
94 94
95static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd) 95static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd)
96{ 96{
97 au1xxx_dbdma_put_source_flags(cd->ddma_chan, 97 au1xxx_dbdma_put_source(cd->ddma_chan,
98 (void *)phys_to_virt(cd->dma_area), 98 (void *)phys_to_virt(cd->dma_area),
99 cd->period_bytes, DDMA_FLAGS_IE); 99 cd->period_bytes, DDMA_FLAGS_IE);
100 100
@@ -109,9 +109,9 @@ static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd)
109 109
110static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd) 110static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd)
111{ 111{
112 au1xxx_dbdma_put_dest_flags(cd->ddma_chan, 112 au1xxx_dbdma_put_dest(cd->ddma_chan,
113 (void *)phys_to_virt(cd->dma_area), 113 (void *)phys_to_virt(cd->dma_area),
114 cd->period_bytes, DDMA_FLAGS_IE); 114 cd->period_bytes, DDMA_FLAGS_IE);
115 115
116 /* update next-to-queue period */ 116 /* update next-to-queue period */
117 ++cd->q_period; 117 ++cd->q_period;