Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
[~shefty/rdma-dev.git] / arch / arm / plat-samsung / dma-ops.c
index 1baa8ce824324e92c63258629378b500fbc5bf1a..0747c77a2fd53d0d2a66a1f1f2377b3d7e7722f6 100644 (file)
 
 #include <mach/dma.h>
 
-static inline bool pl330_filter(struct dma_chan *chan, void *param)
-{
-       struct dma_pl330_peri *peri = chan->private;
-       return peri->peri_id == (unsigned)param;
-}
-
 static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
                                struct samsung_dma_info *info)
 {
        struct dma_chan *chan;
        dma_cap_mask_t mask;
        struct dma_slave_config slave_config;
+       void *filter_param;
 
        dma_cap_zero(mask);
        dma_cap_set(info->cap, mask);
 
-       chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
+       /*
+        * If a dma channel property of a device node from device tree is
+        * specified, use that as the fliter parameter.
+        */
+       filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop :
+                               (void *)dma_ch;
+       chan = dma_request_channel(mask, pl330_filter, filter_param);
 
        if (info->direction == DMA_DEV_TO_MEM) {
                memset(&slave_config, 0, sizeof(struct dma_slave_config));