i2c: rcar: in slave mode, clear NACK earlier
[ Upstream commit914a7b3563
] 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:de20d1857d
("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>
This commit is contained in:
parent
883ed72723
commit
262f5fbad9
|
@ -587,6 +587,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
|
||||||
/* master sent stop */
|
/* master sent stop */
|
||||||
if (ssr_filtered & SSR) {
|
if (ssr_filtered & SSR) {
|
||||||
i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value);
|
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, ICSIER, SAR);
|
||||||
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
|
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue