drm/exynos: Implement fimd_display_power_on
authorStéphane Marchesin <marcheu@chromium.org>
Tue, 28 Aug 2012 21:34:18 +0000 (14:34 -0700)
committerGerrit <chrome-bot@google.com>
Tue, 28 Aug 2012 22:38:57 +0000 (15:38 -0700)
Also fix fimd_power_on to turn the panel off in the off case.

BUG=chromium-os-partner:12832
TEST=by hand, screen goes completely black after the timeout.

Change-Id: Ia79f5e53009110715395a5984e3e3f96809c7aed
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31634
Reviewed-by: John Sheu <sheu@chromium.org>
drivers/gpu/drm/exynos/exynos_drm_fimd.c

index 4961d46..5e3803a 100644 (file)
@@ -136,11 +136,30 @@ static int fimd_check_timing(struct device *dev, void *timing)
        return -EINVAL;
 }
 
+static int fimd_power_on(struct fimd_context *ctx, bool enable);
+
 static int fimd_display_power_on(struct device *dev, int mode)
 {
+       struct fimd_context *ctx = get_fimd_context(dev);
+       bool enable;
+
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
-       /* TODO */
+       switch (mode) {
+       case DRM_MODE_DPMS_ON:
+       case DRM_MODE_DPMS_STANDBY:
+               enable = true;
+               break;
+       case DRM_MODE_DPMS_SUSPEND:
+       case DRM_MODE_DPMS_OFF:
+               enable = false;
+               break;
+       default:
+               DRM_DEBUG_KMS("unspecified mode %d\n", mode);
+               break;
+       }
+
+       fimd_power_on(ctx, enable);
 
        return 0;
 }
@@ -835,6 +854,9 @@ static int fimd_power_on(struct fimd_context *ctx, bool enable)
                clk_disable(ctx->bus_clk);
 
                ctx->suspended = true;
+
+               if (pdata->panel_type == DP_LCD)
+                       writel(0, ctx->regs + DPCLKCON);
        }
 
        return 0;