aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index eff50e062be8..deddeb8c337c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -342,11 +342,25 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
342} 342}
343#endif /* I2C_BOARDINFO */ 343#endif /* I2C_BOARDINFO */
344 344
345/* 345/**
346 * struct i2c_algorithm - represent I2C transfer method
347 * @master_xfer: Issue a set of i2c transactions to the given I2C adapter
348 * defined by the msgs array, with num messages available to transfer via
349 * the adapter specified by adap.
350 * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this
351 * is not present, then the bus layer will try and convert the SMBus calls
352 * into I2C transfers instead.
353 * @functionality: Return the flags that this algorithm/adapter pair supports
354 * from the I2C_FUNC_* flags.
355 *
346 * The following structs are for those who like to implement new bus drivers: 356 * The following structs are for those who like to implement new bus drivers:
347 * i2c_algorithm is the interface to a class of hardware solutions which can 357 * i2c_algorithm is the interface to a class of hardware solutions which can
348 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 358 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
349 * to name two of the most common. 359 * to name two of the most common.
360 *
361 * The return codes from the @master_xfer field should indicate the type of
362 * error code that occured during the transfer, as documented in the kernel
363 * Documentation file Documentation/i2c/fault-codes.
350 */ 364 */
351struct i2c_algorithm { 365struct i2c_algorithm {
352 /* If an adapter algorithm can't do I2C-level access, set master_xfer 366 /* If an adapter algorithm can't do I2C-level access, set master_xfer
@@ -445,7 +459,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
445static inline struct i2c_adapter * 459static inline struct i2c_adapter *
446i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 460i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
447{ 461{
448#if IS_ENABLED(I2C_MUX) 462#if IS_ENABLED(CONFIG_I2C_MUX)
449 struct device *parent = adapter->dev.parent; 463 struct device *parent = adapter->dev.parent;
450 464
451 if (parent != NULL && parent->type == &i2c_adapter_type) 465 if (parent != NULL && parent->type == &i2c_adapter_type)