drivers: uart: stm32: Enable wakeup source only if supported

LL_USART_EnableInStopMode may not be available on some series.
Since PM is not enabled on those series and might never be, use a
shortcut for this case.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-08-12 18:04:03 +02:00 committed by Kumar Gala
commit 6b14c4bdb0

View file

@ -1676,7 +1676,7 @@ static int uart_stm32_init(const struct device *dev)
config->irq_config_func(dev);
#endif /* CONFIG_PM || CONFIG_UART_INTERRUPT_DRIVEN || CONFIG_UART_ASYNC_API */
#if defined(CONFIG_PM)
#if defined(CONFIG_PM) && defined(IS_UART_WAKEUP_FROMSTOP_INSTANCE)
if (config->wakeup_source) {
/* Enable ability to wakeup device in Stop mode
* Effect depends on CONFIG_PM_DEVICE status: