From: Darren Etheridge <detheri...@ti.com>

The default behavior of consoles during power management operations is: On
entry to suspend a new console is allocated and switched to. On resume the
original console is restored.

However this isn't the observed behavior and the original console is not
restored. This commit avoids the problem by disabling the switching of
consoles at suspend/resume. This works because the driver already restores
all necessary hardware context during such pm operations.

Signed-off-by: Darren Etheridge <detheridge at ti.com>
Signed-off-by: Jyri Sarha <jsarha at ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 4ddb21e..02525b2 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -18,6 +18,7 @@
 /* LCDC DRM driver, based on da8xx-fb */

 #include <linux/component.h>
+#include <linux/suspend.h>

 #include "tilcdc_drv.h"
 #include "tilcdc_regs.h"
@@ -229,6 +230,14 @@ static int tilcdc_load(struct drm_device *dev, unsigned 
long flags)
        pm_runtime_enable(dev->dev);
        pm_runtime_irq_safe(dev->dev);

+       /*
+        * disable creation of new console during suspend.
+        * this works around a problem where a ctrl-c is needed
+        * to be entered on the VT to actually get the device
+        * to continue into the suspend state.
+        */
+       pm_set_vt_switch(0);
+
        /* Determine LCD IP Version */
        pm_runtime_get_sync(dev->dev);
        switch (tilcdc_read(dev, LCDC_PID_REG)) {
-- 
1.9.1

Reply via email to