Commit be63f6e8 authored by Rex-BC Chen's avatar Rex-BC Chen Committed by Chun-Kuang Hu

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: default avatarJitao Shi <jitao.shi@mediatek.com>
Signed-off-by: default avatarRex-BC Chen <rex-bc.chen@mediatek.com>
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 6385ed8e
...@@ -123,6 +123,8 @@ struct mtk_dpi_conf { ...@@ -123,6 +123,8 @@ struct mtk_dpi_conf {
u32 reg_h_fre_con; u32 reg_h_fre_con;
u32 max_clock_khz; u32 max_clock_khz;
bool edge_sel_en; bool edge_sel_en;
const u32 *output_fmts;
u32 num_output_fmts;
}; };
static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask) static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask)
...@@ -702,10 +704,21 @@ static unsigned int mt8183_calculate_factor(int clock) ...@@ -702,10 +704,21 @@ static unsigned int mt8183_calculate_factor(int clock)
return 2; return 2;
} }
static const u32 mt8173_output_fmts[] = {
MEDIA_BUS_FMT_RGB888_1X24,
};
static const u32 mt8183_output_fmts[] = {
MEDIA_BUS_FMT_RGB888_2X12_LE,
MEDIA_BUS_FMT_RGB888_2X12_BE,
};
static const struct mtk_dpi_conf mt8173_conf = { static const struct mtk_dpi_conf mt8173_conf = {
.cal_factor = mt8173_calculate_factor, .cal_factor = mt8173_calculate_factor,
.reg_h_fre_con = 0xe0, .reg_h_fre_con = 0xe0,
.max_clock_khz = 300000, .max_clock_khz = 300000,
.output_fmts = mt8173_output_fmts,
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
}; };
static const struct mtk_dpi_conf mt2701_conf = { static const struct mtk_dpi_conf mt2701_conf = {
...@@ -713,18 +726,24 @@ static const struct mtk_dpi_conf mt2701_conf = { ...@@ -713,18 +726,24 @@ static const struct mtk_dpi_conf mt2701_conf = {
.reg_h_fre_con = 0xb0, .reg_h_fre_con = 0xb0,
.edge_sel_en = true, .edge_sel_en = true,
.max_clock_khz = 150000, .max_clock_khz = 150000,
.output_fmts = mt8173_output_fmts,
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
}; };
static const struct mtk_dpi_conf mt8183_conf = { static const struct mtk_dpi_conf mt8183_conf = {
.cal_factor = mt8183_calculate_factor, .cal_factor = mt8183_calculate_factor,
.reg_h_fre_con = 0xe0, .reg_h_fre_con = 0xe0,
.max_clock_khz = 100000, .max_clock_khz = 100000,
.output_fmts = mt8183_output_fmts,
.num_output_fmts = ARRAY_SIZE(mt8183_output_fmts),
}; };
static const struct mtk_dpi_conf mt8192_conf = { static const struct mtk_dpi_conf mt8192_conf = {
.cal_factor = mt8183_calculate_factor, .cal_factor = mt8183_calculate_factor,
.reg_h_fre_con = 0xe0, .reg_h_fre_con = 0xe0,
.max_clock_khz = 150000, .max_clock_khz = 150000,
.output_fmts = mt8173_output_fmts,
.num_output_fmts = ARRAY_SIZE(mt8173_output_fmts),
}; };
static int mtk_dpi_probe(struct platform_device *pdev) static int mtk_dpi_probe(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment