Skip to content

Commit

Permalink
driver: spi: gd32: fix spi reg clear wrong flag
Browse files Browse the repository at this point in the history
SPI DMATEN and DMAREN flags are in SPI_CTL1 register. fixed wrong register.

Signed-off-by: Chang Feng <[email protected]>
  • Loading branch information
chang196700 authored and aescolar committed Jul 1, 2024
1 parent ac4878e commit 971a0d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/spi/spi_gd32.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,13 @@ static int spi_gd32_transceive_impl(const struct device *dev,

#ifdef CONFIG_SPI_GD32_DMA
dma_error:
SPI_CTL1(cfg->reg) &=
~(SPI_CTL1_DMATEN | SPI_CTL1_DMAREN);
#endif
spi_context_cs_control(&data->ctx, false);

SPI_CTL0(cfg->reg) &=
~(SPI_CTL0_SPIEN | SPI_CTL1_DMATEN | SPI_CTL1_DMAREN);
~(SPI_CTL0_SPIEN);

error:
spi_context_release(&data->ctx, ret);
Expand Down

0 comments on commit 971a0d1

Please sign in to comment.