OMAP: UART: don't do automatic bus-level suspend/resume
authorKevin Hilman <khilman@deeprootsystems.com>
Mon, 27 Sep 2010 14:49:53 +0000 (20:19 +0530)
committerKevin Hilman <khilman@deeprootsystems.com>
Wed, 29 Sep 2010 19:42:58 +0000 (12:42 -0700)
Since the omap_device for UART is currently managed inside the idle
path itself,  don't let the bus-level code suspend/resume the UART.

To prevent this, pm_runtime_get() is used when preparing for suspend
and pm_runtime_put() is used when finished with suspend.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/serial.c

index 6ffbc924c4d41b09a912502beca981fc83900825..ff83e91e6109a131e61ba72842f4c9ed99315fad 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/serial_8250.h>
+#include <linux/pm_runtime.h>
 
 #ifdef CONFIG_SERIAL_OMAP
 #include <plat/omap-serial.h>
@@ -530,14 +531,17 @@ void omap_uart_enable_irqs(int enable)
        struct omap_uart_state *uart;
 
        list_for_each_entry(uart, &uart_list, node) {
-               if (enable)
+               if (enable) {
+                       pm_runtime_put_sync(&uart->pdev->dev);
                        ret = request_threaded_irq(uart->irq, NULL,
                                                   omap_uart_interrupt,
                                                   IRQF_SHARED,
                                                   "serial idle",
                                                   (void *)uart);
-               else
+               } else {
+                       pm_runtime_get_noresume(&uart->pdev->dev);
                        free_irq(uart->irq, (void *)uart);
+               }
        }
 }