if (sts & USR1_RTSD)
imx_rtsint(irq, dev_id);
-
-#ifdef CONFIG_ARCH_MX6
+#ifdef CONFIG_PM
if (sts & USR1_AWAKE)
writel(USR1_AWAKE, sport->port.membase + USR1);
#endif
struct imx_port *sport = (struct imx_port *)port;
int retval;
unsigned long flags, temp;
+ struct tty_struct *tty;
imx_setup_ufcr(sport, 0);
pdata->irda_enable(1);
}
+ tty = sport->port.state->port.tty;
+#ifdef CONFIG_PM
+ device_set_wakeup_enable(tty->dev, 1);
+#endif
return 0;
error_out3:
struct imx_port *sport = platform_get_drvdata(dev);
unsigned int val;
+ 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);
-#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;
}
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);
+ 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;
}
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)