summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/exynos/exynos5433_drm_decon.c24
-rw-r--r--include/video/exynos5433_decon.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index fc7df69683cc..e1419a446744 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -436,6 +436,29 @@ err:
ctx->suspended = true;
}
+static void decon_swreset(struct decon_context *ctx)
+{
+ unsigned int tries;
+
+ writel(0, ctx->addr + DECON_VIDCON0);
+ for (tries = 2000; tries; --tries) {
+ if (~readl(ctx->addr + DECON_VIDCON0) & VIDCON0_STOP_STATUS)
+ break;
+ udelay(10);
+ }
+
+ WARN(tries == 0, "failed to disable DECON\n");
+
+ writel(VIDCON0_SWRESET, ctx->addr + DECON_VIDCON0);
+ for (tries = 2000; tries; --tries) {
+ if (~readl(ctx->addr + DECON_VIDCON0) & VIDCON0_SWRESET)
+ break;
+ udelay(10);
+ }
+
+ WARN(tries == 0, "failed to software reset DECON\n");
+}
+
static void decon_dpms_off(struct decon_context *ctx)
{
int i;
@@ -445,6 +468,7 @@ static void decon_dpms_off(struct decon_context *ctx)
clear_bit(BIT_CLKS_ENABLED, &ctx->enabled);
decon_window_suspend(ctx);
+ decon_swreset(ctx);
for (i = ARRAY_SIZE(decon_clks_name) - 1; i >= 0; i--)
clk_disable_unprepare(ctx->clks[i]);
diff --git a/include/video/exynos5433_decon.h b/include/video/exynos5433_decon.h
index 9e7f8516f7b4..3696575b02f2 100644
--- a/include/video/exynos5433_decon.h
+++ b/include/video/exynos5433_decon.h
@@ -81,6 +81,8 @@
#define DECON_VIDINTCON3 0x022C
/* VIDCON0 */
+#define VIDCON0_SWRESET (1 << 28)
+#define VIDCON0_STOP_STATUS (1 << 2)
#define VIDCON0_ENVID (1 << 1)
#define VIDCON0_ENVID_F (1 << 0)