]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00231773-6 SDMA: add event pending trigger interface
authorChen Liangjun <b36089@freescale.com>
Mon, 29 Oct 2012 07:36:24 +0000 (15:36 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:40 +0000 (08:35 +0200)
When SDMA is use for periphal data transfer, dma request is trigger by
FIFO level. If the SDMA is started after the start of periphal, SDMA
would miss the first pulse and be not able to trigger itself.

In this patch, add interface to trigger a dma request manully.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
drivers/dma/imx-sdma.c

index 4ac83196562aa9e44f2d41ced7fe02f8beaa1da6..68cacbffb071cf3ca9e1c7ace96d18a2db493d1b 100644 (file)
@@ -1300,6 +1300,22 @@ static void sdma_issue_pending(struct dma_chan *chan)
         */
 }
 
+void sdma_set_event_pending(struct dma_chan *chan)
+{
+       struct sdma_channel *sdmac = to_sdma_chan(chan);
+       struct sdma_engine *sdma = sdmac->sdma;
+       u32 reg;
+       u32 channel;
+
+       channel = sdmac->channel;
+       reg = readl_relaxed(sdma->regs + SDMA_H_EVTPEND);
+       reg |= 1 << channel;
+       writel_relaxed(reg, sdma->regs + SDMA_H_EVTPEND);
+
+       return;
+}
+EXPORT_SYMBOL(sdma_set_event_pending);
+
 #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1        38
 
 static void sdma_add_scripts(struct sdma_engine *sdma,