drivers: spi: update spi_mcux_flexio.c

After testing the flexio spi_loopback on the ke1xz platform,
it is found that the master transfer and receive are not
synchronized. So add loop code to wait for the master transfer
to complete for frdm_ke17z and frdm_ke17z512 platforms.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
diff --git a/drivers/spi/spi_mcux_flexio.c b/drivers/spi/spi_mcux_flexio.c
index 1e00792..2b6e693 100644
--- a/drivers/spi/spi_mcux_flexio.c
+++ b/drivers/spi/spi_mcux_flexio.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2024, STRIM, ALC
+ * Copyright 2024 NXP
  *
  * SPDX-License-Identifier: Apache-2.0
  */
@@ -100,6 +101,11 @@
 	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
 	FLEXIO_SPI_MasterTransferHandleIRQ(config->flexio_spi, &data->handle);
 
 	return 0;