video: tegra: prevent double disable in suspend
authorAndrei Warkentin <andreiw@motorola.com>
Tue, 19 Apr 2011 19:20:48 +0000 (14:20 -0500)
committerErik Gilling <konkers@android.com>
Tue, 19 Apr 2011 20:33:33 +0000 (13:33 -0700)
Prevents HDMI detect worker from re-disabling DC during
suspend (after tegra_dc_suspend has disabled DC itself)/

Change-Id: I90016fb709934ab8fb5135443980898069f8071f
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Erik Gilling <konkers@android.com>
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/dc_priv.h

index 43d31840fd34e28612c931ed50865991cfc2418d..a61e86fb5dd7a7d7bd712b39c68c7d52caf5b81e 100644 (file)
@@ -1103,7 +1103,9 @@ void tegra_dc_disable(struct tegra_dc *dc)
 
        if (dc->enabled) {
                dc->enabled = false;
-               _tegra_dc_disable(dc);
+
+               if (!dc->suspended)
+                       _tegra_dc_disable(dc);
        }
 
        mutex_unlock(&dc->lock);
@@ -1335,6 +1337,8 @@ static int tegra_dc_suspend(struct nvhost_device *ndev, pm_message_t state)
        if (dc->enabled) {
                tegra_fb_suspend(dc->fb);
                _tegra_dc_disable(dc);
+
+               dc->suspended = true;
        }
        mutex_unlock(&dc->lock);
 
@@ -1348,6 +1352,8 @@ static int tegra_dc_resume(struct nvhost_device *ndev)
        dev_info(&ndev->dev, "resume\n");
 
        mutex_lock(&dc->lock);
+       dc->suspended = false;
+
        if (dc->enabled)
                _tegra_dc_enable(dc);
 
index 3f7fdbff023b0fd22e69540bf3309ac826fffe15..c8476f8b5ffc3d14f07ee3367fdf49d7a9ea9e69 100644 (file)
@@ -63,6 +63,7 @@ struct tegra_dc {
        struct clk                      *emc_clk;
 
        bool                            enabled;
+       bool                            suspended;
 
        struct tegra_dc_out             *out;
        struct tegra_dc_out_ops         *out_ops;