Skip to content

Commit b472094

Browse files
mediatek-jitaockhu-mediatek
authored andcommitted
drm/mediatek: add mt8183 dpi clock factor
The factor depends on the divider of DPI in MT8183, therefore, we should fix this factor to the right and new one. Signed-off-by: Jitao Shi <[email protected]> Signed-off-by: CK Hu <[email protected]>
1 parent a4a417a commit b472094

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,16 @@ static unsigned int mt2701_calculate_factor(int clock)
664664
return 1;
665665
}
666666

667+
static unsigned int mt8183_calculate_factor(int clock)
668+
{
669+
if (clock <= 27000)
670+
return 8;
671+
else if (clock <= 167000)
672+
return 4;
673+
else
674+
return 2;
675+
}
676+
667677
static const struct mtk_dpi_conf mt8173_conf = {
668678
.cal_factor = mt8173_calculate_factor,
669679
.reg_h_fre_con = 0xe0,
@@ -675,6 +685,11 @@ static const struct mtk_dpi_conf mt2701_conf = {
675685
.edge_sel_en = true,
676686
};
677687

688+
static const struct mtk_dpi_conf mt8183_conf = {
689+
.cal_factor = mt8183_calculate_factor,
690+
.reg_h_fre_con = 0xe0,
691+
};
692+
678693
static int mtk_dpi_probe(struct platform_device *pdev)
679694
{
680695
struct device *dev = &pdev->dev;
@@ -770,6 +785,9 @@ static const struct of_device_id mtk_dpi_of_ids[] = {
770785
{ .compatible = "mediatek,mt8173-dpi",
771786
.data = &mt8173_conf,
772787
},
788+
{ .compatible = "mediatek,mt8183-dpi",
789+
.data = &mt8183_conf,
790+
},
773791
{ },
774792
};
775793

0 commit comments

Comments
 (0)