devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	grant.likely@secretlab.ca, rob.herring@calxeda.com,
	devicetree-discuss@lists.ozlabs.org,
	Stephen Warren <swarren@nvidia.com>,
	linux-omap@vger.kernel.org, Benoit Cousson <b-cousson@ti.com>,
	Russell King <linux@arm.linux.org.uk>,
	Thierry Reding <thierry.reding@avionic-design.de>
Subject: Re: [PATCH] of: Add generic device tree DMA helpers
Date: Thu, 15 Mar 2012 09:22:06 +0000	[thread overview]
Message-ID: <201203150922.06379.arnd@arndb.de> (raw)
In-Reply-To: <1331800690-21518-1-git-send-email-nicolas.ferre@atmel.com>

On Thursday 15 March 2012, Nicolas Ferre wrote:
> Add some basic helpers to retrieve a DMA controller device_node and the
> DMA request specifications. By making DMA controllers register a generic
> translation function, we allow the management of any type of DMA requests
> specification.
> The void * output of an of_dma_xlate() function that will be implemented
> by the DMA controller can carry any type of "dma-request" argument.
> 
> The DMA client will search its associated DMA controller in the list and
> call the registered of_dam_xlate() function to retrieve the request values.
> 
> One simple xlate function is provided for the "single number" type of
> request binding.
> 
> This implementation is independent from dmaengine so it can also be used
> by legacy drivers.
> 
> For legacy reason another API will export the DMA request number into a
> Linux resource of type IORESOURCE_DMA.

This looks very good. I missed the first version of this patch, but was
thinking of very similar bindings.

> +Client drivers should specify the DMA request property using a phandle to
> +the controller. If needed, the DMA request identity on that controller is then
> +added followed by optional request specifications.
> +
> +Required property:
> +    - dma-request: List of phandle + dma-request + request specifications,
> +      one group per request "line".
> +Optional property:
> +    - dma-request-names: list of strings in the same order as the dma-request
> +      in the dma-request property.
> +
> +
> +Example:
> +
> +	i2c1: i2c@1 {
> +		...
> +		dma-request = <&sdma 2 &sdma 3>;
> +		dma-request-names = "tx", "rx";
> +		...
> +	};

This is slightly different from how the proposed pwm binding works that
Thierry is working on, which uses an arbitrary property name instead of
requiring the use of a specific property but then allowing to give names
in another property.

I don't care much which way it's done, but please try to agree on one
approach that is used for both.

The one you have here is already used by reg and irq, while the other
one is used in gpio.

> +/**
> + * of_get_dma_request() - Get the associated DMA request data
> + * @np:		device node to get DMA request from
> + * @index:	index of the DMA request
> + * @out_data:	a output that can be filled in by the of_dma_xlate() function
> + *
> + * Returns return value of of_dma_xlate() and fills out_data (if provided).
> + * On error returns the appropriate errno value.
> + */

