[alsa-devel] [PATCH 6/8] sound:asoc: Add support for SPEAr ASoC machine driver.
Mark Brown
broonie at opensource.wolfsonmicro.com
Tue Mar 20 17:00:18 CET 2012
On Tue, Mar 20, 2012 at 05:03:50PM +0530, Rajeev Kumar wrote:
> The patch add support for SPEAr ASoC machine driver.
This is the support for some particular board rather than for the SoC.
> + if (cpu_is_spear1340()) {
> +#ifdef CONFIG_CPU_SPEAR1340
> + u32 mode = 0;
> + u32 val = readl(VA_SPEAR1340_PERIP_CFG);
Ick, no! This should be in a driver for the SoC somewhere, not in the
board. I've not really read most of the rest of the driver.
> +static int __init spear_audio_init(void)
> +{
> + int ret;
> + struct snd_soc_card *spear_soc_card;
> +
> + if (machine_is_spear1340_lcad())
> + spear_soc_card = &lcad_snd_card;
> + else if (cpu_is_spear1340())
> + spear_soc_card = &spear1340_snd_card;
> + else if (cpu_is_spear320())
> + spear_soc_card = &spear320s_snd_card;
> + else
> + spear_soc_card = &spear_snd_card;
Use snd_soc_register_card().
> +#if defined(CONFIG_CPU_SPEAR1340)
> + if (cpu_is_spear1340()) {
> + /* Create and register spdif platform devices */
> + spdif_dit_device = platform_device_alloc("spdif-dit", -1);
> + if (!spdif_dit_device) {
> + printk(KERN_ERR "spdif transceiver " \
> + "platform_device_alloc fails\n");
> + return -ENOMEM;
> + }
Absolutely no, all this setup of the devices for the SoC should be in
your arch/arm code somewhere. This should only be a driver for the
board.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20120320/67d58f0d/attachment.sig
More information about the Alsa-devel
mailing list