summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2011-07-19 13:29:54 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 20:21:32 +0800
commitb0c35a5e47ba0feb4e675a7c51b1ae5c8361945d (patch)
tree3ed5ac320cd487c1610135c9f0f4acb94dbb91bd /drivers/tty
parent663f73aec9acd86a9e07bd6cad926dfdddecae13 (diff)
ENGR00139274-2 [MX6]Enable suspend/resume
Enable suspend/resume for MX6, using debug UART as wake up source due to hardware design limitation. Signed-off-by: Anson Huang <b20788@freescale.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index a54473123e0a..850b6d811418 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -502,6 +502,10 @@ static irqreturn_t imx_int(int irq, void *dev_id)
if (sts & USR1_RTSD)
imx_rtsint(irq, dev_id);
+#ifdef CONFIG_ARCH_MX6
+ if (sts & USR1_AWAKE)
+ writel(USR1_AWAKE, sport->port.membase + USR1);
+#endif
return IRQ_HANDLED;
}
@@ -1206,20 +1210,32 @@ static struct uart_driver imx_reg = {
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
{
struct imx_port *sport = platform_get_drvdata(dev);
+ unsigned int val;
if (sport)
uart_suspend_port(&imx_reg, &sport->port);
-
+#ifdef CONFIG_ARCH_MX6
+ /* enable awake for MX6*/
+ val = readl(sport->port.membase + UCR3);
+ val |= UCR3_AWAKEN;
+ writel(val, sport->port.membase + UCR3);
+#endif
return 0;
}
static int serial_imx_resume(struct platform_device *dev)
{
struct imx_port *sport = platform_get_drvdata(dev);
+ unsigned int val;
if (sport)
uart_resume_port(&imx_reg, &sport->port);
+#ifdef CONFIG_ARCH_MX6
+ val = readl(sport->port.membase + UCR3);
+ val &= ~UCR3_AWAKEN;
+ writel(val, sport->port.membase + UCR3);
+#endif
return 0;
}