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>
This commit is contained in:
Anke Xiao 2024-08-12 16:11:44 +08:00 committed by Anas Nashif
commit 04ae22eb22

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, STRIM, ALC
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -100,6 +101,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
FLEXIO_SPI_MasterTransferHandleIRQ(config->flexio_spi, &data->handle);
return 0;