Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c074c39d authored by Jean Delvare's avatar Jean Delvare
Browse files

i2c-i801: Don't use the block buffer for I2C block writes



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: default avatarFelix Rubinstein <felixru@gmail.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Oleg Ryjkov <oryjkov@gmail.com>
Cc: stable@kernel.org
parent 8e4b980c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);