[alsa-devel] [PATCH 03/17] ASoC: Add a generic dmaengine_pcm driver

Lee Jones lee.jones at linaro.org
Tue Apr 16 16:55:14 CEST 2013


On Tue, 16 Apr 2013, Markus Pargmann wrote:

> On Tue, Apr 16, 2013 at 03:35:18PM +0100, Lee Jones wrote:
> > > > +/**
> > > > + * snd_dmaengine_pcm_register - Register a dmaengine based PCM device
> > > > + * @dev: The parent device for the PCM device
> > > > + * @config: Platform specific PCM configuration
> > > > + * @flags: Platform specific quirks
> > > > + */
> > > > +int snd_dmaengine_pcm_register(struct device *dev,
> > > > +	const struct snd_dmaengine_pcm_config *config, unsigned int flags)
> > > > +{
> > > > +	struct dmaengine_pcm *pcm;
> > > > +	unsigned int i;
> > > > +
> > > > +	if (!dev->of_node)
> > > > +		return -EINVAL;
> > 
> > Why is this call Device Tree only?
> > 
> > Are devices which use platform data still supported?
> > 
> > > > +	pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
> > > > +	if (!pcm)
> > > > +		return -ENOMEM;
> > > > +
> > > > +	pcm->config = config;
> > > > +
> > > > +	for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
> > > > +		pcm->chan[i] = of_dma_request_slave_channel(dev->of_node,
> > > > +					dmaengine_pcm_dma_channel_names[i]);
> > > > +	}
> > > 
> > > Perhaps you should use dma_request_slave_channel here? Then you could
> > > also drop the of_dma.h include.
> > 
> > Then how would Device Tree be supported?
> 
> dma_request_slave_channel calls of_dma_request_slave_channel if
> dev->of_node exists. As far as I know dma_request_slave_channel is
> preferred for calls from outside the dmaengine core.

Ah yes, fair point. I was thinking of dma_request_channel().

I think my first question (above) is still valid though.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


More information about the Alsa-devel mailing list