table of contents
STRUCT I2C_ALGORITHM(9) | I2C and SMBus Subsystem | STRUCT I2C_ALGORITHM(9) |
NAME¶
struct_i2c_algorithm - represent I2C transfer method
SYNOPSIS¶
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 *); #if IS_ENABLED(CONFIG_I2C_SLAVE)
int (* reg_slave) (struct i2c_client *client);
int (* unreg_slave) (struct i2c_client *client); #endif };
MEMBERS¶
master_xfer
smbus_xfer
functionality
reg_slave
unreg_slave
DESCRIPTION¶
The following structs are for those who like to implement new bus drivers: 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 occurred during the transfer, as documented in the kernel Documentation file Documentation/i2c/fault-codes.
COPYRIGHT¶
January 2017 | Kernel Hackers Manual 4.8. |