[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240523075819.1285554-6-msp@baylibre.com>
Date: Thu, 23 May 2024 09:58:19 +0200
From: Markus Schneider-Pargmann <msp@...libre.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Tony Lindgren <tony@...mide.com>,
John Ogness <john.ogness@...utronix.de>,
Markus Schneider-Pargmann <msp@...libre.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Ronald Wahl <ronald.wahl@...itan.com>,
Thomas Richard <thomas.richard@...tlin.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Vignesh Raghavendra <vigneshr@...com>
Cc: Vibhore Vardhan <vibhore@...com>,
Kevin Hilman <khilman@...libre.com>,
Dhruva Gole <d-gole@...com>,
linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org,
devicetree@...r.kernel.org
Subject: [PATCH 5/5] serial: 8250: omap: Set wakeup pinctrl on suspend
To enable the serial driver and it's pin to be a wakeup source in
suspend to ram states, select the wakeup pinctrl state on suspend and
restore the default pinctrl state on resume.
Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>
---
drivers/tty/serial/8250/8250_omap.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 617a421a1396..61f056c4e78e 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1663,6 +1663,13 @@ static int omap8250_suspend(struct device *dev)
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
int err = 0;
+ err = omap8250_select_wakeup_pinctrl(dev, priv);
+ if (err) {
+ dev_err(dev, "Failed to select wakeup pinctrl, aborting suspend %pe\n",
+ ERR_PTR(err));
+ return err;
+ }
+
serial8250_suspend_port(priv->line);
err = pm_runtime_resume_and_get(dev);
@@ -1696,6 +1703,13 @@ static int omap8250_resume(struct device *dev)
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
int err;
+ err = pinctrl_select_default_state(dev);
+ if (err) {
+ dev_err(dev, "Failed to select default pinctrl state on resume: %pe\n",
+ ERR_PTR(err));
+ return err;
+ }
+
if (uart_console(&up->port) && console_suspend_enabled) {
if (console_suspend_enabled) {
err = pm_runtime_force_resume(dev);
--
2.43.0
Powered by blists - more mailing lists