Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92
RK对应的i2c controller驱动在
kernel/drivers/i2c/busses/i2c-rockchip.c对应的传输函数是rockchip_i2c_xfer():
static const struct i2c_algorithm rockchip_i2c_algorithm = {
.master_xfer = rockchip_i2c_xfer,
.functionality = rockchip_i2c_func,
};
代码上一般会直接调用i2c_master_send或者i2c_master_recv
i2c_master_send|i2c_master_recv -> i2c_transfer -> adap->algo->master_xfer -> rockchip_i2c_xfer
int i2c_master_send(const struct i2c_client *client, const char *buf, int count)
{
......
#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
msg.scl_rate = 100 * 1000;
#endif
ret = i2c_transfer(adap, &msg, 1);