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-07-20 13:14:47 +0800
commitf41455a6272388fb8f1b57e5402bf470469c1e35 (patch)
treed71eebeaf156b2d9e512f44bf261fb899403075f /drivers/tty
parent683b3c5bbb377e08043c814da860677b03815452 (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;
}