Commit ceeeb99c authored by Sascha Hauer's avatar Sascha Hauer Committed by Miquel Raynal

dmaengine: mxs: rename custom flag

The mxs dma driver uses the flags parameter in dmaengine_prep_slave_sg() for
custom flags, but still uses the dmaengine specific names of the flags.
Do a little bit better and at least give the flag a custom name.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent e0ddaab7
...@@ -541,7 +541,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg( ...@@ -541,7 +541,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
ccw->bits = 0; ccw->bits = 0;
ccw->bits |= CCW_IRQ; ccw->bits |= CCW_IRQ;
ccw->bits |= CCW_DEC_SEM; ccw->bits |= CCW_DEC_SEM;
if (flags & DMA_CTRL_ACK) if (flags & MXS_DMA_CTRL_WAIT4END)
ccw->bits |= CCW_WAIT4END; ccw->bits |= CCW_WAIT4END;
ccw->bits |= CCW_HALT_ON_TERM; ccw->bits |= CCW_HALT_ON_TERM;
ccw->bits |= CCW_TERM_FLUSH; ccw->bits |= CCW_TERM_FLUSH;
...@@ -573,7 +573,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg( ...@@ -573,7 +573,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
ccw->bits &= ~CCW_CHAIN; ccw->bits &= ~CCW_CHAIN;
ccw->bits |= CCW_IRQ; ccw->bits |= CCW_IRQ;
ccw->bits |= CCW_DEC_SEM; ccw->bits |= CCW_DEC_SEM;
if (flags & DMA_CTRL_ACK) if (flags & MXS_DMA_CTRL_WAIT4END)
ccw->bits |= CCW_WAIT4END; ccw->bits |= CCW_WAIT4END;
} }
} }
......
...@@ -926,7 +926,8 @@ static int gpmi_send_command(struct gpmi_nand_data *this) ...@@ -926,7 +926,8 @@ static int gpmi_send_command(struct gpmi_nand_data *this)
sg_init_one(sgl, this->cmd_buffer, this->command_length); sg_init_one(sgl, this->cmd_buffer, this->command_length);
dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE);
desc = dmaengine_prep_slave_sg(channel, desc = dmaengine_prep_slave_sg(channel,
sgl, 1, DMA_MEM_TO_DEV, DMA_CTRL_ACK); sgl, 1, DMA_MEM_TO_DEV,
MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
...@@ -996,7 +997,8 @@ static int gpmi_send_data(struct gpmi_nand_data *this, const void *buf, int len) ...@@ -996,7 +997,8 @@ static int gpmi_send_data(struct gpmi_nand_data *this, const void *buf, int len)
/* [2] send DMA request */ /* [2] send DMA request */
prepare_data_dma(this, buf, len, DMA_TO_DEVICE); prepare_data_dma(this, buf, len, DMA_TO_DEVICE);
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
1, DMA_MEM_TO_DEV, DMA_CTRL_ACK); 1, DMA_MEM_TO_DEV,
MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
...@@ -1033,7 +1035,8 @@ static int gpmi_read_data(struct gpmi_nand_data *this, void *buf, int len) ...@@ -1033,7 +1035,8 @@ static int gpmi_read_data(struct gpmi_nand_data *this, void *buf, int len)
/* [2] : send DMA request */ /* [2] : send DMA request */
direct = prepare_data_dma(this, buf, len, DMA_FROM_DEVICE); direct = prepare_data_dma(this, buf, len, DMA_FROM_DEVICE);
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
1, DMA_DEV_TO_MEM, DMA_CTRL_ACK); 1, DMA_DEV_TO_MEM,
MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
...@@ -1083,7 +1086,8 @@ static int gpmi_send_page(struct gpmi_nand_data *this, dma_addr_t payload, ...@@ -1083,7 +1086,8 @@ static int gpmi_send_page(struct gpmi_nand_data *this, dma_addr_t payload,
pio[5] = auxiliary; pio[5] = auxiliary;
desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio), desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio),
DMA_TRANS_NONE, DMA_CTRL_ACK); DMA_TRANS_NONE,
MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
...@@ -1140,7 +1144,8 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload, ...@@ -1140,7 +1144,8 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload,
pio[4] = payload; pio[4] = payload;
pio[5] = auxiliary; pio[5] = auxiliary;
desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio), desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio),
DMA_TRANS_NONE, DMA_CTRL_ACK); DMA_TRANS_NONE,
MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
...@@ -1157,7 +1162,7 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload, ...@@ -1157,7 +1162,7 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload,
pio[1] = 0; pio[1] = 0;
pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */ pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */
desc = mxs_dmaengine_prep_pio(channel, pio, 3, DMA_TRANS_NONE, desc = mxs_dmaengine_prep_pio(channel, pio, 3, DMA_TRANS_NONE,
DMA_CTRL_ACK); MXS_DMA_CTRL_WAIT4END);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <linux/dmaengine.h> #include <linux/dmaengine.h>
#define MXS_DMA_CTRL_WAIT4END BIT(31)
/* /*
* The mxs dmaengine can do PIO transfers. We pass a pointer to the PIO words * The mxs dmaengine can do PIO transfers. We pass a pointer to the PIO words
* in the second argument to dmaengine_prep_slave_sg when the direction is * in the second argument to dmaengine_prep_slave_sg when the direction is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment