diff options
author | Padmavathi Venna <padma.v@samsung.com> | 2013-02-13 22:40:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-02-14 09:34:27 -0500 |
commit | a80258f9b2ac81e72ff680d273df9544a1307a32 (patch) | |
tree | 2797ea0a381780cea4369fc2fb6d1802b9c3249b /drivers/dma | |
parent | 34d19355b84adde9eebc1d6771231c15dff891e6 (diff) |
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>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/pl330.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 40e97528244b..f5d47e617df2 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/amba/pl330.h> | 25 | #include <linux/amba/pl330.h> |
26 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
27 | #include <linux/of.h> | 27 | #include <linux/of.h> |
28 | #include <linux/of_dma.h> | ||
28 | 29 | ||
29 | #include "dmaengine.h" | 30 | #include "dmaengine.h" |
30 | #define PL330_MAX_CHAN 8 | 31 | #define PL330_MAX_CHAN 8 |
@@ -2379,6 +2380,30 @@ bool pl330_filter(struct dma_chan *chan, void *param) | |||
2379 | } | 2380 | } |
2380 | EXPORT_SYMBOL(pl330_filter); | 2381 | EXPORT_SYMBOL(pl330_filter); |
2381 | 2382 | ||
2383 | static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, | ||
2384 | struct of_dma *ofdma) | ||
2385 | { | ||
2386 | int count = dma_spec->args_count; | ||
2387 | struct dma_pl330_dmac *pdmac = ofdma->of_dma_data; | ||
2388 | struct dma_pl330_filter_args fargs; | ||
2389 | dma_cap_mask_t cap; | ||
2390 | |||
2391 | if (!pdmac) | ||
2392 | return NULL; | ||
2393 | |||
2394 | if (count != 1) | ||
2395 | return NULL; | ||
2396 | |||
2397 | fargs.pdmac = pdmac; | ||
2398 | fargs.chan_id = dma_spec->args[0]; | ||
2399 | |||
2400 | dma_cap_zero(cap); | ||
2401 | dma_cap_set(DMA_SLAVE, cap); | ||
2402 | dma_cap_set(DMA_CYCLIC, cap); | ||
2403 | |||
2404 | return dma_request_channel(cap, pl330_dt_filter, &fargs); | ||
2405 | } | ||
2406 | |||
2382 | static int pl330_alloc_chan_resources(struct dma_chan *chan) | 2407 | static int pl330_alloc_chan_resources(struct dma_chan *chan) |
2383 | { | 2408 | { |
2384 | struct dma_pl330_chan *pch = to_pchan(chan); | 2409 | struct dma_pl330_chan *pch = to_pchan(chan); |