MIPS: Alchemy: remove dbdma compat macros
authorManuel Lauss <manuel.lauss@googlemail.com>
Tue, 13 Oct 2009 18:22:34 +0000 (20:22 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 27 Feb 2010 11:52:54 +0000 (12:52 +0100)
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>
arch/mips/alchemy/common/dbdma.c
arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
drivers/ide/au1xxx-ide.c
drivers/mmc/host/au1xmmc.c
drivers/spi/au1550_spi.c
sound/oss/au1550_ac97.c
sound/soc/au1x/dbdma2.c

index 549b18f3c18bfb88566fac56563478960f66171d..864b6dab636820426a5151003dd59f3e837b4d6e 100644 (file)
@@ -571,7 +571,7 @@ EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
  * This updates the source pointer and byte count.  Normally used
  * for memory to fifo transfers.
  */
-u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
+u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
 {
        chan_tab_t              *ctp;
        au1x_ddma_desc_t        *dp;
@@ -624,14 +624,13 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
        /* Return something non-zero. */
        return nbytes;
 }
-EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
+EXPORT_SYMBOL(au1xxx_dbdma_put_source);
 
 /* Put a destination buffer into the DMA ring.
  * This updates the destination pointer and byte count.  Normally used
  * to place an empty buffer into the ring for fifo to memory transfers.
  */
-u32
-_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
+u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
 {
        chan_tab_t              *ctp;
        au1x_ddma_desc_t        *dp;
@@ -687,7 +686,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
        /* Return something non-zero. */
        return nbytes;
 }
-EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
+EXPORT_SYMBOL(au1xxx_dbdma_put_dest);
 
 /*
  * Get a destination buffer into the DMA ring.
index d206000fbfe2cd8e4f727f0329d31c8502e4c651..b417c3bcdcb94b9da985032ddcbcb6dadffb3174 100644 (file)
@@ -339,8 +339,8 @@ u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits);
 u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries);
 
 /* Put buffers on source/destination descriptors. */
-u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
-u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
+u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
+u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
 
 /* Get a buffer from the destination descriptor. */
 u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes);
@@ -363,25 +363,6 @@ void au1xxx_dbdma_suspend(void);
 void au1xxx_dbdma_resume(void);
 #endif
 
-
-/*
- * Some compatibilty macros -- needed to make changes to API
- * without breaking existing drivers.
- */
-#define au1xxx_dbdma_put_source(chanid, buf, nbytes)                   \
-       _au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
-#define au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags)      \
-       _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
-#define put_source_flags(chanid, buf, nbytes, flags)                   \
-       au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags)
-
-#define au1xxx_dbdma_put_dest(chanid, buf, nbytes)                     \
-       _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
-#define au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags)        \
-       _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
-#define put_dest_flags(chanid, buf, nbytes, flags)                     \
-       au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags)
-
 /*
  *     Flags for the put_source/put_dest functions.
  */
index 87cef0c440ad32f625fe7bd55e368b8a427afcf4..377412e1d32b09d826eed597d683cf5bd4e7b2ee 100644 (file)
@@ -56,8 +56,8 @@ static inline void auide_insw(unsigned long port, void *addr, u32 count)
        chan_tab_t *ctp;
        au1x_ddma_desc_t *dp;
 
