diff options
author | Prakash Mortha <pmortha@escient.com> | 2008-10-14 17:30:06 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-10-14 17:30:06 +0200 |
commit | 596c88f4601e6245a15ea7619527674abbfdcf92 (patch) | |
tree | fb79f818844fb3109a702a5ac45f3f873fa5ad5b /drivers/i2c | |
parent | a10f9e7caf8d3028d8fb1d4c3d590492cde3df3e (diff) |
i2c: Restore i2c_smbus_process_call function
Restore the i2c_smbus_process_call() as one driver (for the
Micronas MAP5401) will need it soon.
[JD: Update documentation accordingly.]
Signed-off-by: Prakash Mortha <pmortha@escient.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-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 80ae12048e8..42e852d79ff 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) EXPORT_SYMBOL(i2c_smbus_write_word_data); /** + * i2c_smbus_process_call - SMBus "process call" protocol + * @client: Handle to slave device + * @command: Byte interpreted by slave + * @value: 16-bit "word" being written + * + * This executes the SMBus "process call" protocol, returning negative errno + * else a 16-bit unsigned "word" received from the device. + */ +s32 i2c_smbus_process_call(struct i2c_client *client, u8 command, u16 value) +{ + union i2c_smbus_data data; + int status; + data.word = value; + + status = i2c_smbus_xfer(client->adapter, client->addr, client->flags, + I2C_SMBUS_WRITE, command, + I2C_SMBUS_PROC_CALL, &data); + return (status < 0) ? status : data.word; +} +EXPORT_SYMBOL(i2c_smbus_process_call); + +/** * i2c_smbus_read_block_data - SMBus "block read" protocol * @client: Handle to slave device * @command: Byte interpreted by slave |