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

Markus Pargmann mpa at pengutronix.de
Tue Apr 16 16:42:10 CEST 2013


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.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


More information about the Alsa-devel mailing list