-       if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, 
-                          DDMA_FLAGS_NOIE)) {
+       if (!au1xxx_dbdma_put_dest(ahwif->rx_chan, (void*)addr,
+                                  count << 1, DDMA_FLAGS_NOIE)) {
                printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
                return;
        }
@@ -74,8 +74,8 @@ static inline void auide_outsw(unsigned long port, void *addr, u32 count)
        chan_tab_t *ctp;
        au1x_ddma_desc_t *dp;
 
-       if(!put_source_flags(ahwif->tx_chan, (void*)addr,
-                            count << 1, DDMA_FLAGS_NOIE)) {
+       if (!au1xxx_dbdma_put_source(ahwif->tx_chan, (void*)addr,
+                                    count << 1, DDMA_FLAGS_NOIE)) {
                printk(KERN_ERR "%s failed %d\n", __func__, __LINE__);
                return;
        }
@@ -246,17 +246,14 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
                                flags = DDMA_FLAGS_NOIE;
 
                        if (iswrite) {
-                               if(!put_source_flags(ahwif->tx_chan, 
-                                                    (void*) sg_virt(sg),
-                                                    tc, flags)) { 
+                               if (!au1xxx_dbdma_put_source(ahwif->tx_chan,
+                                       (void *)sg_virt(sg), tc, flags)) {
                                        printk(KERN_ERR "%s failed %d\n", 
                                               __func__, __LINE__);
                                }
-                       } else 
-                       {
-                               if(!put_dest_flags(ahwif->rx_chan, 
-                                                  (void*) sg_virt(sg),
-                                                  tc, flags)) { 
+                       } else  {
+                               if (!au1xxx_dbdma_put_dest(ahwif->rx_chan,
+                                       (void *)sg_virt(sg), tc, flags)) {
                                        printk(KERN_ERR "%s failed %d\n", 
                                               __func__, __LINE__);
                                }
index d3f55615c0990e46176a0afd49ed0c55977833ef..d295dc5e4f6b5ab9873a66fb6dd5855a1d75f159 100644 (file)
@@ -650,10 +650,10 @@ static int au1xmmc_prepare_data(struct au1xmmc_host *host,
                                flags = DDMA_FLAGS_IE;
 
                        if (host->flags & HOST_F_XMIT) {
-                               ret = au1xxx_dbdma_put_source_flags(channel,
+                               ret = au1xxx_dbdma_put_source(channel,
                                        (void *)sg_virt(sg), len, flags);
                        } else {
-                               ret = au1xxx_dbdma_put_dest_flags(channel,
+                               ret = au1xxx_dbdma_put_dest(channel,
                                        (void *)sg_virt(sg), len, flags);
                        }
 
index cfd5ff9508fadd2f607d33495b5066cc34b1bbd1..22f7d72947877c13c0bdf6fafc8445e3f1b2bdb6 100644 (file)
@@ -412,11 +412,13 @@ static int au1550_spi_dma_txrxb(struct spi_device *spi, struct spi_transfer *t)
        }
 
        /* put buffers on the ring */
-       res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx, t->len);
+       res = au1xxx_dbdma_put_dest(hw->dma_rx_ch, hw->rx,
+                                   t->len, DDMA_FLAGS_IE);
        if (!res)
                dev_err(hw->dev, "rx dma put dest error\n");
 
-       res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx, t->len);
+       res = au1xxx_dbdma_put_source(hw->dma_tx_ch, (void *)hw->tx,
+                                     t->len, DDMA_FLAGS_IE);
        if (!res)
                dev_err(hw->dev, "tx dma put source error\n");
 
index 4191acccbcdb93fab12373847688b91103d52c65..b9ff0b7980324a688a7ae59a37ea14d26b9f59b3 100644 (file)
@@ -614,7 +614,8 @@ start_adc(struct au1550_state *s)
        /* Put two buffers on the ring to get things started.
        */
        for (i=0; i<2; i++) {
-               au1xxx_dbdma_put_dest(db->dmanr, db->nextIn, db->dma_fragsize);
+               au1xxx_dbdma_put_dest(db->dmanr, db->nextIn,
+                               db->dma_fragsize, DDMA_FLAGS_IE);
 
                db->nextIn += db->dma_fragsize;
                if (db->nextIn >= db->rawbuf + db->dmasize)
@@ -733,7 +734,7 @@ static void dac_dma_interrupt(int irq, void *dev_id)
 
        if (db->count >= db->fragsize) {
                if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
-                                                       db->fragsize) == 0) {
+                               db->fragsize, DDMA_FLAGS_IE) == 0) {
                        err("qcount < 2 and no ring room!");
                }
                db->nextOut += db->fragsize;
@@ -777,7 +778,8 @@ static void adc_dma_interrupt(int irq, void *dev_id)
 
        /* Put a new empty buffer on the destination DMA.
        */
-       au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn, dp->dma_fragsize);
+       au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn,
+                             dp->dma_fragsize, DDMA_FLAGS_IE);
 
        dp->nextIn += dp->dma_fragsize;
        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)
                 * we know the dma has stopped.
                 */
                while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
-                       if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
-                                                       db->fragsize) == 0) {
+                       if (au1xxx_dbdma_put_source(db->dmanr,
+                               db->nextOut, db->fragsize, DDMA_FLAGS_IE) == 0) {
                                err("qcount < 2 and no ring room!");
                        }
                        db->nextOut += db->fragsize;
index 19e4d37eba1cf2c253c1e098aa52b8798d3b766a..2929f1c42264ca38e6e711538226aef9538ed00e 100644 (file)
@@ -94,7 +94,7 @@ static const struct snd_pcm_hardware au1xpsc_pcm_hardware = {
 
 static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd)
 {
-       au1xxx_dbdma_put_source_flags(cd->ddma_chan,
+       au1xxx_dbdma_put_source(cd->ddma_chan,
                                (void *)phys_to_virt(cd->dma_area),
                                cd->period_bytes, DDMA_FLAGS_IE);
 
@@ -109,9 +109,9 @@ static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd)
 
 static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd)
 {
-       au1xxx_dbdma_put_dest_flags(cd->ddma_chan,
-                               (void *)phys_to_virt(cd->dma_area),
-                               cd->period_bytes, DDMA_FLAGS_IE);
+       au1xxx_dbdma_put_dest(cd->ddma_chan,
+                             (void *)phys_to_virt(cd->dma_area),
+                             cd->period_bytes, DDMA_FLAGS_IE);
 
        /* update next-to-queue period */
        ++cd->q_period;