All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@infradead.org>
To: Dan Williams <dan.j.williams@intel.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: vinod.koul@intel.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] dmaengine: add helper function for slave_single
Date: Mon, 25 Jul 2011 21:07:15 +0530	[thread overview]
Message-ID: <1311608235.8206.24.camel@vkoul-mobl4> (raw)

>From af9afd16e9954edb45f0cf71834653133d75e79c Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Mon, 25 Jul 2011 19:57:52 +0530
Subject: [PATCH] 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 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.


WARNING: multiple messages have this Message-ID (diff)
From: vkoul@infradead.org (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: add helper function for slave_single
Date: Mon, 25 Jul 2011 21:07:15 +0530	[thread overview]
Message-ID: <1311608235.8206.24.camel@vkoul-mobl4> (raw)



             reply	other threads:[~2011-07-25 15:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 15:37 Vinod Koul [this message]
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-07-25 15:47   ` Russell King - ARM Linux
2011-08-04  4:27   ` Koul, Vinod
2011-08-04  4:27     ` Koul, Vinod
  -- strict thread matches above, loose matches on Subject: below --
2011-07-25 14:27 Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311608235.8206.24.camel@vkoul-mobl4 \
    --to=vkoul@infradead.org \
    --cc=dan.j.williams@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.