예제 #1
0
static int __init sdp3430_soc_init(void)
{
	int ret;
	u8 pin_mux;

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

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

	platform_set_drvdata(sdp3430_snd_device, &sdp3430_snd_devdata);
	sdp3430_snd_devdata.dev = &sdp3430_snd_device->dev;
	*(unsigned int *)sdp3430_dai[0].cpu_dai->private_data = 1; /* McBSP2 */
	*(unsigned int *)sdp3430_dai[1].cpu_dai->private_data = 2; /* McBSP3 */

	/* Set TWL4030 GPIO6 as EXTMUTE signal */
	twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux,
						TWL4030_INTBR_PMBR1);
	pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03);
	pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02);
	twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux,
						TWL4030_INTBR_PMBR1);

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

	return 0;

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

	return ret;
}
예제 #2
0
static int __init sdp3430_soc_init(void)
{
	int ret;
	u8 pin_mux;

	if (!machine_is_omap_3430sdp())
		return -ENODEV;
#ifdef CONFIG_DEBUG_PRINTK
	printk(KERN_INFO "SDP3430 SoC init\n");
#else
	;
#endif

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

	platform_set_drvdata(sdp3430_snd_device, &snd_soc_sdp3430);

	/* Set TWL4030 GPIO6 as EXTMUTE signal */
	twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux,
						TWL4030_INTBR_PMBR1);
	pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03);
	pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02);
	twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux,
						TWL4030_INTBR_PMBR1);

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

	return 0;

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

	return ret;
}