diff options
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 80ae12048e85..42e852d79ffa 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1688,6 +1688,28 @@ s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value) | |||
1688 | EXPORT_SYMBOL(i2c_smbus_write_word_data); | 1688 | EXPORT_SYMBOL(i2c_smbus_write_word_data); |
1689 | 1689 | ||
1690 | /** | 1690 | /** |
1691 | * i2c_smbus_process_call - SMBus "process call" protocol | ||
1692 | * @client: Handle to slave device | ||
1693 | * @command: Byte interpreted by slave | ||
1694 | * @value: 16-bit "word" being written | ||
1695 | * | ||
1696 | * This executes the SMBus "process call" protocol, returning negative errno | ||
1697 | * else a 16-bit unsigned "word" received from the device. | ||
1698 | */ | ||
1699 | s32 i2c_smbus_process_call(struct i2c_client *client, u8 command, u16 value) | ||
1700 | { | ||
1701 | union i2c_smbus_data data; | ||
1702 | int status; | ||
1703 | data.word = value; | ||
1704 | |||
1705 | status = i2c_smbus_xfer(client->adapter, client->addr, client->flags, | ||
1706 | I2C_SMBUS_WRITE, command, | ||
1707 | I2C_SMBUS_PROC_CALL, &data); | ||
1708 | return (status < 0) ? status : data.word; | ||
1709 | } | ||
1710 | EXPORT_SYMBOL(i2c_smbus_process_call); | ||
1711 | |||
1712 | /** | ||
1691 | * i2c_smbus_read_block_data - SMBus "block read" protocol | 1713 | * i2c_smbus_read_block_data - SMBus "block read" protocol |
1692 | * @client: Handle to slave device | 1714 | * @client: Handle to slave device |
1693 | * @command: Byte interpreted by slave | 1715 | * @command: Byte interpreted by slave |