I2C: JZ4780: Fix bug for Ingenic X1000.
author周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Fri, 19 Mar 2021 10:12:13 +0000 (18:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:08 +0000 (08:42 +0200)
commitdcdf0876b040060b63296df8dd9f2b515c1e170c
tree1ab348ac8c2f48575dd9475e799aed73fec25588
parentf295dfc831bc266810e354c59ec249eb6701d91d
I2C: JZ4780: Fix bug for Ingenic X1000.

[ Upstream commit 942bfbecc0281c75db84f744b9b77b0f2396f484 ]

Only send "X1000_I2C_DC_STOP" when last byte, or it will cause
error when I2C write operation which should look like this:

device_addr + w, reg_addr, data;

But without this patch, it looks like this:

device_addr + w, reg_addr, device_addr + w, data;

Fixes: 21575a7a8d4c ("I2C: JZ4780: Add support for the X1000.")
Reported-by: 杨文龙 (Yang Wenlong) <ywltyut@sina.cn>
Tested-by: 杨文龙 (Yang Wenlong) <ywltyut@sina.cn>
Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-jz4780.c