[PATCH v2 14/18] drm/mediatek: add mt8365 dpi support

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Wed Apr 17 10:14:35 UTC 2024


Il 16/04/24 17:53, Alexandre Mergnat ha scritto:
> - Add compatibles and platform data into the Mediatek DPI driver.
> - Fix the DPI0 parent clock to be consistent.
> 
> This SoC is compatible with the mt8183 calculate factor.
> 
> Signed-off-by: Alexandre Mergnat <amergnat at baylibre.com>
> ---
>   drivers/clk/mediatek/clk-mt8365-mm.c |  2 +-
>   drivers/gpu/drm/mediatek/mtk_dpi.c   | 18 ++++++++++++++++++
>   2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/mediatek/clk-mt8365-mm.c b/drivers/clk/mediatek/clk-mt8365-mm.c
> index 01a2ef8f594e..3f62ec750733 100644
> --- a/drivers/clk/mediatek/clk-mt8365-mm.c
> +++ b/drivers/clk/mediatek/clk-mt8365-mm.c
> @@ -53,7 +53,7 @@ static const struct mtk_gate mm_clks[] = {
>   	GATE_MM0(CLK_MM_MM_DSI0, "mm_dsi0", "mm_sel", 17),
>   	GATE_MM0(CLK_MM_MM_DISP_RDMA1, "mm_disp_rdma1", "mm_sel", 18),
>   	GATE_MM0(CLK_MM_MM_MDP_RDMA1, "mm_mdp_rdma1", "mm_sel", 19),
> -	GATE_MM0(CLK_MM_DPI0_DPI0, "mm_dpi0_dpi0", "vpll_dpix", 20),
> +	GATE_MM0(CLK_MM_DPI0_DPI0, "mm_dpi0_dpi0", "dpi0_sel", 20),

While I can agree with that change, this needs a Fixes tag and needs a commit on
its own.

>   	GATE_MM0(CLK_MM_MM_FAKE, "mm_fake", "mm_sel", 21),
>   	GATE_MM0(CLK_MM_MM_SMI_COMMON, "mm_smi_common", "mm_sel", 22),
>   	GATE_MM0(CLK_MM_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 23),
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index beb7d9d08e97..a4f9376ee472 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -997,6 +997,23 @@ static const struct mtk_dpi_conf mt8195_dpintf_conf = {
>   	.csc_enable_bit = DPINTF_CSC_ENABLE,
>   };
>   
> +static const struct mtk_dpi_conf mt8365_conf = {
> +	.cal_factor = mt8183_calculate_factor,
> +	.reg_h_fre_con = 0xe0,
> +	.max_clock_khz = 150000,
> +	.output_fmts = mt8183_output_fmts,
> +	.num_output_fmts = ARRAY_SIZE(mt8183_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,
> +};

You don't need this, as that's a direct copy of `mt8192_conf`.

> +
>   static int mtk_dpi_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> @@ -1092,6 +1109,7 @@ static const struct of_device_id mtk_dpi_of_ids[] = {
>   	{ .compatible = "mediatek,mt8188-dp-intf", .data = &mt8195_dpintf_conf },
>   	{ .compatible = "mediatek,mt8192-dpi", .data = &mt8192_conf },
>   	{ .compatible = "mediatek,mt8195-dp-intf", .data = &mt8195_dpintf_conf },
> +	{ .compatible = "mediatek,mt8365-dpi", .data = &mt8365_conf },

...and you don't need to add any mt8365 specific compatible in there as well,
as you can simply add the node as

compatible = "mediatek,mt8365-dpi", "mediatek,mt8192-dpi";

Cheers,
Angelo

>   	{ /* sentinel */ },
>   };
>   MODULE_DEVICE_TABLE(of, mtk_dpi_of_ids);
> 



More information about the dri-devel mailing list