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>
This commit is contained in:
parent
47108c3c86
commit
c722d40fad
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue