mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
arch/arm64/imx9: Reset rx fifo in mode change
instead of looping just reset rxfifo Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
This commit is contained in:
committed by
Xiang Xiao
parent
5609c3d416
commit
ed8bfdd26a
@@ -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);
|
imx9_lpspi_modifytcr(priv, clrbits, setbits);
|
||||||
|
|
||||||
while ((imx9_lpspi_getreg32(priv, IMX9_LPSPI_RSR_OFFSET) &
|
/* Reset SPI read FIFO */
|
||||||
LPSPI_RSR_RXEMPTY) != LPSPI_RSR_RXEMPTY)
|
|
||||||
{
|
|
||||||
/* Flush 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 */
|
/* Save the mode so that subsequent re-configurations will be faster */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user