Browse Source

drivers: spi: spi_pl022: disable the SSP before reconfiguring

When reconfiguring the SSP, some changes do not immediately take effect
in particular changes to the clock polarity are not applied. Disabling
and re-enabling the SSP forces the new configuration to take effect
immediately.

Signed-off-by: George Norton <george_norton_uk@hotmail.com>
pull/91704/merge
George Norton 4 weeks ago committed by Anas Nashif
parent
commit
c722d40fad
  1. 2
      drivers/spi/spi_pl022.c

2
drivers/spi/spi_pl022.c

@ -406,6 +406,8 @@ static int spi_pl022_configure(const struct device *dev, @@ -406,6 +406,8 @@ static int spi_pl022_configure(const struct device *dev,
cr1 |= SSP_CR1_MASK_SSE; /* Always enable SPI */
cr1 |= (op & SPI_MODE_LOOP) ? SSP_CR1_MASK_LBM : 0;
/* Disable the SSP before it is reconfigured */
SSP_WRITE_REG(SSP_CR1(cfg->reg), 0);
SSP_WRITE_REG(SSP_CPSR(cfg->reg), prescale);
SSP_WRITE_REG(SSP_CR0(cfg->reg), cr0);
SSP_WRITE_REG(SSP_CR1(cfg->reg), cr1);

Loading…
Cancel
Save