diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-07-05 14:29:42 +0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-07-20 09:58:20 +0400 |
commit | 1ff8df4f5388ad66bd7d0199b5839a2e3345c055 (patch) | |
tree | c6d80a09a4722c8c39cea58b80a771e34594b74b /drivers/dma/sh/shdma.c | |
parent | c2cdb7e4d16394fc51dc5c2c5b3e7c3733bdfaac (diff) | |
download | linux-1ff8df4f5388ad66bd7d0199b5839a2e3345c055.tar.xz |
dma: sh: provide a migration path for slave drivers to stop using .private
This patch extends the sh dmaengine driver to support the preferred channel
selection and configuration method, instead of using the "private" field
from struct dma_chan. We add a standard filter function to be used by
slave drivers instead of implementing their own ones, and add support for
the DMA_SLAVE_CONFIG control operation, which must accompany the new
channel selection method. We still support the legacy .private channel
allocation method to cater for a smooth driver migration.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
[applied a trvial checkpath fix]
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/sh/shdma.c')
-rw-r--r-- | drivers/dma/sh/shdma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c index 9a10d8bbdef2..027c9be97654 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdma.c @@ -320,7 +320,7 @@ static const struct sh_dmae_slave_config *dmae_find_slave( } static int sh_dmae_set_slave(struct shdma_chan *schan, - int slave_id) + int slave_id, bool try) { struct sh_dmae_chan *sh_chan = container_of(schan, struct sh_dmae_chan, shdma_chan); @@ -328,7 +328,8 @@ static int sh_dmae_set_slave(struct shdma_chan *schan, if (!cfg) return -ENODEV; - sh_chan->config = cfg; + if (!try) + sh_chan->config = cfg; return 0; } |