aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/dw_dmac.c6
-rw-r--r--include/linux/dw_dmac.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 6ab440e532b..f413e123405 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1319,7 +1319,11 @@ static int __init dw_probe(struct platform_device *pdev)
1319 dwc->chan.device = &dw->dma; 1319 dwc->chan.device = &dw->dma;
1320 dwc->chan.cookie = dwc->completed = 1; 1320 dwc->chan.cookie = dwc->completed = 1;
1321 dwc->chan.chan_id = i; 1321 dwc->chan.chan_id = i;
1322 list_add_tail(&dwc->chan.device_node, &dw->dma.channels); 1322 if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING)
1323 list_add_tail(&dwc->chan.device_node,
1324 &dw->dma.channels);
1325 else
1326 list_add(&dwc->chan.device_node, &dw->dma.channels);
1323 1327
1324 dwc->ch_regs = &__dw_regs(dw)->CHAN[i]; 1328 dwc->ch_regs = &__dw_regs(dw)->CHAN[i];
1325 spin_lock_init(&dwc->lock); 1329 spin_lock_init(&dwc->lock);
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index deec66b3718..a18c498984d 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -22,6 +22,9 @@
22struct dw_dma_platform_data { 22struct dw_dma_platform_data {
23 unsigned int nr_channels; 23 unsigned int nr_channels;
24 bool is_private; 24 bool is_private;
25#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
26#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
27 unsigned char chan_allocation_order;
25}; 28};
26 29
27/** 30/**