From 75714ed0f396dcd9763a55c575f9e82ffe1e248a Mon Sep 17 00:00:00 2001 From: Chen Liangjun Date: Mon, 29 Oct 2012 15:36:24 +0800 Subject: [PATCH] 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 --- drivers/dma/imx-sdma.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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, -- 2.39.5