'\" t .\" Title: struct i2c_algorithm .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: I2C and SMBus Subsystem .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "STRUCT I2C_ALGORITHM" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "I2C and SMBus Subsystem" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_i2c_algorithm \- represent I2C transfer method .SH "SYNOPSIS" .sp .nf 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 *); }; .fi .SH "MEMBERS" .PP master_xfer .RS 4 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\&. .RE .PP smbus_xfer .RS 4 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\&. .RE .PP functionality .RS 4 Return the flags that this algorithm/adapter pair supports from the I2C_FUNC_* flags\&. .RE .SH "THE FOLLOWING STRUCTS ARE FOR THOSE WHO LIKE TO IMPLEMENT NEW BUS DRIVERS" .PP 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\&. .PP The return codes from the \fImaster_xfer\fR field should indicate the type of error code that occured during the transfer, as documented in the kernel Documentation file Documentation/i2c/fault\-codes\&. .SH "COPYRIGHT" .br