diff --git a/arch/arm/mach-omap2/omap_device.c 
b/arch/arm/mach-omap2/omap_device.c
index 381be7a..d6dce8f 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -620,11 +620,8 @@ static int _od_suspend_noirq(struct device *dev)
         ret = pm_generic_suspend_noirq(dev);

         if (!ret && !pm_runtime_status_suspended(dev)) {
-               if (pm_generic_runtime_suspend(dev) == 0) {
-                       if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
-                               omap_device_idle(pdev);
+               if (pm_generic_runtime_suspend(dev) == 0)
                         od->flags |= OMAP_DEVICE_SUSPENDED;
-               }
         }

         return ret;
@@ -638,8 +635,6 @@ static int _od_resume_noirq(struct device *dev)
         if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
             !pm_runtime_status_suspended(dev)) {
                 od->flags &= ~OMAP_DEVICE_SUSPENDED;
-               if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
-                       omap_device_enable(pdev);
                 pm_generic_runtime_resume(dev);
         }

--

From: Sourav Poddar <sourav.poddar@ti.com>
Date: Wed, 13 Mar 2013 20:32:36 +0530
Subject: [PATCH 2/2] driver: serial: omap: add prepare/complete callback 
for "no_console_suspend" case

This patch adapt the serial core/driver to take care of the case when 
"no_console_suspend"
is used in the bootargs. This patch will remove dependency to set 
od->flags to
"OMAP_DEVICE_NO_IDLE_ON_SUSPEND" in serial.c(non dt case) and 
omap_device.c(dt case).

Prepare and complete callbacks will ensure that clocks remain active for 
the console
uart when "no_console_suspend" is used in the bootargs.

Tested on omap5430evm, omap4430sdp.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
  drivers/tty/serial/omap-serial.c |   20 ++++++++++++++++++++
  drivers/tty/serial/serial_core.c |    3 +++
  include/linux/serial_core.h      |    1 +
  3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c 
b/drivers/tty/serial/omap-serial.c
index 08332f3..b726b2b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1278,6 +1278,24 @@ static struct uart_driver serial_omap_reg = {
  };

  #ifdef CONFIG_PM_SLEEP
+static int serial_omap_prepare(struct device *dev)
+{
+       struct uart_omap_port *up = dev_get_drvdata(dev);
+
+       if (!console_suspend_enabled && up->port.is_console)
+               pm_runtime_disable(dev);
+
+       return 0;
+}
+
+static void serial_omap_complete(struct device *dev)
+{
+       struct uart_omap_port *up = dev_get_drvdata(dev);
+
+       if (!console_suspend_enabled && up->port.is_console)
+               pm_runtime_enable(dev);
+}
+
  static int serial_omap_suspend(struct device *dev)
  {
         struct uart_omap_port *up = dev_get_drvdata(dev);
@@ -1632,6 +1650,8 @@ static const struct dev_pm_ops 
serial_omap_dev_pm_ops = {
         SET_SYSTEM_SLEEP_PM_OPS(serial_omap_suspend, serial_omap_resume)
         SET_RUNTIME_PM_OPS(serial_omap_runtime_suspend,
                                 serial_omap_runtime_resume, NULL)
+       .prepare        = serial_omap_prepare,
+       .complete       = serial_omap_complete,
  };

  #if defined(CONFIG_OF)
diff --git a/drivers/tty/serial/serial_core.c 
b/drivers/tty/serial/serial_core.c
index a400002..c4d9328 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2594,6 +2594,9 @@ int uart_add_one_port(struct uart_driver *drv, 
struct uart_port *uport)
         uport->cons = drv->cons;
         uport->state = state;

+       if (uart_console(uport))
+               uport->is_console = true;
+
         /*
          * If this port is a console, then the spinlock is already
          * initialised.
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 87d4bbc..7fcdd90 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -194,6 +194,7 @@ struct uart_port {
         unsigned char           irq_wake;
         unsigned char           unused[2];
         void                    *private_data;          /* generic 
platform data pointer */
+       bool                    is_console;
  };

