summaryrefslogtreecommitdiffstats
path: root/arch/arm/common/edma.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-08-19 11:57:23 -0700
committerBrian Norris <computersforpeace@gmail.com>2014-08-19 11:57:23 -0700
commit5b49ab3e03f68eb49db4bce6290e5707b7f6c6f3 (patch)
tree090c7c069bc6c0f2b368ed8d0af861c275525411 /arch/arm/common/edma.c
parentb25046b1e5e3f1423434da77ccc859f2f779d1ce (diff)
parent54ea17a597b00e46b3720e75dd7595cd5dfa5670 (diff)
downloadlinux-stable-5b49ab3e03f68eb49db4bce6290e5707b7f6c6f3.tar.gz
linux-stable-5b49ab3e03f68eb49db4bce6290e5707b7f6c6f3.tar.bz2
linux-stable-5b49ab3e03f68eb49db4bce6290e5707b7f6c6f3.zip
Merge l2-mtd/next into l2-mtd/master
Diffstat (limited to 'arch/arm/common/edma.c')
-rw-r--r--arch/arm/common/edma.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 485be42519b9..88099175fc56 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1414,6 +1414,34 @@ void edma_clear_event(unsigned channel)
}
EXPORT_SYMBOL(edma_clear_event);
+/*
+ * edma_assign_channel_eventq - move given channel to desired eventq
+ * Arguments:
+ * channel - channel number
+ * eventq_no - queue to move the channel
+ *
+ * Can be used to move a channel to a selected event queue.
+ */
+void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
+{
+ unsigned ctlr;
+
+ ctlr = EDMA_CTLR(channel);
+ channel = EDMA_CHAN_SLOT(channel);
+
+ if (channel >= edma_cc[ctlr]->num_channels)
+ return;
+
+ /* default to low priority queue */
+ if (eventq_no == EVENTQ_DEFAULT)
+ eventq_no = edma_cc[ctlr]->default_queue;
+ if (eventq_no >= edma_cc[ctlr]->num_tc)
+ return;
+
+ map_dmach_queue(ctlr, channel, eventq_no);
+}
+EXPORT_SYMBOL(edma_assign_channel_eventq);
+
static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
struct edma *edma_cc)
{
@@ -1470,7 +1498,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
queue_priority_map[i][1] = -1;
pdata->queue_priority_mapping = queue_priority_map;
- pdata->default_queue = 0;
+ /* Default queue has the lowest priority */
+ pdata->default_queue = i - 1;
return 0;
}