Linux kernel-3.10 I2C slave设备最简驱动程式
重要数据结构: struct i2c_driver, struct i2c_client
重要i2c子系统API: i2c_register_board_infor(&adap), i2c_add_driver()
static struct i2c_driver tpd_i2c_driver = {
.probe = tpd_i2c_probe,
.remove = tpd_i2c_remove,
.detect = tpd_i2c_detect,
.driver.name = GTP_DRIVER_NAME,
.id_table = tpd_i2c_id,
.address_list = (const unsigned short *)forces,
};
i2c_register_board_info(); //注册i2c板级信息
i2c_add_driver(&tpd_i2c_driver); //注册slave i2c设备驱动
重要数据结构: struct i2c_driver, struct i2c_client
重要i2c子系统API: i2c_register_board_infor(&adap), i2c_add_driver()
static struct i2c_driver tpd_i2c_driver = {
.probe = tpd_i2c_probe,
.remove = tpd_i2c_remove,
.detect = tpd_i2c_detect,
.driver.name = GTP_DRIVER_NAME,
.id_table = tpd_i2c_id,
.address_list = (const unsigned short *)forces,
};
i2c_register_board_info(); //注册i2c板级信息
i2c_add_driver(&tpd_i2c_driver); //注册slave i2c设备驱动