mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] I2C: Resurrect i2c_smbus_write_i2c_block_data.
Signed-off-by: Jean Delvare <[email protected]>
This commit is contained in:
parent
8254fc4afc
commit
21bbd69182
2 changed files with 18 additions and 0 deletions
|
|
@ -946,6 +946,20 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *val
|
|||
}
|
||||
}
|
||||
|
||||
s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
|
||||
u8 length, u8 *values)
|
||||
{
|
||||
union i2c_smbus_data data;
|
||||
|
||||
if (length > I2C_SMBUS_BLOCK_MAX)
|
||||
length = I2C_SMBUS_BLOCK_MAX;
|
||||
data.block[0] = length;
|
||||
memcpy(data.block + 1, values, length);
|
||||
return i2c_smbus_xfer(client->adapter, client->addr, client->flags,
|
||||
I2C_SMBUS_WRITE, command,
|
||||
I2C_SMBUS_I2C_BLOCK_DATA, &data);
|
||||
}
|
||||
|
||||
/* Simulate a SMBus command using the i2c protocol
|
||||
No checking of parameters is done! */
|
||||
static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr,
|
||||
|
|
@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
|
|||
EXPORT_SYMBOL(i2c_smbus_write_word_data);
|
||||
EXPORT_SYMBOL(i2c_smbus_write_block_data);
|
||||
EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
|
||||
EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);
|
||||
|
||||
MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
|
||||
MODULE_DESCRIPTION("I2C-Bus main module");
|
||||
|
|
|
|||
Loading…
Reference in a new issue