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

drm/exynos: add exynos5420 support for fimd

This patch adds a exynos5420 driver data to support mic_bypass
option to bypass the mic from display out path.
The mic(Mobile image compressor) compresses RGB data from fimd
and send the compressed data to the mipi dsi.
The bypass option can be founded from system register and the bit
is 11. The option bit has been introduced since exynos5420. The
only difference between exynos5250 and exynos5420/exynos5422 is
existence of the bit. Until the MIC is defined and enabled from
device tree, the bypass mic will be default option.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Chanho Park and committed by
Inki Dae
1feafd3a 217fb00a

+32 -2
+2 -1
Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt
··· 12 12 "samsung,exynos3250-fimd"; /* for Exynos3250/3472 SoCs */ 13 13 "samsung,exynos4210-fimd"; /* for Exynos4 SoCs */ 14 14 "samsung,exynos4415-fimd"; /* for Exynos4415 SoC */ 15 - "samsung,exynos5250-fimd"; /* for Exynos5 SoCs */ 15 + "samsung,exynos5250-fimd"; /* for Exynos5250 SoCs */ 16 + "samsung,exynos5420-fimd"; /* for Exynos5420/5422/5800 SoCs */ 16 17 17 18 - reg: physical base address and length of the FIMD registers set. 18 19
+30 -1
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 94 94 unsigned int lcdblk_offset; 95 95 unsigned int lcdblk_vt_shift; 96 96 unsigned int lcdblk_bypass_shift; 97 + unsigned int lcdblk_mic_bypass_shift; 97 98 98 99 unsigned int has_shadowcon:1; 99 100 unsigned int has_clksel:1; 100 101 unsigned int has_limited_fmt:1; 101 102 unsigned int has_vidoutcon:1; 102 103 unsigned int has_vtsel:1; 104 + unsigned int has_mic_bypass:1; 103 105 }; 104 106 105 107 static struct fimd_driver_data s3c64xx_fimd_driver_data = { ··· 147 145 .has_vtsel = 1, 148 146 }; 149 147 148 + static struct fimd_driver_data exynos5420_fimd_driver_data = { 149 + .timing_base = 0x20000, 150 + .lcdblk_offset = 0x214, 151 + .lcdblk_vt_shift = 24, 152 + .lcdblk_bypass_shift = 15, 153 + .lcdblk_mic_bypass_shift = 11, 154 + .has_shadowcon = 1, 155 + .has_vidoutcon = 1, 156 + .has_vtsel = 1, 157 + .has_mic_bypass = 1, 158 + }; 159 + 150 160 struct fimd_context { 151 161 struct device *dev; 152 162 struct drm_device *drm_dev; ··· 198 184 .data = &exynos4415_fimd_driver_data }, 199 185 { .compatible = "samsung,exynos5250-fimd", 200 186 .data = &exynos5_fimd_driver_data }, 187 + { .compatible = "samsung,exynos5420-fimd", 188 + .data = &exynos5420_fimd_driver_data }, 201 189 {}, 202 190 }; 203 191 MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); ··· 474 458 0x1 << driver_data->lcdblk_bypass_shift, 475 459 0x1 << driver_data->lcdblk_bypass_shift)) { 476 460 DRM_ERROR("Failed to update sysreg for bypass setting.\n"); 461 + return; 462 + } 463 + 464 + /* TODO: When MIC is enabled for display path, the lcdblk_mic_bypass 465 + * bit should be cleared. 466 + */ 467 + if (driver_data->has_mic_bypass && ctx->sysreg && 468 + regmap_update_bits(ctx->sysreg, 469 + driver_data->lcdblk_offset, 470 + 0x1 << driver_data->lcdblk_mic_bypass_shift, 471 + 0x1 << driver_data->lcdblk_mic_bypass_shift)) { 472 + DRM_ERROR("Failed to update sysreg for bypass mic.\n"); 477 473 return; 478 474 } 479 475 ··· 889 861 * clock. On these SoCs the bootloader may enable it but any 890 862 * power domain off/on will reset it to disable state. 891 863 */ 892 - if (ctx->driver_data != &exynos5_fimd_driver_data) 864 + if (ctx->driver_data != &exynos5_fimd_driver_data || 865 + ctx->driver_data != &exynos5420_fimd_driver_data) 893 866 return; 894 867 895 868 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;