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

Lars-Peter Clausen lars at metafoo.de
Tue Apr 16 17:46:07 CEST 2013


On 04/16/2013 04:35 PM, 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?

The next patch (04/17) adds support for compat platforms.

> 
>>> +	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?
> 



More information about the Alsa-devel mailing list