Blackfin arch: Add DMA API to set curr descriptor address
authorSonic Zhang <sonic.zhang@analog.com>
Sun, 5 Aug 2007 08:14:58 +0000 (16:14 +0800)
committerBryan Wu <bryan.wu@analog.com>
Sun, 5 Aug 2007 08:14:58 +0000 (16:14 +0800)
This API is necessary for DMA descriptor array mode.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
arch/blackfin/kernel/bfin_dma_5xx.c
include/asm-blackfin/dma.h

index 62f5a35c13eeba445ffc450058d90b1ccea0288b..f0db6c5c8d1aecc60f23c219df30a596576504cf 100644 (file)
@@ -270,10 +270,23 @@ void set_dma_next_desc_addr(unsigned int channel, unsigned long addr)
 
        dma_ch[channel].regs->next_desc_ptr = addr;
        SSYNC();
-       pr_debug("set_dma_start_addr() : END\n");
+       pr_debug("set_dma_next_desc_addr() : END\n");
 }
 EXPORT_SYMBOL(set_dma_next_desc_addr);
 
+void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr)
+{
+       pr_debug("set_dma_curr_desc_addr() : BEGIN \n");
+
+       BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
+              && channel < MAX_BLACKFIN_DMA_CHANNEL));
+
+       dma_ch[channel].regs->curr_desc_ptr = addr;
+       SSYNC();
+       pr_debug("set_dma_curr_desc_addr() : END\n");
+}
+EXPORT_SYMBOL(set_dma_curr_desc_addr);
+
 void set_dma_x_count(unsigned int channel, unsigned short x_count)
 {
        BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
index 4269082b154aede9b7946cbb5fc651ee276c4466..b42a531e7a1b9d90497652897e6ca7d4cd104f3f 100644 (file)
@@ -152,6 +152,7 @@ struct dma_channel {
 /* functions to set register mode */
 void set_dma_start_addr(unsigned int channel, unsigned long addr);
 void set_dma_next_desc_addr(unsigned int channel, unsigned long addr);
+void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr);
 void set_dma_x_count(unsigned int channel, unsigned short x_count);
 void set_dma_x_modify(unsigned int channel, short x_modify);
 void set_dma_y_count(unsigned int channel, unsigned short y_count);