2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/i2c
Sven Eckelmann 82b350dd81 i2c: rtl9300: Add missing count byte for SMBus Block Ops
The expected on-wire format of an SMBus Block Write is

  S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P

Everything starting from the Count byte is provided by the I2C subsystem in
the array data->block. But the driver was skipping the Count byte
(data->block[0]) when sending it to the RTL93xx I2C controller.

Only the actual data could be seen on the wire:

  S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P

This wire format is not SMBus Block Write compatible but matches the format
of an I2C Block Write. Simply adding the count byte to the buffer for the
I2C controller is enough to fix the transmission.

This also affects read because the I2C controller must receive the count
byte + $count * data bytes.

Fixes: c366be7202 ("i2c: Add driver for the RTL9300 I2C controller")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: <stable@vger.kernel.org> # v6.13+
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-4-cd9dca0db722@narfation.org
2025-08-19 20:21:03 -01:00
..
algos i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
busses i2c: rtl9300: Add missing count byte for SMBus Block Ops 2025-08-19 20:21:03 -01:00
muxes treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
i2c-atr.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-boardinfo.c i2c: Remove support for dangling device properties 2021-04-10 21:43:02 +02:00
i2c-core-acpi.c i2c: Force DLL0945 touchpad i2c freq to 100khz 2025-08-03 22:36:42 +02:00
i2c-core-base.c i2c-for-6.17-rc1 2025-07-29 11:35:24 -07:00
i2c-core-of-prober.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i2c-core-of.c i2c: core: Do not dereference fwnode in struct device 2025-04-16 18:08:32 +02:00
i2c-core-slave.c i2c: core: Unify the firmware node type check 2025-04-16 18:05:47 +02:00
i2c-core-smbus.c i2c: Use str_read_write() helper 2025-05-23 17:28:07 +02:00
i2c-core.h i2c: Unexport i2c_of_match_device() 2025-02-13 16:47:52 +01:00
i2c-dev.c i2c: dev: Fix memory leak when underlying adapter does not support I2C 2024-11-14 11:22:57 +01:00
i2c-mux.c i2c: use inclusive callbacks in struct i2c_algorithm 2025-06-12 10:05:31 +02:00
i2c-slave-eeprom.c sysfs: treewide: switch back to bin_attribute::read()/write() 2025-06-17 10:44:13 +02:00
i2c-slave-testunit.c i2c: testunit: on errors, repeat NACK until STOP 2025-01-15 19:44:21 +01:00
i2c-smbus.c i2c: smbus: introduce Write Disable-aware SPD instantiating functions 2025-05-19 22:23:57 +02:00
i2c-stub.c i2c: stub: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
Kconfig i2c: Remove I2C_COMPAT config symbol and related code 2024-09-07 18:31:28 +02:00
Makefile i2c: Introduce OF component probe function 2024-11-27 12:04:10 +01:00