|
@@ -62,6 +62,7 @@
|
|
|
#include <linux/rculist.h>
|
|
|
#include <linux/idr.h>
|
|
|
#include <linux/slab.h>
|
|
|
+#include <linux/of_dma.h>
|
|
|
|
|
|
static DEFINE_MUTEX(dma_list_mutex);
|
|
|
static DEFINE_IDR(dma_idr);
|
|
@@ -546,6 +547,21 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(__dma_request_channel);
|
|
|
|
|
|
+/**
|
|
|
+ * dma_request_slave_channel - try to allocate an exclusive slave channel
|
|
|
+ * @dev: pointer to client device structure
|
|
|
+ * @name: slave channel name
|
|
|
+ */
|
|
|
+struct dma_chan *dma_request_slave_channel(struct device *dev, char *name)
|
|
|
+{
|
|
|
+ /* If device-tree is present get slave info from here */
|
|
|
+ if (dev->of_node)
|
|
|
+ return of_dma_request_slave_channel(dev->of_node, name);
|
|
|
+
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(dma_request_slave_channel);
|
|
|
+
|
|
|
void dma_release_channel(struct dma_chan *chan)
|
|
|
{
|
|
|
mutex_lock(&dma_list_mutex);
|