i2c: rcar: in slave mode, clear NACK earlier
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 17 Aug 2020 12:19:30 +0000 (14:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:28 +0000 (11:29 +0200)
commitb9080a8d8237182f129f7fe81d466b0f4e5b39c9
treecd7bd758518646c1e8a814e0ede4e9de1003fa45
parentf24ffc31709b0da51dc84cdbedad4cc6f17052c2
i2c: rcar: in slave mode, clear NACK earlier

[ Upstream commit 914a7b3563b8fb92f976619bbd0fa3a4a708baae ]

Currently, a NACK in slave mode is set/cleared when SCL is held low by
the IP core right before the bit is about to be pushed out. This is too
late for clearing and then a NACK from the previous byte is still used
for the current one. Now, let's clear the NACK right after we detected
the STOP condition following the NACK.

Fixes: de20d1857dd6 ("i2c: rcar: add slave support")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-rcar.c