Re: [PATCH] ASoC: Added OMAP3 EVM support in ASoC.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mark,

One question below.

* Anuj Aggarwal <anuj.aggarwal@xxxxxx> [090514 01:30]:
> Resending the patch after fixing the minor issues.
> 
> Signed-off-by: Anuj Aggarwal <anuj.aggarwal@xxxxxx>
> ---
>  sound/soc/omap/Kconfig    |    8 +++
>  sound/soc/omap/Makefile   |    2 +
>  sound/soc/omap/omap3evm.c |  147 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 157 insertions(+), 0 deletions(-)
>  create mode 100644 sound/soc/omap/omap3evm.c

<snip snip>
 
> --- /dev/null
> +++ b/sound/soc/omap/omap3evm.c

<snip snip>

> +static int __init omap3evm_soc_init(void)
> +{
> +	int ret;
> +
> +	if (!machine_is_omap3evm()) {
> +		pr_err("Not OMAP3 EVM!\n");
> +		return -ENODEV;
> +	}
> +	pr_info("OMAP3 EVM SoC init\n");
> +
> +	omap3evm_snd_device = platform_device_alloc("soc-audio", -1);
> +	if (!omap3evm_snd_device) {
> +		printk(KERN_ERR "Platform device allocation failed\n");
> +		return -ENOMEM;
> +	}
> +
> +	platform_set_drvdata(omap3evm_snd_device, &omap3evm_snd_devdata);
> +	omap3evm_snd_devdata.dev = &omap3evm_snd_device->dev;
> +	*(unsigned int *)omap3evm_dai.cpu_dai->private_data = 1;
> +
> +	ret = platform_device_add(omap3evm_snd_device);
> +	if (ret)
> +		goto err1;
> +
> +	return 0;
> +
> +err1:
> +	printk(KERN_ERR "Unable to add platform device\n");
> +	platform_device_put(omap3evm_snd_device);
> +
> +	return ret;
> +}
> +
> +static void __exit omap3evm_soc_exit(void)
> +{
> +	platform_device_unregister(omap3evm_snd_device);
> +}

Are there still some problems from ASoC point of view to
convert ASoC to do the platform_device_alloc() from
board init files?

So for omaps, the platform_device_add() sould be called from
the arch/arm/*omap*/board-*.c files.

To recap, there should not be any need to do the machine_is_xxx()
calls in the drivers. Currently if multiple boards are called,
all the xxx_soc_init() calls get unnecessarily called.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux