Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux...
[sfrench/cifs-2.6.git] / drivers / dma / pxa_dma.c
index b53fb618bbf6b5a44043d470fe5ae3a55ddb4147..b31c28b67ad3ec6aef3babf5402defaac504f680 100644 (file)
@@ -179,6 +179,8 @@ static unsigned int pxad_drcmr(unsigned int line)
        return 0x1000 + line * 4;
 }
 
+bool pxad_filter_fn(struct dma_chan *chan, void *param);
+
 /*
  * Debug fs
  */
@@ -760,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan *dchan)
        dma_pool_destroy(chan->desc_pool);
        chan->desc_pool = NULL;
 
+       chan->drcmr = U32_MAX;
+       chan->prio = PXAD_PRIO_LOWEST;
 }
 
 static void pxad_free_desc(struct virt_dma_desc *vd)
@@ -1384,6 +1388,9 @@ static int pxad_init_dmadev(struct platform_device *op,
                c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL);
                if (!c)
                        return -ENOMEM;
+
+               c->drcmr = U32_MAX;
+               c->prio = PXAD_PRIO_LOWEST;
                c->vc.desc_free = pxad_free_desc;
                vchan_init(&c->vc, &pdev->slave);
                init_waitqueue_head(&c->wq_state);
@@ -1396,9 +1403,10 @@ static int pxad_probe(struct platform_device *op)
 {
        struct pxad_device *pdev;
        const struct of_device_id *of_id;
+       const struct dma_slave_map *slave_map = NULL;
        struct mmp_dma_platdata *pdata = dev_get_platdata(&op->dev);
        struct resource *iores;
-       int ret, dma_channels = 0, nb_requestors = 0;
+       int ret, dma_channels = 0, nb_requestors = 0, slave_map_cnt = 0;
        const enum dma_slave_buswidth widths =
                DMA_SLAVE_BUSWIDTH_1_BYTE   | DMA_SLAVE_BUSWIDTH_2_BYTES |
                DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -1429,6 +1437,8 @@ static int pxad_probe(struct platform_device *op)
        } else if (pdata && pdata->dma_channels) {
                dma_channels = pdata->dma_channels;
                nb_requestors = pdata->nb_requestors;
+               slave_map = pdata->slave_map;
+               slave_map_cnt = pdata->slave_map_cnt;
        } else {
                dma_channels = 32;      /* default 32 channel */
        }
@@ -1440,6 +1450,9 @@ static int pxad_probe(struct platform_device *op)
        pdev->slave.device_prep_dma_memcpy = pxad_prep_memcpy;
        pdev->slave.device_prep_slave_sg = pxad_prep_slave_sg;
        pdev->slave.device_prep_dma_cyclic = pxad_prep_dma_cyclic;
+       pdev->slave.filter.map = slave_map;
+       pdev->slave.filter.mapcnt = slave_map_cnt;
+       pdev->slave.filter.fn = pxad_filter_fn;
 
        pdev->slave.copy_align = PDMA_ALIGNMENT;
        pdev->slave.src_addr_widths = widths;