summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2020-08-17 14:19:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-03 11:24:23 +0200
commit69a11b99ce82be228138aa565e7ba2b63b77bc6e (patch)
tree80b5b6e01c23340b4b49b2d855dcabfd19902271 /drivers/i2c/busses
parent515903c16bde320ba4c9fbce97944f1214d7a464 (diff)
downloadlinux-stable-69a11b99ce82be228138aa565e7ba2b63b77bc6e.tar.gz
linux-stable-69a11b99ce82be228138aa565e7ba2b63b77bc6e.tar.bz2
linux-stable-69a11b99ce82be228138aa565e7ba2b63b77bc6e.zip
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>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-rcar.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index dcdce18fc706..f9029800d399 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -594,6 +594,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
/* master sent stop */
if (ssr_filtered & SSR) {
i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value);
+ rcar_i2c_write(priv, ICSCR, SIE | SDBS); /* clear our NACK */
rcar_i2c_write(priv, ICSIER, SAR);
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
}