Skip to content

Commit be63f6e

Browse files
mtk-rex-bc-chenChun-Kuang Hu
authored andcommitted
drm/mediatek: dpi: Add output bus formats to driver data
For each SoC, dpi support different output bus formats, so add these information into driver data. Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 6385ed8 commit be63f6e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ struct mtk_dpi_conf {
123123
u32 reg_h_fre_con;
124124
u32 max_clock_khz;
125125
bool edge_sel_en;
126+
const u32 *output_fmts;
127+
u32 num_output_fmts;
126128
};
127129

128130
static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask)
@@ -702,29 +704,46 @@ static unsigned int mt8183_calculate_factor(int clock)
702704
return 2;
703705
}
704706

707+
static const u32 mt8173_output_fmts[] = {
708+
MEDIA_BUS_FMT_RGB888_1X24,
709+
};
710+
711+
static const u32 mt8183_output_fmts[] = {
712+
MEDIA_BUS_FMT_RGB888_2X12_LE,
713+
MEDIA_BUS_FMT_RGB888_2X12_BE,
714+
};
715+
705716
static const struct mtk_dpi_conf mt8173_conf = {
706717
.cal_factor = mt8173_calculate_factor,
707718
.reg_h_fre_con = 0xe0,
708719
.max_clock_khz = 300000,
720+
.output_fmts = mt8173_output_fmts,
721+
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
709722
};
710723

711724
static const struct mtk_dpi_conf mt2701_conf = {
712725
.cal_factor = mt2701_calculate_factor,
713726
.reg_h_fre_con = 0xb0,
714727
.edge_sel_en = true,
715728
.max_clock_khz = 150000,
729+
.output_fmts = mt8173_output_fmts,
730+
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
716731
};
717732

718733
static const struct mtk_dpi_conf mt8183_conf = {
719734
.cal_factor = mt8183_calculate_factor,
720735
.reg_h_fre_con = 0xe0,
721736
.max_clock_khz = 100000,
737+
.output_fmts = mt8183_output_fmts,
738+
.num_output_fmts = ARRAY_SIZE(mt8183_output_fmts),
722739
};
723740

724741
static const struct mtk_dpi_conf mt8192_conf = {
725742
.cal_factor = mt8183_calculate_factor,
726743
.reg_h_fre_con = 0xe0,
727744
.max_clock_khz = 150000,
745+
.output_fmts = mt8173_output_fmts,
746+
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
728747
};
729748

730749
static int mtk_dpi_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)