28 Jan
2013
28 Jan
'13
3:58 p.m.
On Friday 18 January 2013, Padmavathi Venna wrote:
+struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
+{
int count = dma_spec->args_count;
struct of_dma_filter_info *info = ofdma->of_dma_data;
if (!info || !info->filter_fn)
return NULL;
if (count != 1)
return NULL;
return dma_request_channel(info->dma_cap, info->filter_fn, dma_spec);
+} +EXPORT_SYMBOL_GPL(of_dma_pl330_xlate);
It seems a little sad that we still have to use dma_request_channel() to implement this, when that function will go off searching all channels and pass them tino the filter, which then has to look for the device node and match it with each channel. We already know the controller and should just be able to get a channel for it, although I don't exactly know how that is done.
Further, your function is almost identical to the of_dma_simple_xlate function. Can't you use that one instead?
Arnd