i2c-i801: Don't use the block buffer for I2C block writes
authorJean Delvare <khali@linux-fr.org>
Sat, 13 Mar 2010 19:56:53 +0000 (20:56 +0100)
committerJean Delvare <khali@linux-fr.org>
Sat, 13 Mar 2010 19:56:53 +0000 (20:56 +0100)
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>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-i801.c

index 9da5b05cdb528b7eebf34c7778f34e8725c39b77..299b918455a36999242027de9312fe98ce811db7 100644 (file)
@@ -416,9 +416,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);