Example #1
0
static int __init omap2evm_soc_init(void)
{
	int ret;

	if (!machine_is_omap2evm())
		return -ENODEV;
	printk(KERN_INFO "omap2evm SoC init\n");

	omap2evm_snd_device = platform_device_alloc("soc-audio", -1);
	if (!omap2evm_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	platform_set_drvdata(omap2evm_snd_device, &snd_soc_omap2evm);

	ret = platform_device_add(omap2evm_snd_device);
	if (ret)
		goto err1;

	return 0;

err1:
	printk(KERN_ERR "Unable to add platform device\n");
	platform_device_put(omap2evm_snd_device);

	return ret;
}
Example #2
0
static int __init omap2evm_soc_init(void)
{
	int ret;

	if (!machine_is_omap2evm()) {
		pr_debug("Not omap2evm!\n");
		return -ENODEV;
	}
	printk(KERN_INFO "omap2evm SoC init\n");

	omap2evm_snd_device = platform_device_alloc("soc-audio", -1);
	if (!omap2evm_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	platform_set_drvdata(omap2evm_snd_device, &omap2evm_snd_devdata);
	omap2evm_snd_devdata.dev = &omap2evm_snd_device->dev;
	*(unsigned int *)omap2evm_dai.cpu_dai->private_data = 1; /* McBSP2 */

	ret = platform_device_add(omap2evm_snd_device);
	if (ret)
		goto err1;

	return 0;

err1:
	printk(KERN_ERR "Unable to add platform device\n");
	platform_device_put(omap2evm_snd_device);

	return ret;
}