diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2018-07-11 11:10:15 +0900 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-07-11 10:47:30 +0530 |
commit | 4de1247a9826cec0ba054479124bd9aa60fb71a5 (patch) | |
tree | 3152792c67475f7084de8a52c828523ed32348a6 /drivers/dma/sh/rcar-dmac.c | |
parent | 538603c6026ce769eec633bb79349f5f287519c7 (diff) | |
download | linux-4de1247a9826cec0ba054479124bd9aa60fb71a5.tar.bz2 |
dmaengine: sh: rcar-dmac: add a new function to clear CHCR.DE with barrier
This patch adds a new function rcar_dmac_clear_chcr_de() to simplify
adding pause function later.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/sh/rcar-dmac.c')
-rw-r--r-- | drivers/dma/sh/rcar-dmac.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 9906a9c7220b..d3b7388645bc 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -759,18 +759,25 @@ static void rcar_dmac_chcr_de_barrier(struct rcar_dmac_chan *chan) dev_err(chan->chan.device->dev, "CHCR DE check error\n"); } -static void rcar_dmac_sync_tcr(struct rcar_dmac_chan *chan) +static void rcar_dmac_clear_chcr_de(struct rcar_dmac_chan *chan) { u32 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); - if (!(chcr & RCAR_DMACHCR_DE)) - return; - /* set DE=0 and flush remaining data */ rcar_dmac_chan_write(chan, RCAR_DMACHCR, (chcr & ~RCAR_DMACHCR_DE)); /* make sure all remaining data was flushed */ rcar_dmac_chcr_de_barrier(chan); +} + +static void rcar_dmac_sync_tcr(struct rcar_dmac_chan *chan) +{ + u32 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); + + if (!(chcr & RCAR_DMACHCR_DE)) + return; + + rcar_dmac_clear_chcr_de(chan); /* back DE if remain data exists */ if (rcar_dmac_chan_read(chan, RCAR_DMATCR)) |