[PATCH v1 6/9] soc: mediatek: mmsys: support mt8195 vppsys0/1

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Fri Oct 15 04:05:29 PDT 2021


> From: "Roy-CW.Yeh" <roy-cw.yeh at mediatek.com>
> 
> Add mt8195 vppsys clock driver name and routing table to
> the driver data of mtk-mmsys.
> 
> Signed-off-by: Roy-CW.Yeh <roy-cw.yeh at mediatek.com>
> ---
>   drivers/soc/mediatek/mt8195-mmsys.h    | 716 +++++++++++++++++++++++++
>   drivers/soc/mediatek/mtk-mmsys.c       |  42 ++
>   drivers/soc/mediatek/mtk-mmsys.h       |   3 +
>   include/linux/soc/mediatek/mtk-mmsys.h |   4 +
>   4 files changed, 765 insertions(+)
> 

snip...

> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index cbae8063a187..35f57388fa90 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -69,6 +69,24 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
>   	.clk_driver = "clk-mt8195-vdo1",
>   };
>   
> +static const struct mtk_mmsys_driver_data mt8195_vppsys0_driver_data = {
> +	.clk_driver = "clk-mt8195-vpp0",
> +	.mdp_routes = mmsys_mt8195_mdp_routing_table,
> +	.mdp_num_routes = ARRAY_SIZE(mmsys_mt8195_mdp_routing_table),
> +	.mdp_mmsys_configs = mmsys_mt8195_mdp_vppsys_config_table,
> +	.mdp_num_mmsys_configs = ARRAY_SIZE(mmsys_mt8195_mdp_vppsys_config_table),
> +	.vppsys = true,
> +};
> +
> +static const struct mtk_mmsys_driver_data mt8195_vppsys1_driver_data = {
> +	.clk_driver = "clk-mt8195-vpp1",
> +	.mdp_routes = mmsys_mt8195_mdp_routing_table,
> +	.mdp_num_routes = ARRAY_SIZE(mmsys_mt8195_mdp_routing_table),
> +	.mdp_mmsys_configs = mmsys_mt8195_mdp_vppsys_config_table,
> +	.mdp_num_mmsys_configs = ARRAY_SIZE(mmsys_mt8195_mdp_vppsys_config_table),
> +	.vppsys = true,
> +};
> +
>   static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
>   	.clk_driver = "clk-mt8365-mm",
>   	.routes = mt8365_mmsys_routing_table,
> @@ -263,6 +281,18 @@ void mtk_mmsys_mdp_camin_ctrl(struct device *dev, struct mmsys_cmdq_cmd *cmd,
>   }
>   EXPORT_SYMBOL_GPL(mtk_mmsys_mdp_camin_ctrl);
>   
> +void mtk_mmsys_write_reg(struct device *dev,
> +			 struct mmsys_cmdq_cmd *cmd,
> +			 u32 alias_id, u32 value, u32 mask)
> +{
> +	struct mtk_mmsys *mmsys = dev_get_drvdata(dev);
> +	const u32 *configs = mmsys->data->mdp_mmsys_configs;
> +
> +	cmdq_pkt_write_mask(cmd->pkt, mmsys->subsys_id,
> +			    mmsys->addr + configs[alias_id], value, mask);
> +}
> +EXPORT_SYMBOL_GPL(mtk_mmsys_write_reg);
> +
>   static int mtk_mmsys_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> @@ -301,6 +331,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>   	if (IS_ERR(clks))
>   		return PTR_ERR(clks);
>   
> +	if (mmsys->data->vppsys)
> +		goto EXIT;

Labels should be lower-case.

> +
>   	drm = platform_device_register_data(&pdev->dev, "mediatek-drm",
>   					    PLATFORM_DEVID_AUTO, NULL, 0);
>   	if (IS_ERR(drm)) {
> @@ -308,6 +341,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>   		return PTR_ERR(drm);
>   	}
>   
> +EXIT:
exit:

>   	return 0;
>   }
>   

After the fixes...

Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com




More information about the Linux-mediatek mailing list