aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-03 11:17:11 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-04 00:28:47 +0100
commit893e63e301e37cd3be7afb55c95eb8ef6ead304b (patch)
tree6fb0e3f6df037f1a05f2402a4723531a4689b0d0
parent470b23f7308dd2af25bd075d14a724f8ccd93985 (diff)
dmaengine: omap-dma: improve efficiency loading C.SA/C.EI/C.FI registers
The only thing which changes is which registers are written, so put this in local variables instead. This results in smaller code. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/dma/omap-dma.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index d1641aa9d113..06727a78e883 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -275,17 +275,21 @@ static void omap_dma_start_sg(struct omap_chan *c, struct omap_desc *d,
unsigned idx)
{
struct omap_sg *sg = d->sg + idx;
+ unsigned cxsa, cxei, cxfi;
if (d->dir == DMA_DEV_TO_MEM) {
- c->plat->dma_write(sg->addr, CDSA, c->dma_ch);
- c->plat->dma_write(0, CDEI, c->dma_ch);
- c->plat->dma_write(0, CDFI, c->dma_ch);
+ cxsa = CDSA;
+ cxei = CDEI;
+ cxfi = CDFI;
} else {
- c->plat->dma_write(sg->addr, CSSA, c->dma_ch);
- c->plat->dma_write(0, CSEI, c->dma_ch);
- c->plat->dma_write(0, CSFI, c->dma_ch);
+ cxsa = CSSA;
+ cxei = CSEI;
+ cxfi = CSFI;
}
+ c->plat->dma_write(sg->addr, cxsa, c->dma_ch);
+ c->plat->dma_write(0, cxei, c->dma_ch);
+ c->plat->dma_write(0, cxfi, c->dma_ch);
c->plat->dma_write(sg->en, CEN, c->dma_ch);
c->plat->dma_write(sg->fn, CFN, c->dma_ch);
@@ -296,6 +300,7 @@ static void omap_dma_start_desc(struct omap_chan *c)
{
struct virt_dma_desc *vd = vchan_next_desc(&c->vc);
struct omap_desc *d;
+ unsigned cxsa, cxei, cxfi;
if (!vd) {
c->desc = NULL;
@@ -312,15 +317,18 @@ static void omap_dma_start_desc(struct omap_chan *c)
c->plat->dma_write(d->ccr >> 16, CCR2, c->dma_ch);
if (d->dir == DMA_DEV_TO_MEM) {
- c->plat->dma_write(d->dev_addr, CSSA, c->dma_ch);
- c->plat->dma_write(0, CSEI, c->dma_ch);
- c->plat->dma_write(d->fi, CSFI, c->dma_ch);
+ cxsa = CSSA;
+ cxei = CSEI;
+ cxfi = CSFI;
} else {
- c->plat->dma_write(d->dev_addr, CDSA, c->dma_ch);
- c->plat->dma_write(0, CDEI, c->dma_ch);
- c->plat->dma_write(d->fi, CDFI, c->dma_ch);
+ cxsa = CDSA;
+ cxei = CDEI;
+ cxfi = CDFI;
}
+ c->plat->dma_write(d->dev_addr, cxsa, c->dma_ch);
+ c->plat->dma_write(0, cxei, c->dma_ch);
+ c->plat->dma_write(d->fi, cxfi, c->dma_ch);
c->plat->dma_write(d->csdp, CSDP, c->dma_ch);
omap_dma_start_sg(c, d, 0);