aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lofthouse <a0741364@ti.com>2012-04-23 10:18:51 -0500
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:58:07 +0200
commit7d9e12f526edd32ae7d7433a3153c3f8376baf30 (patch)
tree90cf077807a1f0960cbedc19063a8c6680971882
parent126525fc444a744980f6a54b1db4cbfd830da424 (diff)
downloadkernel_samsung_tuna-7d9e12f526edd32ae7d7433a3153c3f8376baf30.zip
kernel_samsung_tuna-7d9e12f526edd32ae7d7433a3153c3f8376baf30.tar.gz
kernel_samsung_tuna-7d9e12f526edd32ae7d7433a3153c3f8376baf30.tar.bz2
gccore: (work-around) attempt to power off gc320 during early suspend
Ideally we would cut clocks after each batch blit however it appears that frequent off / on of the gc320 is still unstable. So handle the early suspend anyway. Change-Id: Ie47600863fcbe670bf67bc00aff8df9f462851b4 Signed-off-by: Tony Lofthouse <a0741364@ti.com>
-rw-r--r--drivers/misc/gcx/gccore/gcmain.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/misc/gcx/gccore/gcmain.c b/drivers/misc/gcx/gccore/gcmain.c
index d889a9f..321e832 100644
--- a/drivers/misc/gcx/gccore/gcmain.c
+++ b/drivers/misc/gcx/gccore/gcmain.c
@@ -80,6 +80,7 @@ static int g_clientref;
static void *g_reg_base;
static struct omap_gcx_platform_data *g_gcxplat;
+static bool gforceoff; /* protected by mtx */
static enum gcerror find_context(struct gccontextmap **context, int create)
{
@@ -830,6 +831,8 @@ void gc_commit(struct gccommit *gccommit, int fromuser)
exit:
gc_set_power(GCPWR_LOW);
+ if (gforceoff)
+ gc_set_power(GCPWR_OFF);
mutex_unlock(&mtx);
@@ -1016,6 +1019,30 @@ static struct platform_driver plat_drv = {
},
};
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+#include <linux/earlysuspend.h>
+static void gc_early_suspend(struct early_suspend *h)
+{
+ mutex_lock(&mtx);
+ gforceoff = true;
+ gc_set_power(GCPWR_OFF);
+ mutex_unlock(&mtx);
+}
+
+static void gc_late_resume(struct early_suspend *h)
+{
+ mutex_lock(&mtx);
+ gforceoff = false;
+ mutex_unlock(&mtx);
+}
+
+static struct early_suspend early_suspend_info = {
+ .suspend = gc_early_suspend,
+ .resume = gc_late_resume,
+ .level = EARLY_SUSPEND_LEVEL_DISABLE_FB,
+};
+#endif /* CONFIG_HAS_EARLYSUSPEND */
+
/*******************************************************************************
* Driver init/shutdown.
*/
@@ -1094,6 +1121,10 @@ static int __init gc_init(void)
mutex_init(&g_maplock);
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+ register_early_suspend(&early_suspend_info);
+#endif
+
return platform_driver_register(&plat_drv);
fail:
if (g_irqinstalled)
@@ -1116,6 +1147,9 @@ static void __exit gc_exit(void)
return;
platform_driver_unregister(&plat_drv);
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+ unregister_early_suspend(&early_suspend_info);
+#endif
delete_context_map();
mutex_destroy(&g_maplock);
gc_set_power(GCPWR_OFF);