diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-08-19 17:29:16 (GMT) |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-09-11 06:18:13 (GMT) |
commit | 4d130de20c3f39fc1a1aecd3969b50d49ff2e358 (patch) | |
tree | 516da38bd5d9114a6a3b2140fb8c69a873162976 /drivers/dma/dw/core.c | |
parent | 8950052029874a6738552debb45077c596e90e6b (diff) | |
download | linux-4d130de20c3f39fc1a1aecd3969b50d49ff2e358.tar.xz |
dmaengine: dw: introduce generic filter function
The introduced filter function would be reused in the ACPI and DT cases since
in those cases we have to apply mandatory data to the requested channel. Thus,
patch moves platform driver to use it in that case.
The function unlikely can't be used by users of the driver due to an implicit
dependency to the dw_dmac_core module.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw/core.c')
-rw-r--r-- | drivers/dma/dw/core.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 1c45212..10e43ea 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -919,6 +919,26 @@ err_desc_get: return NULL; } +bool dw_dma_filter(struct dma_chan *chan, void *param) +{ + struct dw_dma_chan *dwc = to_dw_dma_chan(chan); + struct dw_dma_slave *dws = param; + + if (!dws || dws->dma_dev != chan->device->dev) + return false; + + /* We have to copy data since dws can be temporary storage */ + + dwc->src_id = dws->src_id; + dwc->dst_id = dws->dst_id; + + dwc->src_master = dws->src_master; + dwc->dst_master = dws->dst_master; + + return true; +} +EXPORT_SYMBOL_GPL(dw_dma_filter); + /* * Fix sconfig's burst size according to dw_dmac. We need to convert them as: * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3. |