[alsa-devel] [PATCH v3 1/5] ASoC: sirf: add sirf platform driver which provides DMA

Mark Brown broonie at kernel.org
Mon Jan 6 18:07:15 CET 2014


On Fri, Jan 03, 2014 at 02:05:00PM +0800, RongJun Ying wrote:

> index 0000000..1637089
> --- /dev/null
> +++ b/sound/soc/sirf/Kconfig
> @@ -0,0 +1,4 @@
> +config SND_SIRF_SOC
> +	tristate "Platform DMA driver for the SiRF SoC chips"
> +	depends on ARCH_SIRF && SND_SOC
> +	select SND_SOC_GENERIC_DMAENGINE_PCM

No need for the SND_SOC dependency, the subdirectories are only
enumerated if it is selected, and looking at the code I don't see a
build time dependency on ARCH_SIRF so it should be ARCH_SIRF ||
COMPILE_TEST.

> +static struct dma_chan *sirf_pcm_request_chan(struct snd_soc_pcm_runtime *rtd,
> +	struct snd_pcm_substream *substream)
> +{
> +	struct snd_dmaengine_dai_dma_data *dma_data;
> +
> +	dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
> +
> +	return dma_request_slave_channel(rtd->cpu_dai->dev,
> +			dma_data->chan_name);
> +}
> +
> +static const struct snd_dmaengine_pcm_config sirf_dmaengine_pcm_config = {
> +	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
> +	.compat_request_channel = sirf_pcm_request_chan,

Do you need the compat_request_chan - I'd expect a newish ARM system to
be DT only and the code doesn't look like it's doing anything that the
core couldn't handle?

> +static struct platform_driver sirf_pcm_driver = {
> +	.driver = {
> +		.name = "sirf-pcm-audio",
> +		.owner = THIS_MODULE,
> +	},
> +	.probe = sirf_pcm_probe,
> +};

This doesn't look to ever access any hardware directly so it probably
shouldn't be a standalone driver as Lars-Peter says.

> +static int __init sirf_pcm_init(void)
> +{
> +	int ret = 0;
> +
> +	ret = platform_driver_register(&sirf_pcm_driver);
> +	if (ret)
> +		pr_err("failed to register platform driver\n");
> +	return ret;
> +}

module_platform_driver() if there is some real hardware here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140106/c04d994c/attachment.sig>


More information about the Alsa-devel mailing list