Skip to content

Commit

Permalink
drivers: spi: silabs: eusart: Always enable peripheral
Browse files Browse the repository at this point in the history
The EUSART peripheral must always be enabled in configure(), as
its enable state gets cleared when the state machine is unretained
in deep sleep. The rest of the config registers are retained,
so they can continue to not be repainted on every configure() if
the context is the same as last time.

Remove unnecessary duplicated enable at the end of configure(),
the SPIInit HAL function already performs enable.

Signed-off-by: Aksel Skauge Mellbye <[email protected]>
  • Loading branch information
asmellby authored and kartben committed Jan 23, 2025
1 parent 12240a9 commit 14a00f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/spi/spi_silabs_eusart.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ static int spi_silabs_eusart_configure(const struct device *dev, const struct sp
spi_frequency /= 2;

if (spi_context_configured(&data->ctx, config)) {
/* Already configured. No need to do it again. */
/* Already configured. No need to do it again, but must re-enable in case
* TXEN/RXEN were cleared due to deep sleep.
*/
EUSART_Enable(eusart_config->base, eusartEnable);

return 0;
}

Expand Down Expand Up @@ -145,9 +149,6 @@ static int spi_silabs_eusart_configure(const struct device *dev, const struct sp

data->ctx.config = config;

/* Enable the peripheral */
eusart_config->base->CMD = (uint32_t)eusartEnable;

return 0;
}

Expand Down

0 comments on commit 14a00f2

Please sign in to comment.