Serial bus transactions are just a matter of accessing registers to set/get their content. I2C respects that principle. I2C core provides two kinds of API, one for plain I2C communications, and another for SMBUS-compatible devices, which also works with I2C devices, but not the reverse.
Accessing the client
Plain I2C communication
The following are essential functions you usually deal with when talking to I2C devices:
int i2c_master_send(struct i2c_client *client, const char *buf, int count); int i2c_master_recv(struct i2c_client *client, char *buf, int count);
Almost all I2C communication functions take a struct i2c_client as the first parameter. The second parameter contains the bytes to read or write and the third represents...