regmap-i2c: Use i2c block command only if register value width is 8 bit
authorGuenter Roeck <linux@roeck-us.net>
Tue, 21 Jun 2016 18:04:23 +0000 (11:04 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jun 2016 12:50:51 +0000 (13:50 +0100)
commitd4ef930638086aa40d14f245799cf7c56aaa91ff
tree31f49b4e2d5c839ca1ff1961355a7790d00f56f4
parent1a695a905c18548062509178b98bc91e67510864
regmap-i2c: Use i2c block command only if register value width is 8 bit

Chips with 16-bit registers don't usually work well with I2C block
commands. For example, neither the LM75 datasheet nor the TMP102 datasheet
mentions block command support, and in fact it does not work for any of
those chips. Also, it is not clear how the block command would handle
16-bit SMBus operations in the fist place, since the data format associated
with those commands is either little endian or big endian, which requires
some kind of conversion to or from host byte order.

Only use i2c block commands if both register and value width is 8 bit.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-i2c.c