diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2011-03-03 15:47:21 +0530 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2011-03-07 01:12:28 +0530 |
commit | b0c3130d69bda5cd91aa3b3f08e7878df49fde69 (patch) | |
tree | a75091d3489cc2db2a806cd30d0ef6f80419e86d | |
parent | e518076ef8cb56adb558ff56ad5bfa0cd9f3abd9 (diff) | |
download | op-kernel-dev-b0c3130d69bda5cd91aa3b3f08e7878df49fde69.zip op-kernel-dev-b0c3130d69bda5cd91aa3b3f08e7878df49fde69.tar.gz |
dw_dmac: Pass Channel Allocation Order from platform_data
In SPEAr Platform channels 4-7 have more Fifo depth. So we must get better
channel first. This patch introduces concept of channel allocation order in
dw_dmac. If user doesn't pass anything or 0, than normal (ascending) channel
allocation will follow, else channels will be allocated in descending order.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/dw_dmac.c | 6 | ||||
-rw-r--r-- | include/linux/dw_dmac.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 6ab440e..f413e12 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) dwc->chan.device = &dw->dma; dwc->chan.cookie = dwc->completed = 1; dwc->chan.chan_id = i; - list_add_tail(&dwc->chan.device_node, &dw->dma.channels); + if (pdata->chan_allocation_order == CHAN_ALLOCATION_ASCENDING) + list_add_tail(&dwc->chan.device_node, + &dw->dma.channels); + else + list_add(&dwc->chan.device_node, &dw->dma.channels); dwc->ch_regs = &__dw_regs(dw)->CHAN[i]; spin_lock_init(&dwc->lock); diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index deec66b..a18c498 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h @@ -22,6 +22,9 @@ struct dw_dma_platform_data { unsigned int nr_channels; bool is_private; +#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */ +#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */ + unsigned char chan_allocation_order; }; /** |