drivers: spi: stm32: fix SPI being left on in slave mode
The current implementation unconditionally enables the SPI (sets SPI_CR1_SPE) in transceive(), but disables it only in master mode. The peripheral should only be enabled while the user has specifically requested I/O. Fix this by always disabling the peripheral when I/O is complete. Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This commit is contained in:
parent
b13b2c591e
commit
78214d0569
1 changed files with 2 additions and 1 deletions
|
@ -62,9 +62,10 @@ static void spi_stm32_complete(struct spi_stm32_data *data, SPI_TypeDef *spi,
|
||||||
while (LL_SPI_IsActiveFlag_BSY(spi)) {
|
while (LL_SPI_IsActiveFlag_BSY(spi)) {
|
||||||
/* NOP */
|
/* NOP */
|
||||||
}
|
}
|
||||||
LL_SPI_Disable(spi);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LL_SPI_Disable(spi);
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_STM32_INTERRUPT
|
#ifdef CONFIG_SPI_STM32_INTERRUPT
|
||||||
spi_context_complete(&data->ctx, status);
|
spi_context_complete(&data->ctx, status);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue