Skip to content

Commit b7c0562

Browse files
committed
Merge tag 'regmap-fix-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fix from Mark Brown: "The I2C bus was not taking account of the register and any padding bytes when handling maximum write sizes supported by an I2C adaptor, this patch from Jim Wylder fixes that" * tag 'regmap-fix-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap-i2c: Subtract reg size from max_write
2 parents 0f9a751 + 611b7eb commit b7c0562

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/base/regmap/regmap-i2c.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
350350

351351
if (quirks->max_write_len &&
352352
(bus->max_raw_write == 0 || bus->max_raw_write > quirks->max_write_len))
353-
max_write = quirks->max_write_len;
353+
max_write = quirks->max_write_len -
354+
(config->reg_bits + config->pad_bits) / BITS_PER_BYTE;
354355

355356
if (max_read || max_write) {
356357
ret_bus = kmemdup(bus, sizeof(*bus), GFP_KERNEL);

0 commit comments

Comments
 (0)