dmaengine: edma: Add support for DMA filter mapping to slave devices
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 14 Dec 2015 20:47:41 +0000 (22:47 +0200)
committerVinod Koul <vinod.koul@intel.com>
Fri, 18 Dec 2015 05:47:26 +0000 (11:17 +0530)
Add support for providing device to filter_fn mapping so client drivers
can switch to use the dma_request_chan() API.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/edma.c
include/linux/platform_data/edma.h

index 6b03e4e84e6bf29b2226359e2e60bb43cd1474ce..c7a011f4b860c576fbc7be673078301db4b924ce 100644 (file)
@@ -2297,6 +2297,10 @@ static int edma_probe(struct platform_device *pdev)
                edma_set_chmap(&ecc->slave_chans[i], ecc->dummy_slot);
        }
 
+       ecc->dma_slave.filter.map = info->slave_map;
+       ecc->dma_slave.filter.mapcnt = info->slavecnt;
+       ecc->dma_slave.filter.fn = edma_filter_fn;
+
        ret = dma_async_device_register(&ecc->dma_slave);
        if (ret) {
                dev_err(dev, "slave ddev registration failed (%d)\n", ret);
index e2878baeb90e8c804a27d90c37c7d79f14e95942..105700e62ea18b458cd26f797214c9e8e9e72867 100644 (file)
@@ -53,12 +53,16 @@ enum dma_event_q {
 #define EDMA_CTLR(i)                   ((i) >> 16)
 #define EDMA_CHAN_SLOT(i)              ((i) & 0xffff)
 
+#define EDMA_FILTER_PARAM(ctlr, chan)  ((int[]) { EDMA_CTLR_CHAN(ctlr, chan) })
+
 struct edma_rsv_info {
 
        const s16       (*rsv_chans)[2];
        const s16       (*rsv_slots)[2];
 };
 
+struct dma_slave_map;
+
 /* platform_data for EDMA driver */
 struct edma_soc_info {
        /*
@@ -76,6 +80,9 @@ struct edma_soc_info {
 
        s8      (*queue_priority_mapping)[2];
        const s16       (*xbar_chans)[2];
+
+       const struct dma_slave_map *slave_map;
+       int slavecnt;
 };
 
 #endif