Represent i2c transfer method
struct i2c_algorithm { int (* master_xfer) (struct i2c_adapter *adap, struct i2c_msg *msgs,int num); int (* smbus_xfer) (struct i2c_adapter *adap, u16 addr,unsigned short flags, char read_write,u8 command, int size, union i2c_smbus_data *data); u32 (* functionality) (struct i2c_adapter *); };
master_xfer
Issue a set of i2c transactions to the given I2C adapter defined by the msgs array, with num messages available to transfer via the adapter specified by adap.
smbus_xfer
Issue smbus transactions to the given I2C adapter. If this is not present, then the bus layer will try and convert the SMBus calls into I2C transfers instead.
functionality
Return the flags that this algorithm/adapter pair supports from the I2C_FUNC_* flags.
i2c_algorithm is the interface to a class of hardware solutions which can be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 to name two of the most common.
The return codes from the master_xfer field should indicate the type of error code that occured during the transfer, as documented in the kernel Documentation file Documentation/i2c/fault-codes.