Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: stop mixer before gating clocks during poweroff

Mixer should be power gated only after it is gracefully stopped.
The recommended sequence is to Stop the mixer and wait till
it enters to IDLE state before gating the clocks and power to
the mixer.

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Rahul Sharma and committed by
Inki Dae
381be025 b4bfa3c7

+16
+15
drivers/gpu/drm/exynos/exynos_mixer.c
··· 377 377 mixer_regs_dump(ctx); 378 378 } 379 379 380 + static void mixer_stop(struct mixer_context *ctx) 381 + { 382 + struct mixer_resources *res = &ctx->mixer_res; 383 + int timeout = 20; 384 + 385 + mixer_reg_writemask(res, MXR_STATUS, 0, MXR_STATUS_REG_RUN); 386 + 387 + while (!(mixer_reg_read(res, MXR_STATUS) & MXR_STATUS_REG_IDLE) && 388 + --timeout) 389 + usleep_range(10000, 12000); 390 + 391 + mixer_regs_dump(ctx); 392 + } 393 + 380 394 static void vp_video_buffer(struct mixer_context *ctx, int win) 381 395 { 382 396 struct mixer_resources *res = &ctx->mixer_res; ··· 1108 1094 } 1109 1095 mutex_unlock(&ctx->mixer_mutex); 1110 1096 1097 + mixer_stop(ctx); 1111 1098 mixer_window_suspend(mgr); 1112 1099 1113 1100 ctx->int_en = mixer_reg_read(res, MXR_INT_EN);
+1
drivers/gpu/drm/exynos/regs-mixer.h
··· 78 78 #define MXR_STATUS_BIG_ENDIAN (1 << 3) 79 79 #define MXR_STATUS_ENDIAN_MASK (1 << 3) 80 80 #define MXR_STATUS_SYNC_ENABLE (1 << 2) 81 + #define MXR_STATUS_REG_IDLE (1 << 1) 81 82 #define MXR_STATUS_REG_RUN (1 << 0) 82 83 83 84 /* bits for MXR_CFG */