Subject: [PATCH V3 1/2] of: Add generic device tree DMA helpers

From: [email-masked] (Jon Hunter)
Date: Wed, 16 May 2012 08:15:40 -0500

Hi Jassi,

On 05/16/2012 07:37 AM, Jassi Brar wrote:
> Hi Jon,
> 
> On 16 May 2012 06:41, Jon Hunter <[email-masked]> wrote:
>> On 05/04/2012 02:01 PM, Jassi Brar wrote:
>>>
>>> +       i2c1: i2c at 1 {
>>> +               ...
>>> +               dma = <&sdma 2 1 &sdma 3 2>;
>>> +               ...
>>> +       };
>>>>
>>> I see this requires a client driver to specify a particular req_line on a
>>> particular dma controller. I am not sure if this is most optimal.
>>
>> Actually, no. The phandle in the DT specifies the DMA controller to use.
>> Then the client simply asks for a channel with a particular property,
>> for example, DMA_MEM_TO_DEV (ie. TX) and the channel information is return.
>>
> See below.
> 
>>> I think such client->req_line map should be provided to the dmac controller
>>> driver via its dt node in some format. The dmac driver could then populate
>>> a dma_chan, or similar, only for that req_line and not for the unused one
>>> which otherwise could also have served the same client.
>>>
>>> Ideally the I2C driver should simply ask, say, a channel for TX and another
>>> for RX, everything else should already be setup via dmac's dt nodes.
>>
>> Yes that is the intention here.
>>
> But the client is required to specify the dmac that would serve it.
> Which is more
> than simply asking for "some suitable channel".

No this is not the case with what I propose. The client knows nothing
about the dmac.

> If you read the whole exchange between I and Stephen, we converged on a
> scheme of clients' node having nothing to specify and DMAC told all about
> every client in one palce. Which resembles closer to reality and is
> much simpler.
> I already started on a patchset and should be able submit for review
> in a day or two.

Ok. I look forward to your implementation :-)

Jon