aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/mediatek/mtk_dpi.c21
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_drv.c2
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 08915e1765f8..62a9d47df948 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -659,11 +659,29 @@ static unsigned int mt8173_calculate_factor(int clock)
659 return 3 << 1; 659 return 3 << 1;
660} 660}
661 661
662static unsigned int mt2701_calculate_factor(int clock)
663{
664 if (clock <= 64000)
665 return 16;
666 else if (clock <= 128000)
667 return 8;
668 else if (clock <= 256000)
669 return 4;
670 else
671 return 2;
672}
673
662static const struct mtk_dpi_conf mt8173_conf = { 674static const struct mtk_dpi_conf mt8173_conf = {
663 .cal_factor = mt8173_calculate_factor, 675 .cal_factor = mt8173_calculate_factor,
664 .reg_h_fre_con = 0xe0, 676 .reg_h_fre_con = 0xe0,
665}; 677};
666 678
679static const struct mtk_dpi_conf mt2701_conf = {
680 .cal_factor = mt2701_calculate_factor,
681 .reg_h_fre_con = 0xb0,
682 .edge_sel_en = true,
683};
684
667static int mtk_dpi_probe(struct platform_device *pdev) 685static int mtk_dpi_probe(struct platform_device *pdev)
668{ 686{
669 struct device *dev = &pdev->dev; 687 struct device *dev = &pdev->dev;
@@ -753,6 +771,9 @@ static int mtk_dpi_remove(struct platform_device *pdev)
753} 771}
754 772
755static const struct of_device_id mtk_dpi_of_ids[] = { 773static const struct of_device_id mtk_dpi_of_ids[] = {
774 { .compatible = "mediatek,mt2701-dpi",
775 .data = &mt2701_conf,
776 },
756 { .compatible = "mediatek,mt8173-dpi", 777 { .compatible = "mediatek,mt8173-dpi",
757 .data = &mt8173_conf, 778 .data = &mt8173_conf,
758 }, 779 },
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 47ec604289b7..6422e99952fe 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -424,6 +424,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
424 .data = (void *)MTK_DSI }, 424 .data = (void *)MTK_DSI },
425 { .compatible = "mediatek,mt8173-dsi", 425 { .compatible = "mediatek,mt8173-dsi",
426 .data = (void *)MTK_DSI }, 426 .data = (void *)MTK_DSI },
427 { .compatible = "mediatek,mt2701-dpi",
428 .data = (void *)MTK_DPI },
427 { .compatible = "mediatek,mt8173-dpi", 429 { .compatible = "mediatek,mt8173-dpi",
428 .data = (void *)MTK_DPI }, 430 .data = (void *)MTK_DPI },
429 { .compatible = "mediatek,mt2701-disp-mutex", 431 { .compatible = "mediatek,mt2701-disp-mutex",