I would suggest provinding a helper function around this one that directly
calls __dma_request_channel(). AFAICT, you should be able to let the dma
controller provide a generic filter function in struct of_dma that the
driver can use by default.

	Arnd

  reply	other threads:[~2012-03-15  9:22 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 17:29 [RFC PATCH 1/2] of: Add generic device tree DMA helpers Cousson, Benoit
2012-01-27 18:13 ` Stephen Warren
2012-01-27 20:36   ` Cousson, Benoit
2012-01-28 18:12     ` Grant Likely
2012-01-28 18:06 ` Grant Likely
2012-01-31 21:26   ` Cousson, Benoit
2012-02-02  4:52     ` Grant Likely
2012-01-31 23:09   ` Russell King - ARM Linux
2012-02-01 10:50     ` Cousson, Benoit
     [not found]       ` <4F2918F6.9040100-l0cyMroinI0@public.gmane.org>
2012-02-02  8:45         ` Russell King - ARM Linux
     [not found]           ` <20120202084539.GC1275-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-02  8:54             ` Cousson, Benoit
2012-02-22 10:59 ` Nicolas Ferre
2012-02-23 10:03   ` Cousson, Benoit
2012-02-23 15:51     ` Nicolas Ferre
2012-02-23 15:57       ` Cousson, Benoit
     [not found]         ` <4F4661DE.90704-l0cyMroinI0@public.gmane.org>
2012-02-27 13:09           ` Nicolas Ferre
2012-02-27 14:22             ` Cousson, Benoit
2012-02-27 17:28               ` Nicolas Ferre
2012-02-29 14:54 ` [RFC PATCH] of: DMA helpers: manage generic requests specification Nicolas Ferre
2012-02-29 20:54   ` Stephen Warren
2012-03-05 13:14     ` Cousson, Benoit
2012-03-05 18:30       ` Stephen Warren
2012-03-05 19:57         ` Russell King - ARM Linux
2012-03-05 10:55   ` Cousson, Benoit
2012-03-05 15:36   ` Grant Likely
2012-03-14 17:47     ` Nicolas Ferre
2012-03-14 18:16       ` Stephen Warren
     [not found] ` <4F22DEF2.5000807-l0cyMroinI0@public.gmane.org>
2012-03-15  8:38   ` [PATCH] of: Add generic device tree DMA helpers Nicolas Ferre
2012-03-15  9:22     ` Arnd Bergmann [this message]
2012-03-15  9:26       ` Russell King - ARM Linux
2012-03-15 10:09         ` Arnd Bergmann
2012-03-17  9:42         ` Grant Likely
2012-03-17 16:03           ` Arnd Bergmann
2012-03-18  9:08             ` Grant Likely
2012-03-15 10:27       ` Thierry Reding
2012-03-17 10:47         ` Grant Likely
2012-03-18  9:22           ` Thierry Reding
2012-03-18 15:10             ` Arnd Bergmann
2012-03-18 18:22             ` Grant Likely
2012-03-19 13:02           ` Mark Brown
2012-03-19 15:01             ` Arnd Bergmann
2012-03-19 15:07               ` Stephen Warren
2012-03-19 15:45                 ` Arnd Bergmann
     [not found]                   ` <201203191545.40933.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-19 16:54                     ` Stephen Warren
2012-03-15 16:30       ` Cousson, Benoit
2012-03-15 19:57         ` Russell King - ARM Linux
     [not found]           ` <20120315195753.GA2842-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-03-15 20:41             ` Arnd Bergmann
2012-03-15 21:39               ` Cousson, Benoit
2012-03-15 21:55                 ` Russell King - ARM Linux
2012-03-16  9:56                   ` Arnd Bergmann
2012-03-20 14:02                 ` Matt Porter
2012-03-15 23:45           ` Nicolas Pitre
2012-03-16 10:03     ` Arnd Bergmann
2012-03-16 11:19       ` Cousson, Benoit
2012-03-16 12:04         ` Arnd Bergmann
2012-03-16 13:28           ` Cousson, Benoit
2012-03-16 13:36             ` Nicolas Ferre
2012-03-17  9:40     ` Grant Likely
2012-03-18 20:13       ` Arnd Bergmann
2012-03-18 20:44         ` Grant Likely
2012-03-18 21:58           ` Arnd Bergmann
2012-03-18 22:12             ` Arnd Bergmann
2012-03-19 13:37         ` Nicolas Ferre
2012-03-19 15:20           ` Russell King - ARM Linux
2012-03-19 15:58             ` Cousson, Benoit
2012-03-19 13:30       ` Nicolas Ferre
2012-03-19 14:06         ` Arnd Bergmann
2012-03-19 15:33           ` Russell King - ARM Linux
2012-03-19 16:11             ` Arnd Bergmann
2012-03-19 18:06               ` Jassi Brar
2012-03-19 16:31             ` Nicolas Ferre
2012-03-19 17:49               ` Cousson, Benoit
2012-03-19 14:45         ` Grant Likely
2012-03-20 14:54           ` Nicolas Ferre
2012-03-20 10:13     ` [PATCH v2 1/2] " Nicolas Ferre
2012-03-20 10:13       ` [PATCH 2/2] of: selftest/dma: Add selftest for new DT DMA request helpers Nicolas Ferre
2012-03-20 14:16         ` Grant Likely
2012-03-20 10:17       ` [PATCH] of: dma/fixup Nicolas Ferre
     [not found]       ` <6b5dc1fadfd03a48093338b6981c0a7ae7662212.1332237596.git.nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2012-03-20 13:03         ` [PATCH v2 1/2] of: Add generic device tree DMA helpers Arnd Bergmann
2012-03-20 15:38       ` Stephen Warren

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=201203150922.06379.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=b-cousson@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.ferre@atmel.com \
    --cc=rob.herring@calxeda.com \
    --cc=swarren@nvidia.com \
    --cc=thierry.reding@avionic-design.de \
    /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).