drivers: spi: stm32 ll driver disable the instance after completion
The spi_stm32_complete() is checking spi flags which are valid when the intance is still enable: disable afterwards. No more need to disable the DMA transfer then Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
parent
081e2d5a54
commit
0ce796398a
1 changed files with 4 additions and 2 deletions
|
@ -767,15 +767,17 @@ static int transceive_dma(const struct device *dev,
|
||||||
spi_context_update_rx(&data->ctx, 1, dma_len);
|
spi_context_update_rx(&data->ctx, 1, dma_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* spi complete relies on SPI Status Reg which cannot be disabled */
|
||||||
|
spi_stm32_complete(dev, ret);
|
||||||
|
/* disable spi instance after completion */
|
||||||
LL_SPI_Disable(spi);
|
LL_SPI_Disable(spi);
|
||||||
|
/* The Config. Reg. on some mcus is write un-protected when SPI is disabled */
|
||||||
LL_SPI_DisableDMAReq_TX(spi);
|
LL_SPI_DisableDMAReq_TX(spi);
|
||||||
LL_SPI_DisableDMAReq_RX(spi);
|
LL_SPI_DisableDMAReq_RX(spi);
|
||||||
|
|
||||||
dma_stop(data->dma_rx.dma_dev, data->dma_rx.channel);
|
dma_stop(data->dma_rx.dma_dev, data->dma_rx.channel);
|
||||||
dma_stop(data->dma_tx.dma_dev, data->dma_tx.channel);
|
dma_stop(data->dma_tx.dma_dev, data->dma_tx.channel);
|
||||||
|
|
||||||
spi_stm32_complete(dev, ret);
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
spi_context_release(&data->ctx, ret);
|
spi_context_release(&data->ctx, ret);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue