diff options
author | Alan Tull <alan.tull@freescale.com> | 2011-12-16 14:09:13 -0600 |
---|---|---|
committer | Alan Tull <alan.tull@freescale.com> | 2011-12-16 14:09:13 -0600 |
commit | c57a5a2b2e88826577894e080306b6fdfe55a949 (patch) | |
tree | e744eba85e72da18e8c1f70f1f0dbb1d2062c732 /drivers | |
parent | 6565023ad182d3347972aad3f1a13ba57266e81a (diff) |
Revert "tty: serial: imx: Allow UART to be a source for wakeup"
This reverts commit 6565023ad182d3347972aad3f1a13ba57266e81a.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/imx.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 6dc859be3374..094ce699f9eb 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -628,10 +628,10 @@ static irqreturn_t imx_int(int irq, void *dev_id) if (sts & USR1_RTSD) imx_rtsint(irq, dev_id); - +#ifdef CONFIG_PM if (sts & USR1_AWAKE) writel(USR1_AWAKE, sport->port.membase + USR1); - +#endif return IRQ_HANDLED; } @@ -1059,7 +1059,9 @@ static int imx_startup(struct uart_port *port) } tty = sport->port.state->port.tty; - +#ifdef CONFIG_PM + device_set_wakeup_enable(tty->dev, 1); +#endif return 0; error_out3: @@ -1556,11 +1558,17 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state) struct imx_port *sport = platform_get_drvdata(dev); unsigned int val; - /* Enable i.MX UART wakeup */ - val = readl(sport->port.membase + UCR3); - val |= UCR3_AWAKEN; - writel(val, sport->port.membase + UCR3); - + if (device_may_wakeup(&dev->dev)) { + enable_irq_wake(sport->rxirq); +#ifdef CONFIG_PM + if (sport->port.line == 0) { + /* enable awake for MX6 */ + val = readl(sport->port.membase + UCR3); + val |= UCR3_AWAKEN; + writel(val, sport->port.membase + UCR3); + } +#endif + } if (sport) uart_suspend_port(&imx_reg, &sport->port); @@ -1575,12 +1583,17 @@ static int serial_imx_resume(struct platform_device *dev) if (sport) uart_resume_port(&imx_reg, &sport->port); - /* Disable i.MX UART wakeup */ - val = readl(sport->port.membase + UCR3); - val &= ~UCR3_AWAKEN; - writel(val, sport->port.membase + UCR3); - -return 0; + if (device_may_wakeup(&dev->dev)) { +#ifdef CONFIG_PM + if (sport->port.line == 0) { + val = readl(sport->port.membase + UCR3); + val &= ~UCR3_AWAKEN; + writel(val, sport->port.membase + UCR3); + } +#endif + disable_irq_wake(sport->rxirq); + } + return 0; } static int serial_imx_probe(struct platform_device *pdev) @@ -1659,6 +1672,9 @@ static int serial_imx_probe(struct platform_device *pdev) goto deinit; platform_set_drvdata(pdev, &sport->port); +#ifdef CONFIG_PM + device_init_wakeup(&pdev->dev, 1); +#endif return 0; deinit: if (pdata && pdata->exit) |