lkml.org 
[lkml]   [2012]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH/RFC] dmaengine: add a slave parameter to __dma_request_channel()
From
On Wed, Mar 7, 2012 at 1:46 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

> The call to dmaengine_slave_config() actually simplifies the DMA engine
> support for some drivers though, so eliminating it doesn't help.  What
> would be useful is to have a helper function along these lines:
>
> struct dma_chan *dma_request_channel_config(mask, fn, data, config)
> {
>        struct dma_chan *c = dma_request_channel(mask, fn, data);
>
>        if (c) {
>                if (dmaengine_slave_config(c, config)) {
>                        dma_release_channel(c);
>                        c = NULL;
>                }
>        }
>        return c;
> }
>
> which would simplify some of the DMA engine users.

Yes that will cut down some overhead from some drivers.

[Russell]
> There'll still be
> some though which would want to call dmaengine_slave_config() to change
> the channels configuration when the mode of the device switches.

[Guennadi]
> Cannot dmaengine_slave_config() be used for that?

It is already used for that.

The PL022 SPI driver does this using different word sizes on the wire,
so if the same controller talks to chips with different word width
it reconfigures the size of unit picked from memory. Basically
the width (not depth) of the FIFO is adjustable run-time.
The words have to be fetched from memory with the same
width.
drivers/spi/amba-pl022.c

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-07 17:33    [from the cache]
©2003-2011 Jasper Spaans