linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: add helper function for slave_single
@ 2011-07-25 15:37 Vinod Koul
  2011-07-25 15:47 ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2011-07-25 15:37 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] dmaengine: add helper function for slave_single
@ 2011-07-25 14:27 Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2011-07-25 14:27 UTC (permalink / raw)
  To: linux-arm-kernel

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 Russel King

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/linux/dmaengine.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index eee7add..97dafc6 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -517,6 +517,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);
-- 
1.7.0.4




-- 
~Vinod Koul
Intel Corp.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-04  4:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 15:37 [PATCH] dmaengine: add helper function for slave_single Vinod Koul
2011-07-25 15:47 ` Russell King - ARM Linux
2011-08-04  4:27   ` Koul, Vinod
  -- strict thread matches above, loose matches on Subject: below --
2011-07-25 14:27 Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).