现在的位置: 首页 > 综合 > 正文

三星平臺添加模擬i2c 控制器

2013年11月28日 ⁄ 综合 ⁄ 共 923字 ⁄ 字号 评论关闭
/* I2C12 */
#if defined(CONFIG_PN65N_NFC)
static struct i2c_board_info i2c_devs12_emul[] __initdata = {
};
#endif

聲明一個i2c board 結構體.

#if defined(CONFIG_PN65N_NFC)
static struct i2c_gpio_platform_data i2c12_platdata = {
	.sda_pin		= GPIO_NFC_SDA_18V,
	.scl_pin		= GPIO_NFC_SCL_18V,
	.udelay			= 2, /* 250 kHz */
	.sda_is_open_drain	= 0,
	.scl_is_open_drain	= 0,
	.scl_is_output_only = 0,
};
static struct platform_device s3c_device_i2c12 = {
	.name	= "i2c-gpio",
	.id		= 12,
	.dev.platform_data	= &i2c12_platdata,
};
#endif

填寫平臺設備內容,  確定模擬i2c 的GPIO ,  以及i2c speed .時序.

#if defined(CONFIG_PN65N_NFC)
	i2c_register_board_info(12, i2c_devs12_emul,
				ARRAY_SIZE(i2c_devs12_emul));
#endif

註冊控制器平臺設備.

#
# I2C Hardware Bus support
#

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE is not set
CONFIG_I2C_GPIO=y
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
CONFIG_HAVE_S3C2410_I2C=y
CONFIG_I2C_S3C2410=y
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

在config 填寫需要的Make 控制宏

抱歉!评论已关闭.