linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: imx: edd a .freeze_noirq function
@ 2017-12-27 17:27 Martin Kaiser
  2017-12-27 17:27 ` [PATCH 2/2] serial: imx: fix endless loop during suspend Martin Kaiser
  2018-01-05 16:46 ` [PATCH v2] " Martin Kaiser
  0 siblings, 2 replies; 9+ messages in thread
From: Martin Kaiser @ 2017-12-27 17:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Sascha Hauer, Philipp Zabel
  Cc: Shawn Guo, linux-serial, linux-kernel, Martin Kaiser

Define a .freeze_noirq function. For now, this is an identical copy of
.suspend_noirq. (We'll move the wakeup settings to .suspend_noirq
shortly.)

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/tty/serial/imx.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 145ed61..250aa26 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2269,6 +2269,23 @@ static int imx_serial_port_resume_noirq(struct device *dev)
 	return 0;
 }
 
+static int imx_serial_port_freeze_noirq(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct imx_port *sport = platform_get_drvdata(pdev);
+	int ret;
+
+	ret = clk_enable(sport->clk_ipg);
+	if (ret)
+		return ret;
+
+	serial_imx_save_context(sport);
+
+	clk_disable(sport->clk_ipg);
+
+	return 0;
+}
+
 static int imx_serial_port_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -2326,7 +2343,7 @@ static int imx_serial_port_thaw(struct device *dev)
 static const struct dev_pm_ops imx_serial_port_pm_ops = {
 	.suspend_noirq = imx_serial_port_suspend_noirq,
 	.resume_noirq = imx_serial_port_resume_noirq,
-	.freeze_noirq = imx_serial_port_suspend_noirq,
+	.freeze_noirq = imx_serial_port_freeze_noirq,
 	.restore_noirq = imx_serial_port_resume_noirq,
 	.suspend = imx_serial_port_suspend,
 	.resume = imx_serial_port_resume,
-- 
2.1.4

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

end of thread, other threads:[~2018-01-05 17:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-27 17:27 [PATCH 1/2] serial: imx: edd a .freeze_noirq function Martin Kaiser
2017-12-27 17:27 ` [PATCH 2/2] serial: imx: fix endless loop during suspend Martin Kaiser
2017-12-31 11:53   ` Fabio Estevam
2018-01-02 16:15     ` Martin Kaiser
2018-01-02 19:31       ` Fabio Estevam
2018-01-03 16:20       ` Fabio Estevam
2018-01-03 21:43         ` Martin Kaiser
2018-01-05 16:46 ` [PATCH v2] " Martin Kaiser
2018-01-05 17:31   ` Fabio Estevam

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).