Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: fsl_lpuart: Add missing wakeup event reporting

Current lpuart wakeup event would not report itself as wakeup source
through sysfs. Add pm_wakeup_event() to support it.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250924025607.2515833-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sherry Sun and committed by
Greg Kroah-Hartman
18bdfccf 08a0dd5a

+8
+8
drivers/tty/serial/fsl_lpuart.c
··· 3087 3087 static int lpuart_resume_noirq(struct device *dev) 3088 3088 { 3089 3089 struct lpuart_port *sport = dev_get_drvdata(dev); 3090 + struct tty_port *port = &sport->port.state->port; 3091 + bool wake_active; 3090 3092 u32 stat; 3091 3093 3092 3094 pinctrl_pm_select_default_state(dev); ··· 3100 3098 if (lpuart_is_32(sport)) { 3101 3099 stat = lpuart32_read(&sport->port, UARTSTAT); 3102 3100 lpuart32_write(&sport->port, stat, UARTSTAT); 3101 + 3102 + /* check whether lpuart wakeup was triggered */ 3103 + wake_active = stat & (UARTSTAT_RDRF | UARTSTAT_RXEDGIF); 3104 + 3105 + if (wake_active && irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq))) 3106 + pm_wakeup_event(tty_port_tty_get(port)->dev, 0); 3103 3107 } 3104 3108 } 3105 3109