aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index a815d44c70a4..242b8c0a3de8 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -62,6 +62,7 @@
62#include <linux/rculist.h> 62#include <linux/rculist.h>
63#include <linux/idr.h> 63#include <linux/idr.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/of_dma.h>
65 66
66static DEFINE_MUTEX(dma_list_mutex); 67static DEFINE_MUTEX(dma_list_mutex);
67static DEFINE_IDR(dma_idr); 68static DEFINE_IDR(dma_idr);
@@ -266,7 +267,10 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
266 pr_err("%s: timeout!\n", __func__); 267 pr_err("%s: timeout!\n", __func__);
267 return DMA_ERROR; 268 return DMA_ERROR;
268 } 269 }
269 } while (status == DMA_IN_PROGRESS); 270 if (status != DMA_IN_PROGRESS)
271 break;
272 cpu_relax();
273 } while (1);
270 274
271 return status; 275 return status;
272} 276}
@@ -546,6 +550,21 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
546} 550}
547EXPORT_SYMBOL_GPL(__dma_request_channel); 551EXPORT_SYMBOL_GPL(__dma_request_channel);
548 552
553/**
554 * dma_request_slave_channel - try to allocate an exclusive slave channel
555 * @dev: pointer to client device structure
556 * @name: slave channel name
557 */
558struct dma_chan *dma_request_slave_channel(struct device *dev, char *name)
559{
560 /* If device-tree is present get slave info from here */
561 if (dev->of_node)
562 return of_dma_request_slave_channel(dev->of_node, name);
563
564 return NULL;
565}
566EXPORT_SYMBOL_GPL(dma_request_slave_channel);
567
549void dma_release_channel(struct dma_chan *chan) 568void dma_release_channel(struct dma_chan *chan)
550{ 569{
551 mutex_lock(&dma_list_mutex); 570 mutex_lock(&dma_list_mutex);