[PATCH] dmaengine: add CSR SiRFprimaII DMAC driver
Barry Song
21cnbao at gmail.com
Thu Sep 8 11:27:32 EDT 2011
Hi Arnd,
Thanks!
2011/9/8 Arnd Bergmann <arnd at arndb.de>
>
> On Wednesday 07 September 2011, Barry Song wrote:
> > +/*
> > + * The DMA controller consists of 16 independent DMA channels.
> > + * Each channel is allocated to a different function
> > + */
> > +bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id)
> > +{
> > + unsigned int ch_nr = (unsigned int) chan_id;
> > +
> > + if (ch_nr == chan->chan_id)
> > + return true;
> > +
> > + return false;
> > +}
> > +EXPORT_SYMBOL(sirfsoc_dma_filter_id);
> > +
>
> Hi Barry,
>
> It seems wrong that you have to export this function. The dmaengine API
> should be able to work without this, and when you have drivers using the
> interface, those should not rely on a specific implementation as the
> purpose of the API is specifically to hide that.
>
> Am I missing something?
i am not sure whether i have other way to require a special channel
for a special device. it seems dma_request_channel only gives me a
chance to use a filter function since my all channels have same DMA
cap masks.
this filter is used by all drivers with DMA since every dma channel is
fixed to be assigned to one device.
i did do some copy from coh901318.c:
bool coh901318_filter_id(struct dma_chan *chan, void *chan_id)
{
unsigned int ch_nr = (unsigned int) chan_id;
if (ch_nr == to_coh901318_chan(chan)->id)
return true;
return false;
}
EXPORT_SYMBOL(coh901318_filter_id);
if it does become a common filter, we might have a function like:
bool dmaengine_filter_match_channel_id(struct dma_chan *chan, void *chan_id)
{
if (ch_nr == chan->chan_id)
return true;
return false;
}
EXPORT_SYMBOL(dmaengine_filter_match_channel_id);
Another filter is in amba-pl08x.c, it is filtering channel by name:
bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
{
struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
char *name = chan_id;
/* Check that the channel is not taken! */
if (!strcmp(plchan->name, name))
return true;
return false;
}
>
> Arnd
>
-barry
More information about the linux-arm-kernel
mailing list