You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/02/22 12:34:35 UTC
(nuttx) branch master updated: Deinitialize ESP32-S3 SPI slave GDMA engine
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new d2b4734756 Deinitialize ESP32-S3 SPI slave GDMA engine
d2b4734756 is described below
commit d2b473475671a2ae0d59c0f9cd2de422e5b3e0f1
Author: nuttxs <zh...@sony.com>
AuthorDate: Thu Feb 22 18:05:25 2024 +0800
Deinitialize ESP32-S3 SPI slave GDMA engine
---
arch/xtensa/src/esp32s3/esp32s3_spi_slave.c | 31 ++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/arch/xtensa/src/esp32s3/esp32s3_spi_slave.c b/arch/xtensa/src/esp32s3/esp32s3_spi_slave.c
index cc875bffef..a763563a3b 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_spi_slave.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_spi_slave.c
@@ -1150,6 +1150,35 @@ void spislave_dma_init(struct spislave_priv_s *priv)
resetbits(SPI_RX_EOF_EN_M, SPI_DMA_CONF_REG(priv->config->id));
}
+
+/****************************************************************************
+ * Name: spislave_dma_deinit
+ *
+ * Description:
+ * Deinitialize ESP32-S3 SPI slave GDMA engine.
+ *
+ * Input Parameters:
+ * dev - Device-specific state data
+ *
+ * Returned Value:
+ * None.
+ *
+ ****************************************************************************/
+
+void spislave_dma_deinit(struct spislave_priv_s *priv)
+{
+ /* Release a DMA channel from peripheral */
+
+ esp32s3_dma_release(priv->dma_channel);
+
+ /* Deinitialize DMA controller */
+
+ esp32s3_dma_deinit();
+
+ /* Disable DMA clock for the SPI peripheral */
+
+ modifyreg32(SYSTEM_PERIP_CLK_EN0_REG, priv->config->dma_clk_bit, 0);
+}
#endif
/****************************************************************************
@@ -1390,7 +1419,7 @@ static void spislave_deinitialize(struct spi_slave_ctrlr_s *ctrlr)
resetbits(SPI_TRANS_DONE_INT_ENA_M, SPI_DMA_INT_ENA_REG(priv->config->id));
#ifdef CONFIG_ESP32S3_SPI_DMA
- resetbits(priv->config->dma_clk_bit, SYSTEM_PERIP_CLK_EN0_REG);
+ spislave_dma_deinit(priv);
priv->rx_dma_offset = 0;
#endif