Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

DMA: PL330: Add xlate function

Add xlate to translate the device-tree binding information into
the appropriate format. The filter function requires the dma
controller device and dma channel number as filter_params.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Padmavathi Venna and committed by
Vinod Koul
a80258f9 34d19355

+25
+25
drivers/dma/pl330.c
··· 25 25 #include <linux/amba/pl330.h> 26 26 #include <linux/scatterlist.h> 27 27 #include <linux/of.h> 28 + #include <linux/of_dma.h> 28 29 29 30 #include "dmaengine.h" 30 31 #define PL330_MAX_CHAN 8 ··· 2379 2378 return *peri_id == (unsigned)param; 2380 2379 } 2381 2380 EXPORT_SYMBOL(pl330_filter); 2381 + 2382 + static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, 2383 + struct of_dma *ofdma) 2384 + { 2385 + int count = dma_spec->args_count; 2386 + struct dma_pl330_dmac *pdmac = ofdma->of_dma_data; 2387 + struct dma_pl330_filter_args fargs; 2388 + dma_cap_mask_t cap; 2389 + 2390 + if (!pdmac) 2391 + return NULL; 2392 + 2393 + if (count != 1) 2394 + return NULL; 2395 + 2396 + fargs.pdmac = pdmac; 2397 + fargs.chan_id = dma_spec->args[0]; 2398 + 2399 + dma_cap_zero(cap); 2400 + dma_cap_set(DMA_SLAVE, cap); 2401 + dma_cap_set(DMA_CYCLIC, cap); 2402 + 2403 + return dma_request_channel(cap, pl330_dt_filter, &fargs); 2404 + } 2382 2405 2383 2406 static int pl330_alloc_chan_resources(struct dma_chan *chan) 2384 2407 {