diff options
-rw-r--r-- | drivers/i2c/i2c-core.c | 15 | ||||
-rw-r--r-- | include/linux/i2c.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 0ce58b506046..1a2c9ab5d9e3 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -946,6 +946,20 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *val | |||
946 | } | 946 | } |
947 | } | 947 | } |
948 | 948 | ||
949 | s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command, | ||
950 | u8 length, u8 *values) | ||
951 | { | ||
952 | union i2c_smbus_data data; | ||
953 | |||
954 | if (length > I2C_SMBUS_BLOCK_MAX) | ||
955 | length = I2C_SMBUS_BLOCK_MAX; | ||
956 | data.block[0] = length; | ||
957 | memcpy(data.block + 1, values, length); | ||
958 | return i2c_smbus_xfer(client->adapter, client->addr, client->flags, | ||
959 | I2C_SMBUS_WRITE, command, | ||
960 | I2C_SMBUS_I2C_BLOCK_DATA, &data); | ||
961 | } | ||
962 | |||
949 | /* Simulate a SMBus command using the i2c protocol | 963 | /* Simulate a SMBus command using the i2c protocol |
950 | No checking of parameters is done! */ | 964 | No checking of parameters is done! */ |
951 | static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr, | 965 | static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr, |
@@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data); | |||
1150 | EXPORT_SYMBOL(i2c_smbus_write_word_data); | 1164 | EXPORT_SYMBOL(i2c_smbus_write_word_data); |
1151 | EXPORT_SYMBOL(i2c_smbus_write_block_data); | 1165 | EXPORT_SYMBOL(i2c_smbus_write_block_data); |
1152 | EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data); | 1166 | EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data); |
1167 | EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data); | ||
1153 | 1168 | ||
1154 | MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); | 1169 | MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); |
1155 | MODULE_DESCRIPTION("I2C-Bus main module"); | 1170 | MODULE_DESCRIPTION("I2C-Bus main module"); |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 7863a59bd598..63f1d63cc1d8 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -100,6 +100,9 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | |||
100 | /* Returns the number of read bytes */ | 100 | /* Returns the number of read bytes */ |
101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
102 | u8 command, u8 *values); | 102 | u8 command, u8 *values); |
103 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | ||
104 | u8 command, u8 length, | ||
105 | u8 *values); | ||
103 | 106 | ||
104 | /* | 107 | /* |
105 | * A driver is capable of handling one or more physical devices present on | 108 | * A driver is capable of handling one or more physical devices present on |