s32k1xx:lpi2c end only on stop with end of packet

This commit is contained in:
David Sidrane 2023-10-24 03:17:26 -07:00 committed by Petro Karashchenko
parent b2b5826b80
commit 8cb65d9b3b

View File

@ -1452,13 +1452,20 @@ static int s32k1xx_lpi2c_isr_process(struct s32k1xx_lpi2c_priv_s *priv)
LPI2C_MSR_FEF | LPI2C_MSR_EPF)));
}
/* Check for endof packet */
/* Check for endof packet or Stop */
if ((status & (LPI2C_MSR_EPF | LPI2C_MSR_SDF)) != 0)
{
/* Reset either or both */
s32k1xx_lpi2c_putreg(priv, S32K1XX_LPI2C_MSR_OFFSET, status &
(LPI2C_MSR_EPF | LPI2C_MSR_SDF));
/* Was it both End of packet and Stop */
if ((status & (LPI2C_MSR_EPF | LPI2C_MSR_SDF)) ==
(LPI2C_MSR_EPF | LPI2C_MSR_SDF))
{
#ifndef CONFIG_I2C_POLLED
if (priv->intstate == INTSTATE_WAITING)
{
@ -1478,6 +1485,7 @@ static int s32k1xx_lpi2c_isr_process(struct s32k1xx_lpi2c_priv_s *priv)
priv->intstate = INTSTATE_DONE;
#endif
}
}
return OK;
}