public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Lars-Peter Clausen" <lars@metafoo.de>
Cc: Vinod Koul <vinod.koul@intel.com>, Dan Williams <djbw@fb.com>,
	Jon Hunter <jon-hunter@ti.com>,
	Padmavathi Venna <padma.v@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dma: of: Add generic xlate function for matching by channel id
Date: Tue, 9 Apr 2013 15:06:02 +0200	[thread overview]
Message-ID: <201304091506.02329.arnd@arndb.de> (raw)
In-Reply-To: <51640B48.5060506@metafoo.de>

On Tuesday 09 April 2013, Lars-Peter Clausen wrote:
> On 04/09/2013 01:28 PM, Vinod Koul wrote:
> > On Sat, Mar 30, 2013 at 09:38:54AM +0100, Lars-Peter Clausen wrote:
> >> On 03/29/2013 10:49 PM, Vinod Koul wrote:
> >>> On Mon, Mar 25, 2013 at 02:16:51PM +0100, Lars-Peter Clausen wrote:
> >>>> This patch adds a new generic of dma xlate callback function which will match a
> >>>> channel by its id.
> >>> how will the client know which "id" to request? 
> >>
> >> The devicetree tells it, or what exactly do you mean?
> > Is this global id? Anrd, what does the id mean in DT?
> 
> It's more or less a device specific cookie. And in this case we are using a
> 1 to 1 mapping to the channel number.

To clarify this some more: The slave driver uses a name that is defined in the
binding of for the slave device to request a specific channel. This is typically
something trivial like "rx" or "data" that defines how the slave driver knows
its channel.

This gets passed to the dmaengine core, which looks up a dmaengine driver specific
description of a channel, using the name and the slave device pointer as keys.
Normally this is just a request number, sometimes it can be a combinattion
of request number with some other data like a master number or the DMA direction,
if the dmaengine driver requires that information in order to allocate the channel.

In this specific case, it is the chan_id number, which is correct for any driver
that uses the same number for slave_id and chan_id. It may be an exaggeration 
to call it "generic", since this only works for a few dmaengine drivers, but
it's reasonable to have this kind of helper in common code since there are
multiple drivers with the same characteristic.

	Arnd

      reply	other threads:[~2013-04-09 13:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 13:16 [PATCH 1/2] dma: of: Add generic xlate function for matching by channel id Lars-Peter Clausen
2013-03-25 13:16 ` [PATCH 2/2] dma: pl330: Use the generic of_dma_xlate_by_chan_id Lars-Peter Clausen
2013-03-29 21:49 ` [PATCH 1/2] dma: of: Add generic xlate function for matching by channel id Vinod Koul
2013-03-30  8:38   ` Lars-Peter Clausen
2013-04-09 11:28     ` Vinod Koul
2013-04-09 12:36       ` Lars-Peter Clausen
2013-04-09 13:06         ` Arnd Bergmann [this message]

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=201304091506.02329.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=djbw@fb.com \
    --cc=jon-hunter@ti.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=padma.v@samsung.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