|
楼主 |
发表于 2011-12-23 22:11:42
|
显示全部楼层
没人应答?看来这论坛太冷清了,还是大家都深藏不露?
static struct i2c_gpio_platform_data i2c3_data = {
.sda_pin = 107,
.scl_pin = 108,
.udelay = 5,
.sda_is_open_drain = 1,
.scl_is_open_drain = 1,
};
static struct platform_device i2c3_device = {
.name = "i2c-gpio",
.id = 2,
.dev = {
.platform_data = &i2c3_data,
},
};
static struct platform_device *platform_devs_pre[] __initdata = {
& i2c3_device,//注册
};
static struct i2c_board_info i2c_devices[] = {
{
I2C_BOARD_INFO("lis35de", 0x1C),
},
};
然后platform_add_devices(platform_devs_pre,
ARRAY_SIZE(platform_devs_post));
i2c_register_board_info(2, i2c_devices, ARRAY_SIZE(i2c_devices));
id设为2的话一切都成浮云了(sys/devices/下只有i2c-0和i2c-1),改成1的话还可以在sys/devices/i2c-1下面看到对应i2c设备,但log里打出probe失败,望高手指教!!!! |
|