mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefano Radaelli <stefano.radaelli21@gmail.com>
To: Frank Li <Frank.Li@nxp.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-serial@vger.kernel.org
Cc: luan.r@variscite.com, alifer.m@variscite.com,
	pierluigi.p@variscite.com,
	"Stefano Radaelli" <stefano.r@variscite.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Shitalkumar Gandhi" <shital.gandhi45@gmail.com>,
	"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Karl Mehltretter" <kmehltretter@gmail.com>,
	"John Ogness" <john.ogness@linutronix.de>,
	"Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>,
	"Fugang Duan" <fugang.duan@nxp.com>
Subject: [PATCH v1 3/3] serial: fsl_lpuart: Enable TTY wakeup for wakeup-source ports
Date: Tue,  3 Nov 2026 16:51:27 +0100	[thread overview]
Message-ID: <58d65b44ca054ea83eb835bf5decebd688cad04d.1793719239.git.stefano.r@variscite.com> (raw)
In-Reply-To: <cover.1793719239.git.stefano.r@variscite.com>

From: Stefano Radaelli <stefano.r@variscite.com>

LPUART checks the TTY wakeup policy when preparing a port for system
suspend, but does not currently use the wakeup-source DT property.
Consequently, userspace must enable TTY wakeup even for ports marked as
wakeup sources.

Set tty_wakeup_default from wakeup-source before registering the port.
For TTY ports with the property, the serial core then enables wakeup at
registration. Ports without it keep the existing default, and userspace
can still disable wakeup through power/wakeup. The port must still be
open and initialized for receive activity to wake the system.

Tested on a Variscite VAR-SOM-MX93 with a Symphony carrier board using
LPUART1 (ttyLP0) as the console. With wakeup-source present, power/wakeup
was enabled after boot without a userspace write. After requesting deep
suspend, the board stayed suspended until Enter was pressed on the serial
console, then resumed.

Signed-off-by: Stefano Radaelli <stefano.r@variscite.com>
---
 drivers/tty/serial/fsl_lpuart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index c8575c965203..35397152a39b 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2905,6 +2905,7 @@ static int lpuart_probe(struct platform_device *pdev)
 		sport->port.ops = &lpuart_pops;
 	sport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LPUART_CONSOLE);
 	sport->port.flags = UPF_BOOT_AUTOCONF;
+	sport->port.tty_wakeup_default = of_property_read_bool(np, "wakeup-source");
 
 	if (lpuart_is_32(sport))
 		sport->port.rs485_config = lpuart32_config_rs485;
-- 
2.47.3


      parent reply	other threads:[~2026-11-03 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:51 [PATCH v1 0/3] serial: Support driver-selected TTY wakeup defaults Stefano Radaelli
2026-11-03 15:51 ` [PATCH v1 1/3] dt-bindings: serial: fsl-lpuart: Allow wakeup-source Stefano Radaelli
2026-11-03 15:51 ` [PATCH v1 2/3] serial: core: Allow drivers to enable TTY wakeup at registration Stefano Radaelli
2026-11-03 15:51 ` Stefano Radaelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58d65b44ca054ea83eb835bf5decebd688cad04d.1793719239.git.stefano.r@variscite.com \
    --to=stefano.radaelli21@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=alifer.m@variscite.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fugang.duan@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=kmehltretter@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=luan.r@variscite.com \
    --cc=peng.fan@nxp.com \
    --cc=pierluigi.p@variscite.com \
    --cc=robh@kernel.org \
    --cc=shital.gandhi45@gmail.com \
    --cc=stefano.r@variscite.com \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®