Add support for the two DPI blocks found in the mt8167 SoCs. One of them can be routed to a DPI connector and another is directly connected to the HDMI IP.
Signed-off-by: Luca Leonardo Scorcia <[email protected]> --- drivers/gpu/drm/mediatek/mtk_dpi.c | 23 +++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++ 2 files changed, 25 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 0e4f430de983..9012adeb63d0 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -1114,6 +1114,10 @@ static const struct mtk_dpi_factor dpi_factor_mt2701[] = { { 64000, 4 }, { 128000, 2 }, { U32_MAX, 1 } }; +static const struct mtk_dpi_factor dpi_factor_mt8167[] = { + { 64000, 16 }, { 74250, 8 }, { 160000, 4 }, { U32_MAX, 2 } +}; + static const struct mtk_dpi_factor dpi_factor_mt8173[] = { { 27000, 48 }, { 84000, 24 }, { 167000, 12 }, { U32_MAX, 6 } }; @@ -1163,6 +1167,24 @@ static const struct mtk_dpi_conf mt2701_conf = { .csc_enable_bit = CSC_ENABLE, }; +static const struct mtk_dpi_conf mt8167_conf = { + .dpi_factor = dpi_factor_mt8167, + .num_dpi_factor = ARRAY_SIZE(dpi_factor_mt8167), + .reg_h_fre_con = 0xe0, + .max_clock_khz = 150000, + .output_fmts = mt8173_output_fmts, + .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), + .pixels_per_iter = 1, + .is_ck_de_pol = true, + .swap_input_support = true, + .support_direct_pin = true, + .dimension_mask = HPW_MASK, + .hvsize_mask = HSIZE_MASK, + .channel_swap_shift = CH_SWAP, + .yuv422_en_bit = YUV422_EN, + .csc_enable_bit = CSC_ENABLE, +}; + static const struct mtk_dpi_conf mt8183_conf = { .dpi_factor = dpi_factor_mt8183, .num_dpi_factor = ARRAY_SIZE(dpi_factor_mt8183), @@ -1342,6 +1364,7 @@ static void mtk_dpi_remove(struct platform_device *pdev) static const struct of_device_id mtk_dpi_of_ids[] = { { .compatible = "mediatek,mt2701-dpi", .data = &mt2701_conf }, + { .compatible = "mediatek,mt8167-dpi", .data = &mt8167_conf }, { .compatible = "mediatek,mt8173-dpi", .data = &mt8173_conf }, { .compatible = "mediatek,mt8183-dpi", .data = &mt8183_conf }, { .compatible = "mediatek,mt8186-dpi", .data = &mt8186_conf }, diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index c86a3f54f35b..64c87221d931 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -802,6 +802,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = { .data = (void *)MTK_DPI }, { .compatible = "mediatek,mt8167-dsi", .data = (void *)MTK_DSI }, + { .compatible = "mediatek,mt8167-dpi", + .data = (void *)MTK_DPI }, { .compatible = "mediatek,mt8173-dpi", .data = (void *)MTK_DPI }, { .compatible = "mediatek,mt8183-dpi", -- 2.43.0
