[alsa-devel] [PATCH v3 2/5] ASoC: sirf: add I2S CPU DAI driver

Mark Brown broonie at kernel.org
Mon Jan 6 18:12:56 CET 2014


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

> +static int sirf_i2s_dai_probe(struct snd_soc_dai *dai)
> +{
> +	dai->playback_dma_data = &dma_data[0];
> +	dai->capture_dma_data = &dma_data[1];
> +	return 0;
> +}

Call snd_soc_dai_init_dma_data() rather than assigning directly.

> +	},
> +	.ops = &sirfsoc_i2s_dai_ops,
> +};
> +#ifdef CONFIG_PM_RUNTIME

Blank line after the struct please.

> +		writel(si2s->i2s_ctrl, si2s->base + AUDIO_CTRL_I2S_CTRL);
> +		/*Restore MCLK enable and reference clock select bits.*/

/* text */

> +	si2s->sirf_pcm_pdev = platform_device_register_simple("sirf-pcm-audio",
> +			0, NULL, 0);
> +	if (IS_ERR(si2s->sirf_pcm_pdev))
> +		return PTR_ERR(si2s->sirf_pcm_pdev);

This should just be a call to register the DMA directly rather than
create a device to do it.

> +	ret = of_address_to_resource(pdev->dev.of_node, 0, &mem_res);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Unable to get i2s memory resource.\n");
> +		return ret;
> +	}

It is more normal to use platform_get_resource(), it works fine with OF
resources and is more idiomatic than using the OF specific stuff.
-------------- 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/8c3d3c38/attachment.sig>


More information about the Alsa-devel mailing list