Commit cccd9619 authored by Mahesh Mahadevan's avatar Mahesh Mahadevan Committed by Benjamin Cabé
Browse files

drivers: nxp_flexio_spi: Fix transfer failures



This fixes failures seen with the SPI loopback test.
The fix waits for the TX and RX side to be complete
i.e when RX SHIFTBUF has been loaded from the RX Shifter
and the TX SHIFTBUF has transferred to the TX Shifter.

Signed-off-by: default avatarMahesh Mahadevan <mahesh.mahadevan@nxp.com>
parent 73fd29f7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -102,11 +102,11 @@ static int spi_mcux_flexio_isr(void *user_data)
	const struct spi_mcux_flexio_config *config = dev->config;
	struct spi_mcux_flexio_data *data = dev->data;

#if defined(CONFIG_SOC_SERIES_KE1XZ)
	/* Wait until data transfer complete. */
	WAIT_FOR((0U == (FLEXIO_SPI_GetStatusFlags(config->flexio_spi)
		& (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)), 100, NULL);
#endif
	WAIT_FOR((3U == (FLEXIO_SPI_GetStatusFlags(config->flexio_spi)
		& (uint32_t)(kFLEXIO_SPI_TxBufferEmptyFlag | kFLEXIO_SPI_RxBufferFullFlag))),
		100, NULL);

	FLEXIO_SPI_MasterTransferHandleIRQ(config->flexio_spi, &data->handle);

	return 0;