Skip to content

Commit

Permalink
dmaengine: jz4740: remove dma_slave_config direction usage
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vinodkoul committed Oct 7, 2018
1 parent 80ade4b commit 09347e3
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions drivers/dma/dma-jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ struct jz4740_dma_desc {
struct jz4740_dmaengine_chan {
struct virt_dma_chan vchan;
unsigned int id;
struct dma_slave_config config;

dma_addr_t fifo_addr;
unsigned int transfer_shift;
Expand Down Expand Up @@ -203,8 +204,9 @@ static enum jz4740_dma_transfer_size jz4740_dma_maxburst(u32 maxburst)
return JZ4740_DMA_TRANSFER_SIZE_32BYTE;
}

static int jz4740_dma_slave_config(struct dma_chan *c,
struct dma_slave_config *config)
static int jz4740_dma_slave_config_write(struct dma_chan *c,
struct dma_slave_config *config,
enum dma_transfer_direction direction)
{
struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan);
Expand All @@ -214,7 +216,7 @@ static int jz4740_dma_slave_config(struct dma_chan *c,
enum jz4740_dma_flags flags;
uint32_t cmd;

switch (config->direction) {
switch (direction) {
case DMA_MEM_TO_DEV:
flags = JZ4740_DMA_SRC_AUTOINC;
transfer_size = jz4740_dma_maxburst(config->dst_maxburst);
Expand Down Expand Up @@ -265,6 +267,15 @@ static int jz4740_dma_slave_config(struct dma_chan *c,
return 0;
}

static int jz4740_dma_slave_config(struct dma_chan *c,
struct dma_slave_config *config)
{
struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);

memcpy(&chan->config, config, sizeof(*config));
return 0;
}

static int jz4740_dma_terminate_all(struct dma_chan *c)
{
struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
Expand Down Expand Up @@ -407,6 +418,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_slave_sg(
desc->direction = direction;
desc->cyclic = false;

jz4740_dma_slave_config_write(c, &chan->config, direction);

return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
}

Expand Down Expand Up @@ -438,6 +451,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_dma_cyclic(
desc->direction = direction;
desc->cyclic = true;

jz4740_dma_slave_config_write(c, &chan->config, direction);

return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
}

Expand Down

0 comments on commit 09347e3

Please sign in to comment.