summaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorIrina Tirdea2015-08-12 16:31:33 +0200
committerWolfram Sang2015-08-24 14:05:19 +0200
commit01eef96e37d77cd89156e5f51aab81a9d5c96539 (patch)
treeb6d1c3a0107448bdf6371fbe5b7d610594045ee9 /include/linux/i2c.h
parenti2c: lpc2k: add driver (diff)
downloadkernel-qcow2-linux-01eef96e37d77cd89156e5f51aab81a9d5c96539.tar.gz
kernel-qcow2-linux-01eef96e37d77cd89156e5f51aab81a9d5c96539.tar.xz
kernel-qcow2-linux-01eef96e37d77cd89156e5f51aab81a9d5c96539.zip
i2c: core: Add support for best effort block read emulation
There are devices that need to handle block transactions regardless of the capabilities exported by the adapter. For performance reasons, they need to use i2c read blocks if available, otherwise emulate the block transaction with word or byte transactions. Add support for a helper function that would read a data block using the best transfer available: I2C_FUNC_SMBUS_READ_I2C_BLOCK, I2C_FUNC_SMBUS_READ_WORD_DATA or I2C_FUNC_SMBUS_READ_BYTE_DATA. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5aea07137218..768063baafbf 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -121,6 +121,9 @@ extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
u8 command, u8 length,
const u8 *values);
+extern s32
+i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
+ u8 command, u8 length, u8 *values);
#endif /* I2C */
/**