aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-03 06:17:11 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-03 19:28:47 -0400
commit893e63e301e37cd3be7afb55c95eb8ef6ead304b (patch)
tree6fb0e3f6df037f1a05f2402a4723531a4689b0d0 /drivers/dma
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>
Diffstat (limited to 'drivers/dma')
-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,
275 unsigned idx) 275 unsigned idx)
276{ 276{
277 struct omap_sg *sg = d->sg + idx; 277 struct omap_sg *sg = d->sg + idx;
278 unsigned cxsa, cxei, cxfi;
278 279
279 if (d->dir == DMA_DEV_TO_MEM) { 280 if (d->dir == DMA_DEV_TO_MEM) {
280 c->plat->dma_write(sg->addr, CDSA, c->dma_ch); 281 cxsa = CDSA;
281 c->plat->dma_write(0, CDEI, c->dma_ch); 282 cxei = CDEI;
282 c->plat->dma_write(0, CDFI, c->dma_ch); 283 cxfi = CDFI;
283 } else { 284 } else {
284 c->plat->dma_write(sg->addr, CSSA, c->dma_ch); 285 cxsa = CSSA;
285 c->plat->dma_write(0, CSEI, c->dma_ch); 286 cxei = CSEI;
286 c->plat->dma_write(0, CSFI, c->dma_ch); 287 cxfi = CSFI;
287 } 288 }
288 289
290 c->plat->dma_write(sg->addr, cxsa, c->dma_ch);
291 c->plat->dma_write(0, cxei, c->dma_ch);
292 c->plat->dma_write(0, cxfi, c->dma_ch);
289 c->plat->dma_write(sg->en, CEN, c->dma_ch); 293 c->plat->dma_write(sg->en, CEN, c->dma_ch);
290 c->plat->dma_write(sg->fn, CFN, c->dma_ch); 294 c->plat->dma_write(sg->fn, CFN, c->dma_ch);
291 295
@@ -296,6 +300,7 @@ static void omap_dma_start_desc(struct omap_chan *c)
296{ 300{
297 struct virt_dma_desc *vd = vchan_next_desc(&c->vc); 301 struct virt_dma_desc *vd = vchan_next_desc(&c->vc);
298 struct omap_desc *d; 302 struct omap_desc *d;
303 unsigned cxsa, cxei, cxfi;
299 304
300 if (!vd) { 305 if (!vd) {
301 c->desc = NULL; 306 c->desc = NULL;
@@ -312,15 +317,18 @@ static void omap_dma_start_desc(struct omap_chan *c)
312 c->plat->dma_write(d->ccr >> 16, CCR2, c->dma_ch); 317 c->plat->dma_write(d->ccr >> 16, CCR2, c->dma_ch);
313 318
314 if (d->dir == DMA_DEV_TO_MEM) { 319 if (d->dir == DMA_DEV_TO_MEM) {
315 c->plat->dma_write(d->dev_addr, CSSA, c->dma_ch); 320 cxsa = CSSA;
316 c->plat->dma_write(0, CSEI, c->dma_ch); 321 cxei = CSEI;
317 c->plat->dma_write(d->fi, CSFI, c->dma_ch); 322 cxfi = CSFI;
318 } else { 323 } else {
319 c->plat->dma_write(d->dev_addr, CDSA, c->dma_ch); 324 cxsa = CDSA;
320 c->plat->dma_write(0, CDEI, c->dma_ch); 325 cxei = CDEI;
321 c->plat->dma_write(d->fi, CDFI, c->dma_ch); 326 cxfi = CDFI;
322 } 327 }
323 328
329 c->plat->dma_write(d->dev_addr, cxsa, c->dma_ch);
330 c->plat->dma_write(0, cxei, c->dma_ch);
331 c->plat->dma_write(d->fi, cxfi, c->dma_ch);
324 c->plat->dma_write(d->csdp, CSDP, c->dma_ch); 332 c->plat->dma_write(d->csdp, CSDP, c->dma_ch);
325 333
326 omap_dma_start_sg(c, d, 0); 334 omap_dma_start_sg(c, d, 0);