Re: [PATCH] i2c: rcar: in slave mode, clear NACK earlier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

Thanks for your work.

On 2020-08-17 14:19:30 +0200, Wolfram Sang wrote:
> 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@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>

> ---
>  drivers/i2c/busses/i2c-rcar.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 284dc3edb9a1..0f73f0681a6e 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);
>  	}
> -- 
> 2.20.1
> 

-- 
Regards,
Niklas Söderlund



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux