File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,31 @@ static int uart_gecko_init(const struct device *dev)
669
669
return 0 ;
670
670
}
671
671
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
+
672
697
static DEVICE_API (uart , uart_gecko_driver_api ) = {
673
698
.poll_in = uart_gecko_poll_in ,
674
699
.poll_out = uart_gecko_poll_out ,
You can’t perform that action at this time.
0 commit comments