summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2011-07-25 19:57:52 +0530
committerHuang Shijie <b32955@freescale.com>2012-01-31 14:27:55 +0800
commit23bed73ea778bd26126651fcefd23cd9fdf33d95 (patch)
treec63f7525bfe9285f8b30b62ea7ff02f59eaf24ae /include
parentb26010288d78150c305f8342004478b8500cd88d (diff)
dmaengine: add helper function for slave_single
For clients which require a single slave transfer and dont want to be bothered about the scatterlist api, this helper gives simple API for this transfer and creates single scatterlist for DMA API Idea from Russell King Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dmaengine.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 8fbf40e0713c..0d738c95fe4e 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -24,6 +24,7 @@
#include <linux/device.h>
#include <linux/uio.h>
#include <linux/dma-direction.h>
+#include <linux/scatterlist.h>
struct scatterlist;
@@ -519,6 +520,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
(unsigned long)config);
}
+static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
+ struct dma_chan *chan, void *buf, size_t len,
+ enum dma_data_direction dir, unsigned long flags)
+{
+ struct scatterlist sg;
+ sg_init_one(&sg, buf, len);
+
+ return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
+}
+
static inline int dmaengine_terminate_all(struct dma_chan *chan)
{
return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);