Skip to content

Commit ceeeb99

Browse files
saschahauermiquelraynal
authored andcommitted
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: Sascha Hauer <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent e0ddaab commit ceeeb99

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

drivers/dma/mxs-dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
541541
ccw->bits = 0;
542542
ccw->bits |= CCW_IRQ;
543543
ccw->bits |= CCW_DEC_SEM;
544-
if (flags & DMA_CTRL_ACK)
544+
if (flags & MXS_DMA_CTRL_WAIT4END)
545545
ccw->bits |= CCW_WAIT4END;
546546
ccw->bits |= CCW_HALT_ON_TERM;
547547
ccw->bits |= CCW_TERM_FLUSH;
@@ -573,7 +573,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
573573
ccw->bits &= ~CCW_CHAIN;
574574
ccw->bits |= CCW_IRQ;
575575
ccw->bits |= CCW_DEC_SEM;
576-
if (flags & DMA_CTRL_ACK)
576+
if (flags & MXS_DMA_CTRL_WAIT4END)
577577
ccw->bits |= CCW_WAIT4END;
578578
}
579579
}

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,8 @@ static int gpmi_send_command(struct gpmi_nand_data *this)
926926
sg_init_one(sgl, this->cmd_buffer, this->command_length);
927927
dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE);
928928
desc = dmaengine_prep_slave_sg(channel,
929-
sgl, 1, DMA_MEM_TO_DEV, DMA_CTRL_ACK);
929+
sgl, 1, DMA_MEM_TO_DEV,
930+
MXS_DMA_CTRL_WAIT4END);
930931
if (!desc)
931932
return -EINVAL;
932933

@@ -996,7 +997,8 @@ static int gpmi_send_data(struct gpmi_nand_data *this, const void *buf, int len)
996997
/* [2] send DMA request */
997998
prepare_data_dma(this, buf, len, DMA_TO_DEVICE);
998999
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
999-
1, DMA_MEM_TO_DEV, DMA_CTRL_ACK);
1000+
1, DMA_MEM_TO_DEV,
1001+
MXS_DMA_CTRL_WAIT4END);
10001002
if (!desc)
10011003
return -EINVAL;
10021004

@@ -1033,7 +1035,8 @@ static int gpmi_read_data(struct gpmi_nand_data *this, void *buf, int len)
10331035
/* [2] : send DMA request */
10341036
direct = prepare_data_dma(this, buf, len, DMA_FROM_DEVICE);
10351037
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
1036-
1, DMA_DEV_TO_MEM, DMA_CTRL_ACK);
1038+
1, DMA_DEV_TO_MEM,
1039+
MXS_DMA_CTRL_WAIT4END);
10371040
if (!desc)
10381041
return -EINVAL;
10391042

@@ -1083,7 +1086,8 @@ static int gpmi_send_page(struct gpmi_nand_data *this, dma_addr_t payload,
10831086
pio[5] = auxiliary;
10841087

10851088
desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio),
1086-
DMA_TRANS_NONE, DMA_CTRL_ACK);
1089+
DMA_TRANS_NONE,
1090+
MXS_DMA_CTRL_WAIT4END);
10871091
if (!desc)
10881092
return -EINVAL;
10891093

@@ -1140,7 +1144,8 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload,
11401144
pio[4] = payload;
11411145
pio[5] = auxiliary;
11421146
desc = mxs_dmaengine_prep_pio(channel, pio, ARRAY_SIZE(pio),
1143-
DMA_TRANS_NONE, DMA_CTRL_ACK);
1147+
DMA_TRANS_NONE,
1148+
MXS_DMA_CTRL_WAIT4END);
11441149
if (!desc)
11451150
return -EINVAL;
11461151

@@ -1157,7 +1162,7 @@ static int gpmi_read_page(struct gpmi_nand_data *this, dma_addr_t payload,
11571162
pio[1] = 0;
11581163
pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */
11591164
desc = mxs_dmaengine_prep_pio(channel, pio, 3, DMA_TRANS_NONE,
1160-
DMA_CTRL_ACK);
1165+
MXS_DMA_CTRL_WAIT4END);
11611166
if (!desc)
11621167
return -EINVAL;
11631168

include/linux/dma/mxs-dma.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <linux/dmaengine.h>
66

7+
#define MXS_DMA_CTRL_WAIT4END BIT(31)
8+
79
/*
810
* The mxs dmaengine can do PIO transfers. We pass a pointer to the PIO words
911
* in the second argument to dmaengine_prep_slave_sg when the direction is

0 commit comments

Comments
 (0)