aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/omap-dma.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-06 12:12:30 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-03 19:30:15 -0400
commit965aeb4df1f2142f5a6407c6d40b7196be719582 (patch)
treeaf2929e315bccfef7f94f56a8bc0c1b4f1eed23b /drivers/dma/omap-dma.c
parent893e63e301e37cd3be7afb55c95eb8ef6ead304b (diff)
dmaengine: omap-dma: move clnk_ctrl setting to preparation functions
Move the clnk_ctrl setup to the preparation functions, saving its value in the omap_desc. This only needs to be set once per descriptor, not for each segment, so set it in omap_dma_start_desc() rather than omap_dma_start(). 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/omap-dma.c')
-rw-r--r--drivers/dma/omap-dma.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 06727a78e883..49609275b2e7 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -59,6 +59,7 @@ struct omap_desc {
59 int16_t fi; /* for OMAP_DMA_SYNC_PACKET */ 59 int16_t fi; /* for OMAP_DMA_SYNC_PACKET */
60 uint8_t es; /* CSDP_DATA_TYPE_xxx */ 60 uint8_t es; /* CSDP_DATA_TYPE_xxx */
61 uint32_t ccr; /* CCR value */ 61 uint32_t ccr; /* CCR value */
62 uint16_t clnk_ctrl; /* CLNK_CTRL value */
62 uint16_t cicr; /* CICR value */ 63 uint16_t cicr; /* CICR value */
63 uint32_t csdp; /* CSDP value */ 64 uint32_t csdp; /* CSDP value */
64 65
@@ -187,18 +188,6 @@ static void omap_dma_start(struct omap_chan *c, struct omap_desc *d)
187 else 188 else
188 c->plat->dma_write(0, CDAC, c->dma_ch); 189 c->plat->dma_write(0, CDAC, c->dma_ch);
189 190
190 if (!__dma_omap15xx(od->plat->dma_attr) && c->cyclic) {
191 val = c->plat->dma_read(CLNK_CTRL, c->dma_ch);
192
193 if (dma_omap1())
194 val &= ~(1 << 14);
195
196 val |= c->dma_ch | CLNK_CTRL_ENABLE_LNK;
197
198 c->plat->dma_write(val, CLNK_CTRL, c->dma_ch);
199 } else if (od->plat->errata & DMA_ERRATA_PARALLEL_CHANNELS)
200 c->plat->dma_write(c->dma_ch, CLNK_CTRL, c->dma_ch);
201
202 omap_dma_clear_csr(c); 191 omap_dma_clear_csr(c);
203 192
204 /* Enable interrupts */ 193 /* Enable interrupts */
@@ -330,6 +319,7 @@ static void omap_dma_start_desc(struct omap_chan *c)
330 c->plat->dma_write(0, cxei, c->dma_ch); 319 c->plat->dma_write(0, cxei, c->dma_ch);
331 c->plat->dma_write(d->fi, cxfi, c->dma_ch); 320 c->plat->dma_write(d->fi, cxfi, c->dma_ch);
332 c->plat->dma_write(d->csdp, CSDP, c->dma_ch); 321 c->plat->dma_write(d->csdp, CSDP, c->dma_ch);
322 c->plat->dma_write(d->clnk_ctrl, CLNK_CTRL, c->dma_ch);
333 323
334 omap_dma_start_sg(c, d, 0); 324 omap_dma_start_sg(c, d, 0);
335} 325}
@@ -645,6 +635,8 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
645 } 635 }
646 if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING) 636 if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING)
647 d->ccr |= CCR_BUFFERING_DISABLE; 637 d->ccr |= CCR_BUFFERING_DISABLE;
638 if (od->plat->errata & DMA_ERRATA_PARALLEL_CHANNELS)
639 d->clnk_ctrl = c->dma_ch;
648 640
649 /* 641 /*
650 * Build our scatterlist entries: each contains the address, 642 * Build our scatterlist entries: each contains the address,
@@ -725,8 +717,6 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
725 d->sglen = 1; 717 d->sglen = 1;
726 718
727 d->ccr = 0; 719 d->ccr = 0;
728 if (__dma_omap15xx(od->plat->dma_attr))
729 d->ccr = CCR_AUTO_INIT | CCR_REPEAT;
730 if (dir == DMA_DEV_TO_MEM) 720 if (dir == DMA_DEV_TO_MEM)
731 d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_CONSTANT; 721 d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_CONSTANT;
732 else 722 else
@@ -772,6 +762,11 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
772 if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING) 762 if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING)
773 d->ccr |= CCR_BUFFERING_DISABLE; 763 d->ccr |= CCR_BUFFERING_DISABLE;
774 764
765 if (__dma_omap15xx(od->plat->dma_attr))
766 d->ccr |= CCR_AUTO_INIT | CCR_REPEAT;
767 else
768 d->clnk_ctrl = c->dma_ch | CLNK_CTRL_ENABLE_LNK;
769
775 c->cyclic = true; 770 c->cyclic = true;
776 771
777 return vchan_tx_prep(&c->vc, &d->vd, flags); 772 return vchan_tx_prep(&c->vc, &d->vd, flags);