lkml.org 
[lkml]   [2017]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] serial: imx: edd a .freeze_noirq function
Date
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
\
 
 \ /
  Last update: 2017-12-27 18:29    [W:0.053 / U:6.300 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site