Skip to content

Commit 914a7b3

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: rcar: in slave mode, clear NACK earlier
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: de20d18 ("i2c: rcar: add slave support") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent e4682b8 commit 914a7b3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/i2c/busses/i2c-rcar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
590590
/* master sent stop */
591591
if (ssr_filtered & SSR) {
592592
i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value);
593+
rcar_i2c_write(priv, ICSCR, SIE | SDBS); /* clear our NACK */
593594
rcar_i2c_write(priv, ICSIER, SAR);
594595
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
595596
}

0 commit comments

Comments
 (0)