diff options
author | Erwan Le Ray <erwan.leray@foss.st.com> | 2022-02-03 18:16:44 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-08 11:07:16 +0100 |
commit | 7547d9ab03720e9ef3e300b12c57f380310a6e30 (patch) | |
tree | dbc69b553d1efeaead885066c3aac8f0ef70ca15 /drivers/tty/serial/stm32-usart.c | |
parent | 9978c2f14f20a1aaea3840c16220ef64e4ad1872 (diff) | |
download | linux-stable-7547d9ab03720e9ef3e300b12c57f380310a6e30.tar.gz linux-stable-7547d9ab03720e9ef3e300b12c57f380310a6e30.tar.bz2 linux-stable-7547d9ab03720e9ef3e300b12c57f380310a6e30.zip |
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.c | 3 |
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); } |