Skip to content

Commit

Permalink
arch/arm64/imx9: Reset rx fifo in mode change
Browse files Browse the repository at this point in the history
instead of looping just reset rxfifo

Signed-off-by: Jouni Ukkonen <[email protected]>
  • Loading branch information
joukkone authored and xiaoxiang781216 committed Nov 7, 2024
1 parent 5609c3d commit ed8bfdd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions arch/arm64/src/imx9/imx9_lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,13 +1021,10 @@ static void imx9_lpspi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)

imx9_lpspi_modifytcr(priv, clrbits, setbits);

while ((imx9_lpspi_getreg32(priv, IMX9_LPSPI_RSR_OFFSET) &
LPSPI_RSR_RXEMPTY) != LPSPI_RSR_RXEMPTY)
{
/* Flush SPI read FIFO */
/* Reset SPI read FIFO */

imx9_lpspi_getreg32(priv, IMX9_LPSPI_RSR_OFFSET);
}
imx9_lpspi_modifyreg32(priv, IMX9_LPSPI_CR_OFFSET, 0,
LPSPI_CR_RRF);

/* Save the mode so that subsequent re-configurations will be faster */

Expand Down

0 comments on commit ed8bfdd

Please sign in to comment.