Skip to content

Commit e0d23ef

Browse files
author
Vinod Koul
committed
Merge branch 'dma_slave_direction' into next_test_dirn
resolved conflicts: drivers/media/video/mx3_camera.c
2 parents ca7fe2d + 55ba4e5 commit e0d23ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+253
-224
lines changed

arch/arm/mach-ep93xx/include/mach/dma.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
struct ep93xx_dma_data {
3939
int port;
40-
enum dma_data_direction direction;
40+
enum dma_transfer_direction direction;
4141
const char *name;
4242
};
4343

@@ -80,14 +80,14 @@ static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
8080
* channel supports given DMA direction. Only M2P channels have such
8181
* limitation, for M2M channels the direction is configurable.
8282
*/
83-
static inline enum dma_data_direction
83+
static inline enum dma_transfer_direction
8484
ep93xx_dma_chan_direction(struct dma_chan *chan)
8585
{
8686
if (!ep93xx_dma_chan_is_m2p(chan))
8787
return DMA_NONE;
8888

8989
/* even channels are for TX, odd for RX */
90-
return (chan->chan_id % 2 == 0) ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
90+
return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
9191
}
9292

9393
#endif /* __ASM_ARCH_DMA_H */

arch/arm/plat-nomadik/include/plat/ste_dma40.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static inline struct
187187
dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
188188
dma_addr_t addr,
189189
unsigned int size,
190-
enum dma_data_direction direction,
190+
enum dma_transfer_direction direction,
191191
unsigned long flags)
192192
{
193193
struct scatterlist sg;
@@ -209,7 +209,7 @@ static inline struct
209209
dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
210210
dma_addr_t addr,
211211
unsigned int size,
212-
enum dma_data_direction direction,
212+
enum dma_transfer_direction direction,
213213
unsigned long flags)
214214
{
215215
return NULL;

arch/arm/plat-samsung/dma-ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
3636

3737
chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
3838

39-
if (info->direction == DMA_FROM_DEVICE) {
39+
if (info->direction == DMA_DEV_TO_MEM) {
4040
memset(&slave_config, 0, sizeof(struct dma_slave_config));
4141
slave_config.direction = info->direction;
4242
slave_config.src_addr = info->fifo;
4343
slave_config.src_addr_width = info->width;
4444
slave_config.src_maxburst = 1;
4545
dmaengine_slave_config(chan, &slave_config);
46-
} else if (info->direction == DMA_TO_DEVICE) {
46+
} else if (info->direction == DMA_MEM_TO_DEV) {
4747
memset(&slave_config, 0, sizeof(struct dma_slave_config));
4848
slave_config.direction = info->direction;
4949
slave_config.dst_addr = info->fifo;

arch/arm/plat-samsung/include/plat/dma-ops.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
struct samsung_dma_prep_info {
1919
enum dma_transaction_type cap;
20-
enum dma_data_direction direction;
20+
enum dma_transfer_direction direction;
2121
dma_addr_t buf;
2222
unsigned long period;
2323
unsigned long len;
@@ -27,7 +27,7 @@ struct samsung_dma_prep_info {
2727

2828
struct samsung_dma_info {
2929
enum dma_transaction_type cap;
30-
enum dma_data_direction direction;
30+
enum dma_transfer_direction direction;
3131
enum dma_slave_buswidth width;
3232
dma_addr_t fifo;
3333
struct s3c2410_dma_client *client;

drivers/dma/amba-pl08x.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,9 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
882882
ch->signal = ret;
883883

884884
/* Assign the flow control signal to this channel */
885-
if (txd->direction == DMA_TO_DEVICE)
885+
if (txd->direction == DMA_MEM_TO_DEV)
886886
txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
887-
else if (txd->direction == DMA_FROM_DEVICE)
887+
else if (txd->direction == DMA_DEV_TO_MEM)
888888
txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
889889
}
890890

@@ -1102,10 +1102,10 @@ static int dma_set_runtime_config(struct dma_chan *chan,
11021102

11031103
/* Transfer direction */
11041104
plchan->runtime_direction = config->direction;
1105-
if (config->direction == DMA_TO_DEVICE) {
1105+
if (config->direction == DMA_MEM_TO_DEV) {
11061106
addr_width = config->dst_addr_width;
11071107
maxburst = config->dst_maxburst;
1108-
} else if (config->direction == DMA_FROM_DEVICE) {
1108+
} else if (config->direction == DMA_DEV_TO_MEM) {
11091109
addr_width = config->src_addr_width;
11101110
maxburst = config->src_maxburst;
11111111
} else {
@@ -1136,7 +1136,7 @@ static int dma_set_runtime_config(struct dma_chan *chan,
11361136
cctl |= burst << PL080_CONTROL_SB_SIZE_SHIFT;
11371137
cctl |= burst << PL080_CONTROL_DB_SIZE_SHIFT;
11381138

1139-
if (plchan->runtime_direction == DMA_FROM_DEVICE) {
1139+
if (plchan->runtime_direction == DMA_DEV_TO_MEM) {
11401140
plchan->src_addr = config->src_addr;
11411141
plchan->src_cctl = pl08x_cctl(cctl) | PL080_CONTROL_DST_INCR |
11421142
pl08x_select_bus(plchan->cd->periph_buses,
@@ -1152,7 +1152,7 @@ static int dma_set_runtime_config(struct dma_chan *chan,
11521152
"configured channel %s (%s) for %s, data width %d, "
11531153
"maxburst %d words, LE, CCTL=0x%08x\n",
11541154
dma_chan_name(chan), plchan->name,
1155-
(config->direction == DMA_FROM_DEVICE) ? "RX" : "TX",
1155+
(config->direction == DMA_DEV_TO_MEM) ? "RX" : "TX",
11561156
addr_width,
11571157
maxburst,
11581158
cctl);
@@ -1322,7 +1322,7 @@ static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy(
13221322

13231323
static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
13241324
struct dma_chan *chan, struct scatterlist *sgl,
1325-
unsigned int sg_len, enum dma_data_direction direction,
1325+
unsigned int sg_len, enum dma_transfer_direction direction,
13261326
unsigned long flags)
13271327
{
13281328
struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
@@ -1354,10 +1354,10 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
13541354
*/
13551355
txd->direction = direction;
13561356

1357-
if (direction == DMA_TO_DEVICE) {
1357+
if (direction == DMA_MEM_TO_DEV) {
13581358
txd->cctl = plchan->dst_cctl;
13591359
slave_addr = plchan->dst_addr;
1360-
} else if (direction == DMA_FROM_DEVICE) {
1360+
} else if (direction == DMA_DEV_TO_MEM) {
13611361
txd->cctl = plchan->src_cctl;
13621362
slave_addr = plchan->src_addr;
13631363
} else {
@@ -1368,10 +1368,10 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
13681368
}
13691369

13701370
if (plchan->cd->device_fc)
1371-
tmp = (direction == DMA_TO_DEVICE) ? PL080_FLOW_MEM2PER_PER :
1371+
tmp = (direction == DMA_MEM_TO_DEV) ? PL080_FLOW_MEM2PER_PER :
13721372
PL080_FLOW_PER2MEM_PER;
13731373
else
1374-
tmp = (direction == DMA_TO_DEVICE) ? PL080_FLOW_MEM2PER :
1374+
tmp = (direction == DMA_MEM_TO_DEV) ? PL080_FLOW_MEM2PER :
13751375
PL080_FLOW_PER2MEM;
13761376

13771377
txd->ccfg |= tmp << PL080_CONFIG_FLOW_CONTROL_SHIFT;
@@ -1387,7 +1387,7 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
13871387
list_add_tail(&dsg->node, &txd->dsg_list);
13881388

13891389
dsg->len = sg_dma_len(sg);
1390-
if (direction == DMA_TO_DEVICE) {
1390+
if (direction == DMA_MEM_TO_DEV) {
13911391
dsg->src_addr = sg_phys(sg);
13921392
dsg->dst_addr = slave_addr;
13931393
} else {

drivers/dma/at_hdmac.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
662662
*/
663663
static struct dma_async_tx_descriptor *
664664
atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
665-
unsigned int sg_len, enum dma_data_direction direction,
665+
unsigned int sg_len, enum dma_transfer_direction direction,
666666
unsigned long flags)
667667
{
668668
struct at_dma_chan *atchan = to_at_dma_chan(chan);
@@ -680,7 +680,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
680680

681681
dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n",
682682
sg_len,
683-
direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
683+
direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
684684
flags);
685685

686686
if (unlikely(!atslave || !sg_len)) {
@@ -694,7 +694,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
694694
ctrlb = ATC_IEN;
695695

696696
switch (direction) {
697-
case DMA_TO_DEVICE:
697+
case DMA_MEM_TO_DEV:
698698
ctrla |= ATC_DST_WIDTH(reg_width);
699699
ctrlb |= ATC_DST_ADDR_MODE_FIXED
700700
| ATC_SRC_ADDR_MODE_INCR
@@ -727,7 +727,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
727727
total_len += len;
728728
}
729729
break;
730-
case DMA_FROM_DEVICE:
730+
case DMA_DEV_TO_MEM:
731731
ctrla |= ATC_SRC_WIDTH(reg_width);
732732
ctrlb |= ATC_DST_ADDR_MODE_INCR
733733
| ATC_SRC_ADDR_MODE_FIXED
@@ -789,15 +789,15 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
789789
*/
790790
static int
791791
atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
792-
size_t period_len, enum dma_data_direction direction)
792+
size_t period_len, enum dma_transfer_direction direction)
793793
{
794794
if (period_len > (ATC_BTSIZE_MAX << reg_width))
795795
goto err_out;
796796
if (unlikely(period_len & ((1 << reg_width) - 1)))
797797
goto err_out;
798798
if (unlikely(buf_addr & ((1 << reg_width) - 1)))
799799
goto err_out;
800-
if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE))))
800+
if (unlikely(!(direction & (DMA_DEV_TO_MEM | DMA_MEM_TO_DEV))))
801801
goto err_out;
802802

803803
return 0;
@@ -812,7 +812,7 @@ atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
812812
static int
813813
atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
814814
unsigned int period_index, dma_addr_t buf_addr,
815-
size_t period_len, enum dma_data_direction direction)
815+
size_t period_len, enum dma_transfer_direction direction)
816816
{
817817
u32 ctrla;
818818
unsigned int reg_width = atslave->reg_width;
@@ -824,7 +824,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
824824
| period_len >> reg_width;
825825

826826
switch (direction) {
827-
case DMA_TO_DEVICE:
827+
case DMA_MEM_TO_DEV:
828828
desc->lli.saddr = buf_addr + (period_len * period_index);
829829
desc->lli.daddr = atslave->tx_reg;
830830
desc->lli.ctrla = ctrla;
@@ -835,7 +835,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
835835
| ATC_DIF(AT_DMA_PER_IF);
836836
break;
837837

838-
case DMA_FROM_DEVICE:
838+
case DMA_DEV_TO_MEM:
839839
desc->lli.saddr = atslave->rx_reg;
840840
desc->lli.daddr = buf_addr + (period_len * period_index);
841841
desc->lli.ctrla = ctrla;
@@ -863,7 +863,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
863863
*/
864864
static struct dma_async_tx_descriptor *
865865
atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
866-
size_t period_len, enum dma_data_direction direction)
866+
size_t period_len, enum dma_transfer_direction direction)
867867
{
868868
struct at_dma_chan *atchan = to_at_dma_chan(chan);
869869
struct at_dma_slave *atslave = chan->private;
@@ -874,7 +874,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
874874
unsigned int i;
875875

876876
dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n",
877-
direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
877+
direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
878878
buf_addr,
879879
periods, buf_len, period_len);
880880

drivers/dma/coh901318.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct coh901318_desc {
3939
struct scatterlist *sg;
4040
unsigned int sg_len;
4141
struct coh901318_lli *lli;
42-
enum dma_data_direction dir;
42+
enum dma_transfer_direction dir;
4343
unsigned long flags;
4444
u32 head_config;
4545
u32 head_ctrl;
@@ -1034,7 +1034,7 @@ coh901318_prep_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
10341034

10351035
static struct dma_async_tx_descriptor *
10361036
coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
1037-
unsigned int sg_len, enum dma_data_direction direction,
1037+
unsigned int sg_len, enum dma_transfer_direction direction,
10381038
unsigned long flags)
10391039
{
10401040
struct coh901318_chan *cohc = to_coh901318_chan(chan);
@@ -1077,15 +1077,15 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
10771077
ctrl_last |= cohc->runtime_ctrl;
10781078
ctrl |= cohc->runtime_ctrl;
10791079

1080-
if (direction == DMA_TO_DEVICE) {
1080+
if (direction == DMA_MEM_TO_DEV) {
10811081
u32 tx_flags = COH901318_CX_CTRL_PRDD_SOURCE |
10821082
COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE;
10831083

10841084
config |= COH901318_CX_CFG_RM_MEMORY_TO_PRIMARY;
10851085
ctrl_chained |= tx_flags;
10861086
ctrl_last |= tx_flags;
10871087
ctrl |= tx_flags;
1088-
} else if (direction == DMA_FROM_DEVICE) {
1088+
} else if (direction == DMA_DEV_TO_MEM) {
10891089
u32 rx_flags = COH901318_CX_CTRL_PRDD_DEST |
10901090
COH901318_CX_CTRL_DST_ADDR_INC_ENABLE;
10911091

@@ -1274,11 +1274,11 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan,
12741274
int i = 0;
12751275

12761276
/* We only support mem to per or per to mem transfers */
1277-
if (config->direction == DMA_FROM_DEVICE) {
1277+
if (config->direction == DMA_DEV_TO_MEM) {
12781278
addr = config->src_addr;
12791279
addr_width = config->src_addr_width;
12801280
maxburst = config->src_maxburst;
1281-
} else if (config->direction == DMA_TO_DEVICE) {
1281+
} else if (config->direction == DMA_MEM_TO_DEV) {
12821282
addr = config->dst_addr;
12831283
addr_width = config->dst_addr_width;
12841284
maxburst = config->dst_maxburst;

0 commit comments

Comments
 (0)