Re: [alsa-devel] [PATCH 1/4] DMA: PL330: Add xlate function
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
Hi,
On Mon, Jan 28, 2013 at 8:28 PM, Arnd Bergmann arnd@arndb.de wrote:
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?
of_dma_simple_xlate is just passing the dma channel number to the filter function. But I also need to compare against device node as my requested channel can belong to any of the available dma controller on SoC. So I implemented a xlate which passes the whole dma_spec.
Thanks for reviewing the patches.
Regards Padma
Arnd
On Tuesday 29 January 2013, Padma Venkat wrote:
of_dma_simple_xlate is just passing the dma channel number to the filter function. But I also need to compare against device node as my requested channel can belong to any of the available dma controller on SoC. So I implemented a xlate which passes the whole dma_spec.
Hmm, this seems to be a universal requirement for anyone using the simple xlate function. Jon, how did you expect drivers to handle this? Assuming that there is only one DMA controller in the system does not sound like a good idea.
Padma, please have a look at how I did this in the dw_dma patch I posted yesterday.
Arnd
participants (2)
-
Arnd Bergmann
-
Padma Venkat