linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: 8250: omap: Add pinctrl support for suspend
@ 2014-11-06 19:07 Sebastian Andrzej Siewior
  2014-11-06 19:15 ` Nishanth Menon
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-11-06 19:07 UTC (permalink / raw)
  To: linux-serial
  Cc: Greg Kroah-Hartman, linux-omap, Sebastian Andrzej Siewior,
	Dave Gerlach, Nishanth Menon

This is mostly an equivalent for the 8250-omap driver based on a patch
of Dave Gerlach for the omap-serial driver (which is not yet merged).

>From his changelog:
|By optionally putting the pins into sleep state in the suspend callback
|we can accomplish two things.
|- minimize current leakage from pins and thus save power,
|- prevent the IP from driving pins output in an uncontrolled manner,
|  which may happen if the power domain drops the domain regulator.

The pinctlr change is put before enable_wakeup logic as per Nishanth
Menon (slightly reworded):
|When wakeup is enabled, I/O daisy chain based wakeup is used by
|reconfiguring the padconfig register. However, this gets overriden by
|sleep/wakeup configuration. Therefore we need first to allow pinctrl to
|play with the wakeup bits as needed beyond the sleep configuration.

Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/tty/serial/8250/8250_omap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 57a8b1241b85..1681875f2996 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1156,6 +1156,7 @@ static int omap8250_suspend(struct device *dev)
 	serial8250_suspend_port(priv->line);
 	flush_work(&priv->qos_work);
 
+	pinctrl_pm_select_sleep_state(dev);
 	if (device_may_wakeup(dev))
 		omap8250_enable_wakeup(priv, true);
 	else
@@ -1167,6 +1168,7 @@ static int omap8250_resume(struct device *dev)
 {
 	struct omap8250_priv *priv = dev_get_drvdata(dev);
 
+	pinctrl_pm_select_default_state(dev);
 	if (device_may_wakeup(dev))
 		omap8250_enable_wakeup(priv, false);
 
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-25 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 19:07 [PATCH] tty: serial: 8250: omap: Add pinctrl support for suspend Sebastian Andrzej Siewior
2014-11-06 19:15 ` Nishanth Menon
2014-11-06 19:42   ` Sebastian Andrzej Siewior
2014-11-06 19:57     ` Nishanth Menon
2014-11-06 20:35       ` Tony Lindgren
2014-11-25 18:05         ` Sebastian Andrzej Siewior
2014-11-25 18:22           ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).