Skip to content

Commit 2594eae

Browse files
Martinhoff-makerkartben
authored andcommitted
drivers: uart: silabs: revert pm deletion for usart_gecko
Revert delete of the uart_gecko_pm_action function. Signed-off-by: Martin Hoff <[email protected]>
1 parent 57189b4 commit 2594eae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/serial/uart_gecko.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,31 @@ static int uart_gecko_init(const struct device *dev)
669669
return 0;
670670
}
671671

672+
#ifdef CONFIG_PM_DEVICE
673+
static int uart_gecko_pm_action(const struct device *dev, enum pm_device_action action)
674+
{
675+
__maybe_unused const struct uart_gecko_config *config = dev->config;
676+
677+
switch (action) {
678+
case PM_DEVICE_ACTION_SUSPEND:
679+
#ifdef USART_STATUS_TXIDLE
680+
/* Wait for TX FIFO to flush before suspending */
681+
while (!(USART_StatusGet(config->base) & USART_STATUS_TXIDLE)) {
682+
}
683+
#endif
684+
break;
685+
686+
case PM_DEVICE_ACTION_RESUME:
687+
break;
688+
689+
default:
690+
return -ENOTSUP;
691+
}
692+
693+
return 0;
694+
}
695+
#endif
696+
672697
static DEVICE_API(uart, uart_gecko_driver_api) = {
673698
.poll_in = uart_gecko_poll_in,
674699
.poll_out = uart_gecko_poll_out,

0 commit comments

Comments
 (0)