i2c: mvtwsi: Swab the register address if its size is > 1
authorStefan Roese <sr@denx.de>
Thu, 18 Nov 2021 08:18:41 +0000 (09:18 +0100)
committerHeiko Schocher <hs@denx.de>
Mon, 20 Dec 2021 06:57:48 +0000 (07:57 +0100)
commitccea46c05b08b34ef829d460e50e2ce9bc17cdc7
tree9c1968823a6680550160b4c074a4b3612283e283
parentd3213c26b56e564207515f1e28e663718e015dc3
i2c: mvtwsi: Swab the register address if its size is > 1

Testing on Armada XP with an EEPROM using register address with size
of 2 has shown, that the register address bytes are sent to the I2C
EEPROM in the incorrect order. This patch swabs the address bytes so
that the correct address is transferred to the I2C device.

BTW: This worked without any issues before migrating Armada XP to
DM I2C.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Pali Rohár <pali@kernel.org>
Cc: Marek Behún <marek.behun@nic.cz>
Tested-by: Marek Behún <marek.behun@nic.cz>
drivers/i2c/mvtwsi.c