linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter@ti.com>
To: Tony Lindgren <tony@atomide.com>, Sekhar Nori <nsekhar@ti.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Benoit Cousson <b-cousson@ti.com>,
	Russell King <linux@arm.linux.org.uk>,
	Vinod Koul <vinod.koul@intel.com>, Rob Landley <rob@landley.net>,
	Chris Ball <cjb@laptop.org>
Cc: Devicetree Discuss <devicetree-discuss@lists.ozlabs.org>,
	Linux OMAP List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
	Linux DaVinci Kernel List
	<davinci-linux-open-source@linux.davincidsp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Documentation List <linux-doc@vger.kernel.org>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	Linux SPI Devel List <spi-devel-general@lists.sourceforge.net>,
	Arnd Bergmann <arnd@arndb.de>, Dan Williams <djbw@fb.com>,
	Rob Herring <rob.herring@calxeda.com>
Subject: [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat()
Date: Wed, 30 Jan 2013 02:00:26 -0500	[thread overview]
Message-ID: <1359529229-22207-8-git-send-email-mporter@ti.com> (raw)
In-Reply-To: <1359529229-22207-1-git-send-email-mporter@ti.com>

Adds a dma_request_slave_channel_compat() wrapper which accepts
both the arguments from dma_request_channel() and
dma_request_slave_channel(). Based on whether the driver is
instantiated via DT, the appropriate channel request call will be
made.

This allows for a much cleaner migration of drivers to the
dmaengine DT API as platforms continue to be mixed between those
that boot using DT and those that do not.

Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Matt Porter <mporter@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
 include/linux/dmaengine.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index bfcdecb..17d8ffd 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
 struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
 struct dma_chan *net_dma_find_channel(void);
 #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
+#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
+	__dma_request_slave_channel_compat(&(mask), x, y, dev, name)
+
+static inline struct dma_chan
+*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn,
+				  void *fn_param, struct device *dev,
+				  char *name)
+{
+	struct dma_chan *chan;
+
+	chan = dma_request_slave_channel(dev, name);
+	if (chan)
+		return chan;
+
+	return __dma_request_channel(mask, fn, fn_param);
+}
 
 /* --- Helper iov-locking functions --- */
 
-- 
1.7.9.5


  parent reply	other threads:[~2013-01-30  7:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  7:00 [PATCH v6 00/10] DMA Engine support for AM33XX Matt Porter
2013-01-30  7:00 ` [PATCH v6 02/10] ARM: edma: remove unused transfer controller handlers Matt Porter
     [not found] ` <1359529229-22207-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  7:00   ` [PATCH v6 01/10] ARM: davinci: move private EDMA API to arm/common Matt Porter
2013-01-30  7:00   ` [PATCH v6 03/10] ARM: edma: add AM33XX support to the private EDMA API Matt Porter
     [not found]     ` <1359529229-22207-4-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:32       ` Arnd Bergmann
2013-01-31 18:32         ` Matt Porter
2013-01-31 20:58           ` Arnd Bergmann
     [not found]           ` <6932828d68394f71ba6df8e6bf608635@DFLE72.ent.ti.com>
2013-01-31 21:42             ` Matt Porter
2013-02-01  6:01               ` Luciano Coelho
2013-02-01 11:57                 ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 04/10] dmaengine: edma: enable build for AM33XX Matt Porter
2013-01-30  7:00   ` [PATCH v6 05/10] dmaengine: edma: Add TI EDMA device tree binding Matt Porter
2013-01-30  7:00   ` [PATCH v6 06/10] ARM: dts: add AM33XX EDMA support Matt Porter
2013-01-30  7:00   ` [PATCH v6 08/10] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Matt Porter
     [not found]     ` <1359529229-22207-9-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30 10:35       ` Mark Brown
2013-01-30  7:00   ` [PATCH v6 09/10] spi: omap2-mcspi: add generic DMA request support to the DT binding Matt Porter
     [not found]     ` <1359529229-22207-10-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:24       ` Arnd Bergmann
2013-01-31  1:32         ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 10/10] ARM: dts: add AM33XX SPI DMA support Matt Porter
2013-01-30  7:00 ` Matt Porter [this message]
     [not found]   ` <1359529229-22207-8-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:27     ` [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat() Arnd Bergmann
     [not found]   ` <ee89773ba46d44da945eee7b07ab1dc4@DFLE73.ent.ti.com>
2013-01-31  1:38     ` Matt Porter

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=1359529229-22207-8-git-send-email-mporter@ti.com \
    --to=mporter@ti.com \
    --cc=arnd@arndb.de \
    --cc=b-cousson@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=cjb@laptop.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=djbw@fb.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nsekhar@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=tony@atomide.com \
    --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 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).