aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-07-21 12:12:27 -0400
committerVinod Koul <vinod.koul@intel.com>2011-07-26 06:03:28 -0400
commitb207b4d02beb06059478339bbe4672ba715605d6 (patch)
tree3f62c4e2854d4dce26c4ff3491f1d2d47b558c87 /drivers/dma/amba-pl08x.c
parentfc74eb791590e624ca6915ae76a04808e03bffb0 (diff)
DMA: PL08x: separately store source/destination slave address
Store the source/destination slave address separately into the channel structure. This moves us towards being able to avoid a configuration call each time we use the channel. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r--drivers/dma/amba-pl08x.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 1c641bfd1826..077ddeefb864 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1102,7 +1102,6 @@ static int dma_set_runtime_config(struct dma_chan *chan,
1102 struct pl08x_driver_data *pl08x = plchan->host; 1102 struct pl08x_driver_data *pl08x = plchan->host;
1103 struct pl08x_channel_data *cd = plchan->cd; 1103 struct pl08x_channel_data *cd = plchan->cd;
1104 enum dma_slave_buswidth addr_width; 1104 enum dma_slave_buswidth addr_width;
1105 dma_addr_t addr;
1106 u32 maxburst; 1105 u32 maxburst;
1107 u32 cctl = 0; 1106 u32 cctl = 0;
1108 int i; 1107 int i;
@@ -1113,11 +1112,9 @@ static int dma_set_runtime_config(struct dma_chan *chan,
1113 /* Transfer direction */ 1112 /* Transfer direction */
1114 plchan->runtime_direction = config->direction; 1113 plchan->runtime_direction = config->direction;
1115 if (config->direction == DMA_TO_DEVICE) { 1114 if (config->direction == DMA_TO_DEVICE) {
1116 addr = config->dst_addr;
1117 addr_width = config->dst_addr_width; 1115 addr_width = config->dst_addr_width;
1118 maxburst = config->dst_maxburst; 1116 maxburst = config->dst_maxburst;
1119 } else if (config->direction == DMA_FROM_DEVICE) { 1117 } else if (config->direction == DMA_FROM_DEVICE) {
1120 addr = config->src_addr;
1121 addr_width = config->src_addr_width; 1118 addr_width = config->src_addr_width;
1122 maxburst = config->src_maxburst; 1119 maxburst = config->src_maxburst;
1123 } else { 1120 } else {
@@ -1161,7 +1158,11 @@ static int dma_set_runtime_config(struct dma_chan *chan,
1161 cctl |= burst_sizes[i].reg; 1158 cctl |= burst_sizes[i].reg;
1162 } 1159 }
1163 1160
1164 plchan->runtime_addr = addr; 1161 if (plchan->runtime_direction == DMA_FROM_DEVICE) {
1162 plchan->src_addr = config->src_addr;
1163 } else {
1164 plchan->dst_addr = config->dst_addr;
1165 }
1165 1166
1166 /* Modify the default channel data to fit PrimeCell request */ 1167 /* Modify the default channel data to fit PrimeCell request */
1167 cd->cctl = cctl; 1168 cd->cctl = cctl;
@@ -1396,19 +1397,13 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
1396 txd->ccfg |= PL080_FLOW_MEM2PER << PL080_CONFIG_FLOW_CONTROL_SHIFT; 1397 txd->ccfg |= PL080_FLOW_MEM2PER << PL080_CONFIG_FLOW_CONTROL_SHIFT;
1397 txd->cctl |= PL080_CONTROL_SRC_INCR; 1398 txd->cctl |= PL080_CONTROL_SRC_INCR;
1398 txd->src_addr = sgl->dma_address; 1399 txd->src_addr = sgl->dma_address;
1399 if (plchan->runtime_addr) 1400 txd->dst_addr = plchan->dst_addr;
1400 txd->dst_addr = plchan->runtime_addr;
1401 else
1402 txd->dst_addr = plchan->cd->addr;
1403 src_buses = pl08x->mem_buses; 1401 src_buses = pl08x->mem_buses;
1404 dst_buses = plchan->cd->periph_buses; 1402 dst_buses = plchan->cd->periph_buses;
1405 } else if (direction == DMA_FROM_DEVICE) { 1403 } else if (direction == DMA_FROM_DEVICE) {
1406 txd->ccfg |= PL080_FLOW_PER2MEM << PL080_CONFIG_FLOW_CONTROL_SHIFT; 1404 txd->ccfg |= PL080_FLOW_PER2MEM << PL080_CONFIG_FLOW_CONTROL_SHIFT;
1407 txd->cctl |= PL080_CONTROL_DST_INCR; 1405 txd->cctl |= PL080_CONTROL_DST_INCR;
1408 if (plchan->runtime_addr) 1406 txd->src_addr = plchan->src_addr;
1409 txd->src_addr = plchan->runtime_addr;
1410 else
1411 txd->src_addr = plchan->cd->addr;
1412 txd->dst_addr = sgl->dma_address; 1407 txd->dst_addr = sgl->dma_address;
1413 src_buses = plchan->cd->periph_buses; 1408 src_buses = plchan->cd->periph_buses;
1414 dst_buses = pl08x->mem_buses; 1409 dst_buses = pl08x->mem_buses;
@@ -1704,6 +1699,8 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x,
1704 chan->slave = true; 1699 chan->slave = true;
1705 chan->name = pl08x->pd->slave_channels[i].bus_id; 1700 chan->name = pl08x->pd->slave_channels[i].bus_id;
1706 chan->cd = &pl08x->pd->slave_channels[i]; 1701 chan->cd = &pl08x->pd->slave_channels[i];
1702 chan->src_addr = chan->cd->addr;
1703 chan->dst_addr = chan->cd->addr;
1707 } else { 1704 } else {
1708 chan->cd = &pl08x->pd->memcpy_channel; 1705 chan->cd = &pl08x->pd->memcpy_channel;
1709 chan->name = kasprintf(GFP_KERNEL, "memcpy%d", i); 1706 chan->name = kasprintf(GFP_KERNEL, "memcpy%d", i);