Skip to content

Commit

Permalink
arch/arm64/src/imx9/imx9_lpi2c.c: Clear NACK properly on last RX byte
Browse files Browse the repository at this point in the history
Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Nov 20, 2024
1 parent 76a67fd commit 07f936a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/arm64/src/imx9/imx9_lpi2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,9 +1485,10 @@ static int imx9_lpi2c_isr_process(struct imx9_lpi2c_priv_s *priv)

/* Ignore NACK on RX last byte - this is normal */

if ((status & LPI2C_MSR_NDF) != 0 && (priv->flags & I2C_M_READ) != 0 &&
priv->dcnt == 1)
if ((status & (LPI2C_MSR_RDF | LPI2C_MSR_NDF)) ==
(LPI2C_MSR_RDF | LPI2C_MSR_NDF) && priv->dcnt == 1)
{
imx9_lpi2c_putreg(priv, IMX9_LPI2C_MSR_OFFSET, LPI2C_MSR_NDF);
status &= ~LPI2C_MSR_NDF;
}

Expand Down

0 comments on commit 07f936a

Please sign in to comment.