aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2018-07-19 12:52:26 -0400
committerVinod Koul <vkoul@kernel.org>2018-10-07 09:50:14 -0400
commit09347e3f26a56bd5abe931251547aac8d80f0e7e (patch)
tree670cb785b00eea43e6a7ba9c161391e806ef7e14
parent80ade4beb7330f4c6c855619d21062190303a5a3 (diff)
dmaengine: jz4740: 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/dma-jz4740.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c
index afd5e10f8927..5253e3c0dc04 100644
--- a/drivers/dma/dma-jz4740.c
+++ b/drivers/dma/dma-jz4740.c
@@ -113,6 +113,7 @@ struct jz4740_dma_desc {
113struct jz4740_dmaengine_chan { 113struct jz4740_dmaengine_chan {
114 struct virt_dma_chan vchan; 114 struct virt_dma_chan vchan;
115 unsigned int id; 115 unsigned int id;
116 struct dma_slave_config config;
116 117
117 dma_addr_t fifo_addr; 118 dma_addr_t fifo_addr;
118 unsigned int transfer_shift; 119 unsigned int transfer_shift;
@@ -203,8 +204,9 @@ static enum jz4740_dma_transfer_size jz4740_dma_maxburst(u32 maxburst)
203 return JZ4740_DMA_TRANSFER_SIZE_32BYTE; 204 return JZ4740_DMA_TRANSFER_SIZE_32BYTE;
204} 205}
205 206
206static int jz4740_dma_slave_config(struct dma_chan *c, 207static int jz4740_dma_slave_config_write(struct dma_chan *c,
207 struct dma_slave_config *config) 208 struct dma_slave_config *config,
209 enum dma_transfer_direction direction)
208{ 210{
209 struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c); 211 struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
210 struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan); 212 struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan);
@@ -214,7 +216,7 @@ static int jz4740_dma_slave_config(struct dma_chan *c,
214 enum jz4740_dma_flags flags; 216 enum jz4740_dma_flags flags;
215 uint32_t cmd; 217 uint32_t cmd;
216 218
217 switch (config->direction) { 219 switch (direction) {
218 case DMA_MEM_TO_DEV: 220 case DMA_MEM_TO_DEV:
219 flags = JZ4740_DMA_SRC_AUTOINC; 221 flags = JZ4740_DMA_SRC_AUTOINC;
220 transfer_size = jz4740_dma_maxburst(config->dst_maxburst); 222 transfer_size = jz4740_dma_maxburst(config->dst_maxburst);
@@ -265,6 +267,15 @@ static int jz4740_dma_slave_config(struct dma_chan *c,
265 return 0; 267 return 0;
266} 268}
267 269
270static int jz4740_dma_slave_config(struct dma_chan *c,
271 struct dma_slave_config *config)
272{
273 struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
274
275 memcpy(&chan->config, config, sizeof(*config));
276 return 0;
277}
278
268static int jz4740_dma_terminate_all(struct dma_chan *c) 279static int jz4740_dma_terminate_all(struct dma_chan *c)
269{ 280{
270 struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c); 281 struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
@@ -407,6 +418,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_slave_sg(
407 desc->direction = direction; 418 desc->direction = direction;
408 desc->cyclic = false; 419 desc->cyclic = false;
409 420
421 jz4740_dma_slave_config_write(c, &chan->config, direction);
422
410 return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); 423 return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
411} 424}
412 425
@@ -438,6 +451,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_dma_cyclic(
438 desc->direction = direction; 451 desc->direction = direction;
439 desc->cyclic = true; 452 desc->cyclic = true;
440 453
454 jz4740_dma_slave_config_write(c, &chan->config, direction);
455
441 return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); 456 return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
442} 457}
443 458