aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2018-10-25 10:26:07 -0400
committerVinod Koul <vkoul@kernel.org>2018-11-24 09:52:21 -0500
commit445897cbc9d3e2bcae8a1b3bcf80f69b699eafda (patch)
tree572b835dd4aecb8e78cad5c1534d27e58ec9b3dc
parent107d06441b709d31ce592535086992799ee51e17 (diff)
dmaengine: pl330: remove dma_slave_config direction usage
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/pl330.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 88750a34e859..cff1b143fff5 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -448,6 +448,7 @@ struct dma_pl330_chan {
448 /* DMA-mapped view of the FIFO; may differ if an IOMMU is present */ 448 /* DMA-mapped view of the FIFO; may differ if an IOMMU is present */
449 dma_addr_t fifo_dma; 449 dma_addr_t fifo_dma;
450 enum dma_data_direction dir; 450 enum dma_data_direction dir;
451 struct dma_slave_config slave_config;
451 452
452 /* for cyclic capability */ 453 /* for cyclic capability */
453 bool cyclic; 454 bool cyclic;
@@ -542,6 +543,10 @@ struct _xfer_spec {
542 struct dma_pl330_desc *desc; 543 struct dma_pl330_desc *desc;
543}; 544};
544 545
546static int pl330_config_write(struct dma_chan *chan,
547 struct dma_slave_config *slave_config,
548 enum dma_transfer_direction direction);
549
545static inline bool _queue_full(struct pl330_thread *thrd) 550static inline bool _queue_full(struct pl330_thread *thrd)
546{ 551{
547 return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL; 552 return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL;
@@ -2220,20 +2225,21 @@ static int fixup_burst_len(int max_burst_len, int quirks)
2220 return max_burst_len; 2225 return max_burst_len;
2221} 2226}
2222 2227
2223static int pl330_config(struct dma_chan *chan, 2228static int pl330_config_write(struct dma_chan *chan,
2224 struct dma_slave_config *slave_config) 2229 struct dma_slave_config *slave_config,
2230 enum dma_transfer_direction direction)
2225{ 2231{
2226 struct dma_pl330_chan *pch = to_pchan(chan); 2232 struct dma_pl330_chan *pch = to_pchan(chan);
2227 2233
2228 pl330_unprep_slave_fifo(pch); 2234 pl330_unprep_slave_fifo(pch);
2229 if (slave_config->direction == DMA_MEM_TO_DEV) { 2235 if (direction == DMA_MEM_TO_DEV) {
2230 if (slave_config->dst_addr) 2236 if (slave_config->dst_addr)
2231 pch->fifo_addr = slave_config->dst_addr; 2237 pch->fifo_addr = slave_config->dst_addr;
2232 if (slave_config->dst_addr_width) 2238 if (slave_config->dst_addr_width)
2233 pch->burst_sz = __ffs(slave_config->dst_addr_width); 2239 pch->burst_sz = __ffs(slave_config->dst_addr_width);
2234 pch->burst_len = fixup_burst_len(slave_config->dst_maxburst, 2240 pch->burst_len = fixup_burst_len(slave_config->dst_maxburst,
2235 pch->dmac->quirks); 2241 pch->dmac->quirks);
2236 } else if (slave_config->direction == DMA_DEV_TO_MEM) { 2242 } else if (direction == DMA_DEV_TO_MEM) {
2237 if (slave_config->src_addr) 2243 if (slave_config->src_addr)
2238 pch->fifo_addr = slave_config->src_addr; 2244 pch->fifo_addr = slave_config->src_addr;
2239 if (slave_config->src_addr_width) 2245 if (slave_config->src_addr_width)
@@ -2245,6 +2251,16 @@ static int pl330_config(struct dma_chan *chan,
2245 return 0; 2251 return 0;
2246} 2252}
2247 2253
2254static int pl330_config(struct dma_chan *chan,
2255 struct dma_slave_config *slave_config)
2256{
2257 struct dma_pl330_chan *pch = to_pchan(chan);
2258
2259 memcpy(&pch->slave_config, slave_config, sizeof(*slave_config));
2260
2261 return 0;
2262}
2263
2248static int pl330_terminate_all(struct dma_chan *chan) 2264static int pl330_terminate_all(struct dma_chan *chan)
2249{ 2265{
2250 struct dma_pl330_chan *pch = to_pchan(chan); 2266 struct dma_pl330_chan *pch = to_pchan(chan);
@@ -2661,6 +2677,8 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
2661 return NULL; 2677 return NULL;
2662 } 2678 }
2663 2679
2680 pl330_config_write(chan, &pch->slave_config, direction);
2681
2664 if (!pl330_prep_slave_fifo(pch, direction)) 2682 if (!pl330_prep_slave_fifo(pch, direction))
2665 return NULL; 2683 return NULL;
2666 2684
@@ -2815,6 +2833,8 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
2815 if (unlikely(!pch || !sgl || !sg_len)) 2833 if (unlikely(!pch || !sgl || !sg_len))
2816 return NULL; 2834 return NULL;
2817 2835
2836 pl330_config_write(chan, &pch->slave_config, direction);
2837
2818 if (!pl330_prep_slave_fifo(pch, direction)) 2838 if (!pl330_prep_slave_fifo(pch, direction))
2819 return NULL; 2839 return NULL;
2820 2840