summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/stm32-usart.c
diff options
context:
space:
mode:
authorErwan Le Ray <erwan.leray@foss.st.com>2022-02-03 20:16:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-08 13:07:16 +0300
commit7547d9ab03720e9ef3e300b12c57f380310a6e30 (patch)
treedbc69b553d1efeaead885066c3aac8f0ef70ca15 /drivers/tty/serial/stm32-usart.c
parent9978c2f14f20a1aaea3840c16220ef64e4ad1872 (diff)
downloadlinux-7547d9ab03720e9ef3e300b12c57f380310a6e30.tar.xz
serial: stm32: enable / disable wake irqs for mcrtl_gpio wakeup sources
Enable mctrl_gpio wake_irq if device_may_wakeup when usart is suspended, and disable mctrl_gpios wake_irq if device_may_wakeup when usart is resumed. Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com> Link: https://lore.kernel.org/r/20220203171644.12231-3-erwan.leray@foss.st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/stm32-usart.c')
-rw-r--r--drivers/tty/serial/stm32-usart.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 9570002d07e7..1b3a611ac39e 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1756,6 +1756,7 @@ static int __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port,
if (enable) {
stm32_usart_set_bits(port, ofs->cr1, USART_CR1_UESM);
stm32_usart_set_bits(port, ofs->cr3, USART_CR3_WUFIE);
+ mctrl_gpio_enable_irq_wake(stm32_port->gpios);
/*
* When DMA is used for reception, it must be disabled before
@@ -1782,7 +1783,7 @@ static int __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port,
if (ret)
return ret;
}
-
+ mctrl_gpio_disable_irq_wake(stm32_port->gpios);
stm32_usart_clr_bits(port, ofs->cr1, USART_CR1_UESM);
stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_WUFIE);
}