From: Chen Liangjun Date: Mon, 29 Oct 2012 07:36:24 +0000 (+0800) Subject: ENGR00231773-6 SDMA: add event pending trigger interface X-Git-Tag: v3.0.35-fsl~285 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69b666e1d331159495bc79f614e242d138b1b0ff;p=karo-tx-linux.git ENGR00231773-6 SDMA: add event pending trigger interface 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 --- diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 4ac83196562a..68cacbffb071 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -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,