diff options
-rw-r--r-- | drivers/dma/amba-pl08x.c | 21 | ||||
-rw-r--r-- | include/linux/amba/pl08x.h | 3 |
2 files changed, 8 insertions, 16 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index f0a29885cb83..6d224d41be2d 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -577,7 +577,6 @@ static inline size_t pl08x_pre_boundary(u32 addr, size_t len) | |||
577 | static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | 577 | static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, |
578 | struct pl08x_txd *txd) | 578 | struct pl08x_txd *txd) |
579 | { | 579 | { |
580 | struct pl08x_channel_data *cd = txd->cd; | ||
581 | struct pl08x_bus_data *mbus, *sbus; | 580 | struct pl08x_bus_data *mbus, *sbus; |
582 | size_t remainder; | 581 | size_t remainder; |
583 | int num_llis = 0; | 582 | int num_llis = 0; |
@@ -595,17 +594,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
595 | 594 | ||
596 | pl08x->pool_ctr++; | 595 | pl08x->pool_ctr++; |
597 | 596 | ||
598 | /* | 597 | /* Get the default CCTL */ |
599 | * Initialize bus values for this transfer | 598 | cctl = txd->cctl; |
600 | * from the passed optimal values | ||
601 | */ | ||
602 | if (!cd) { | ||
603 | dev_err(&pl08x->adev->dev, "%s no channel data\n", __func__); | ||
604 | return 0; | ||
605 | } | ||
606 | |||
607 | /* Get the default CCTL from the platform data */ | ||
608 | cctl = cd->cctl; | ||
609 | 599 | ||
610 | /* | 600 | /* |
611 | * On the PL080 we have two bus masters and we | 601 | * On the PL080 we have two bus masters and we |
@@ -1358,11 +1348,11 @@ static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy( | |||
1358 | txd->dstbus.addr = dest; | 1348 | txd->dstbus.addr = dest; |
1359 | 1349 | ||
1360 | /* Set platform data for m2m */ | 1350 | /* Set platform data for m2m */ |
1361 | txd->cd = &pl08x->pd->memcpy_channel; | ||
1362 | txd->ccfg |= PL080_FLOW_MEM2MEM << PL080_CONFIG_FLOW_CONTROL_SHIFT; | 1351 | txd->ccfg |= PL080_FLOW_MEM2MEM << PL080_CONFIG_FLOW_CONTROL_SHIFT; |
1352 | txd->cctl = pl08x->pd->memcpy_channel.cctl; | ||
1363 | 1353 | ||
1364 | /* Both to be incremented or the code will break */ | 1354 | /* Both to be incremented or the code will break */ |
1365 | txd->cd->cctl |= PL080_CONTROL_SRC_INCR | PL080_CONTROL_DST_INCR; | 1355 | txd->cctl |= PL080_CONTROL_SRC_INCR | PL080_CONTROL_DST_INCR; |
1366 | txd->len = len; | 1356 | txd->len = len; |
1367 | 1357 | ||
1368 | ret = pl08x_prep_channel_resources(plchan, txd); | 1358 | ret = pl08x_prep_channel_resources(plchan, txd); |
@@ -1415,6 +1405,8 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg( | |||
1415 | * channel target address dynamically at runtime. | 1405 | * channel target address dynamically at runtime. |
1416 | */ | 1406 | */ |
1417 | txd->direction = direction; | 1407 | txd->direction = direction; |
1408 | txd->cctl = plchan->cd->cctl; | ||
1409 | |||
1418 | if (direction == DMA_TO_DEVICE) { | 1410 | if (direction == DMA_TO_DEVICE) { |
1419 | txd->ccfg |= PL080_FLOW_MEM2PER << PL080_CONFIG_FLOW_CONTROL_SHIFT; | 1411 | txd->ccfg |= PL080_FLOW_MEM2PER << PL080_CONFIG_FLOW_CONTROL_SHIFT; |
1420 | txd->srcbus.addr = sgl->dma_address; | 1412 | txd->srcbus.addr = sgl->dma_address; |
@@ -1434,7 +1426,6 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg( | |||
1434 | "%s direction unsupported\n", __func__); | 1426 | "%s direction unsupported\n", __func__); |
1435 | return NULL; | 1427 | return NULL; |
1436 | } | 1428 | } |
1437 | txd->cd = plchan->cd; | ||
1438 | txd->len = sgl->length; | 1429 | txd->len = sgl->length; |
1439 | 1430 | ||
1440 | ret = pl08x_prep_channel_resources(plchan, txd); | 1431 | ret = pl08x_prep_channel_resources(plchan, txd); |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 8e74cb1845dd..8d9083067d3d 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -110,8 +110,9 @@ struct pl08x_txd { | |||
110 | size_t len; | 110 | size_t len; |
111 | dma_addr_t llis_bus; | 111 | dma_addr_t llis_bus; |
112 | void *llis_va; | 112 | void *llis_va; |
113 | struct pl08x_channel_data *cd; | ||
114 | bool active; | 113 | bool active; |
114 | /* Default cctl value for LLIs */ | ||
115 | u32 cctl; | ||
115 | /* | 116 | /* |
116 | * Settings to be put into the physical channel when we | 117 | * Settings to be put into the physical channel when we |
117 | * trigger this txd. Other registers are in llis_va[0]. | 118 | * trigger this txd. Other registers are in llis_va[0]. |