diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-07-30 23:28:27 +0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-08-01 08:48:52 +0400 |
commit | 4f46f8ac80416b0e8fd3aba6a0d842205fb29140 (patch) | |
tree | 1913a661d292e74ea13e2e1af38b21ef6e5fb1bc /drivers/dma/sh/shdma.c | |
parent | ac694dbdbc403c00e2c14d10bc7b8412cc378259 (diff) | |
download | linux-4f46f8ac80416b0e8fd3aba6a0d842205fb29140.tar.xz |
dmaengine: shdma: restore partial transfer calculation
The recent shdma driver split has mistakenly removed support for partial
DMA transfer size calculation on forced termination. This patch restores
it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/dma/sh/shdma.c')
-rw-r--r-- | drivers/dma/sh/shdma.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c index 027c9be97654..f41bcc5267fd 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdma.c @@ -381,6 +381,17 @@ static bool sh_dmae_chan_irq(struct shdma_chan *schan, int irq) return true; } +static size_t sh_dmae_get_partial(struct shdma_chan *schan, + struct shdma_desc *sdesc) +{ + struct sh_dmae_chan *sh_chan = container_of(schan, struct sh_dmae_chan, + shdma_chan); + struct sh_dmae_desc *sh_desc = container_of(sdesc, + struct sh_dmae_desc, shdma_desc); + return (sh_desc->hw.tcr - sh_dmae_readl(sh_chan, TCR)) << + sh_chan->xmit_shift; +} + /* Called from error IRQ or NMI */ static bool sh_dmae_reset(struct sh_dmae_device *shdev) { @@ -632,6 +643,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = { .start_xfer = sh_dmae_start_xfer, .embedded_desc = sh_dmae_embedded_desc, .chan_irq = sh_dmae_chan_irq, + .get_partial = sh_dmae_get_partial, }; static int __devinit sh_dmae_probe(struct platform_device *pdev) |