drivers: spi_mcux_lpspi: Fix DMA path on RT
Apparently, the previous change to fix the chip select only works on some newer revisions of the LPSPI, and the behavior is different on older parts like RT. For now put some #ifdef to keep the fixed CS on MCXN but have the old behavior on RT and other platforms. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
parent
b6b8eeedf0
commit
92d0287813
|
@ -483,7 +483,9 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SOC_SERIES_MCXN
|
||||
base->TCR |= LPSPI_TCR_CONT_MASK;
|
||||
#endif
|
||||
|
||||
/* DMA is fast enough watermarks are not required */
|
||||
LPSPI_SetFifoWatermarks(base, 0U, 0U);
|
||||
|
@ -500,9 +502,11 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi
|
|||
goto out;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SOC_SERIES_MCXN
|
||||
while (!(LPSPI_GetStatusFlags(base) & kLPSPI_TxDataRequestFlag)) {
|
||||
/* wait until previous tx finished */
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Enable DMA Requests */
|
||||
LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable);
|
||||
|
@ -513,6 +517,12 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi
|
|||
goto out;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SOC_SERIES_MCXN
|
||||
while ((LPSPI_GetStatusFlags(base) & kLPSPI_ModuleBusyFlag)) {
|
||||
/* wait until module is idle */
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Disable DMA */
|
||||
LPSPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable);
|
||||
|
||||
|
|
Loading…
Reference in New Issue