summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-03-13 20:56:53 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 16:01:12 -0700
commit266623b31c992d23a8651b15032c365e8db39fe2 (patch)
tree61b67f5489697ff448f91294a32f8982a676748c /drivers
parenta9eaacfdf1ca545dcc62ace6ecd76da2aa37d18b (diff)
downloadkernel-crypto-266623b31c992d23a8651b15032c365e8db39fe2.tar.gz
kernel-crypto-266623b31c992d23a8651b15032c365e8db39fe2.tar.xz
kernel-crypto-266623b31c992d23a8651b15032c365e8db39fe2.zip
i2c-i801: Don't use the block buffer for I2C block writes
commit c074c39d62306efa5ba7c69c1a1531bc7333d252 upstream. Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation. Reported-by: Felix Rubinstein <felixru@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Oleg Ryjkov <oryjkov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-i801.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index df6ab553f97..5574be2ae6f 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -415,9 +415,11 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
data->block[0] = 32; /* max for SMBus block reads */
}
+ /* Experience has shown that the block buffer can only be used for
+ SMBus (not I2C) block transactions, even though the datasheet
+ doesn't mention this limitation. */
if ((i801_features & FEATURE_BLOCK_BUFFER)
- && !(command == I2C_SMBUS_I2C_BLOCK_DATA
- && read_write == I2C_SMBUS_READ)
+ && command != I2C_SMBUS_I2C_BLOCK_DATA
&& i801_set_block_buffer_mode() == 0)
result = i801_block_transaction_by_block(data, read_write,
hwpec);