[v6,0/4] Migrate MT8195 VPPSYS 0/1 to mtk-mmsys driver

Message ID 20230118031509.29834-1-moudy.ho@mediatek.com
Headers
Series Migrate MT8195 VPPSYS 0/1 to mtk-mmsys driver |

Message

Moudy Ho (何宗原) Jan. 18, 2023, 3:15 a.m. UTC
  Change since v5:
- Rebase on linux-next.
- Correct the compatible enumeration order in "mediatek,mmsys.yaml".

Hi,

This series splits patches from the original mailing list below:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=711592

Refer to the comments of 0/8 and 1/8 in the following series:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=702518
All about the MT8195 VPPSYS 0/1 should be probed from the "mtk-mmsys"
driver, which then starts its own clock driver as the platform driver.

Moudy Ho (3):
  dt-bindings: arm: mediatek: migrate MT8195 vppsys0/1 to mtk-mmsys
    driver
  dt-bindings: arm: mediatek: mmsys: Add support for MT8195 VPPSYS
  clk: mediatek: remove MT8195 vppsys/0/1 simple_probe

Roy-CW.Yeh (1):
  soc: mediatek: mmsys: add support for MT8195 VPPSYS

 .../bindings/arm/mediatek/mediatek,mmsys.yaml |  2 +
 .../arm/mediatek/mediatek,mt8195-clock.yaml   | 16 -----
 drivers/clk/mediatek/clk-mt8195-vpp0.c        | 58 ++++++++++++++-----
 drivers/clk/mediatek/clk-mt8195-vpp1.c        | 58 ++++++++++++++-----
 drivers/soc/mediatek/mtk-mmsys.c              | 22 +++++++
 drivers/soc/mediatek/mtk-mmsys.h              |  1 +
 6 files changed, 111 insertions(+), 46 deletions(-)
  

Comments

Matthias Brugger Jan. 30, 2023, 11:28 a.m. UTC | #1
On 18/01/2023 04:15, Moudy Ho wrote:
> From: "Roy-CW.Yeh" <roy-cw.yeh@mediatek.com>
> 
> Add MT8195 VPPSYS0 and VPPSYS1 driver data.
> 
> Signed-off-by: Roy-CW.Yeh <roy-cw.yeh@mediatek.com>
> Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Applied, thanks

> ---
>   drivers/soc/mediatek/mtk-mmsys.c | 22 ++++++++++++++++++++++
>   drivers/soc/mediatek/mtk-mmsys.h |  1 +
>   2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 38f1dd92e7c6..176fdc866e22 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -88,6 +88,16 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys0_driver_data = {
>   	.num_routes = ARRAY_SIZE(mmsys_mt8195_routing_table),
>   };
>   
> +static const struct mtk_mmsys_driver_data mt8195_vppsys0_driver_data = {
> +	.clk_driver = "clk-mt8195-vpp0",
> +	.is_vppsys = true,
> +};
> +
> +static const struct mtk_mmsys_driver_data mt8195_vppsys1_driver_data = {
> +	.clk_driver = "clk-mt8195-vpp1",
> +	.is_vppsys = true,
> +};
> +
>   static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
>   	.clk_driver = "clk-mt8365-mm",
>   	.routes = mt8365_mmsys_routing_table,
> @@ -264,6 +274,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>   	if (IS_ERR(clks))
>   		return PTR_ERR(clks);
>   
> +	if (mmsys->data->is_vppsys)
> +		goto out_probe_done;
> +
>   	drm = platform_device_register_data(&pdev->dev, "mediatek-drm",
>   					    PLATFORM_DEVID_AUTO, NULL, 0);
>   	if (IS_ERR(drm)) {
> @@ -271,6 +284,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>   		return PTR_ERR(drm);
>   	}
>   
> +out_probe_done:
>   	return 0;
>   }
>   
> @@ -323,6 +337,14 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>   		.compatible = "mediatek,mt8195-vdosys0",
>   		.data = &mt8195_vdosys0_driver_data,
>   	},
> +	{
> +		.compatible = "mediatek,mt8195-vppsys0",
> +		.data = &mt8195_vppsys0_driver_data,
> +	},
> +	{
> +		.compatible = "mediatek,mt8195-vppsys1",
> +		.data = &mt8195_vppsys1_driver_data,
> +	},
>   	{
>   		.compatible = "mediatek,mt8365-mmsys",
>   		.data = &mt8365_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 77f37f8c715b..54a96b83afb4 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -91,6 +91,7 @@ struct mtk_mmsys_driver_data {
>   	const struct mtk_mmsys_routes *routes;
>   	const unsigned int num_routes;
>   	const u16 sw0_rst_offset;
> +	const bool is_vppsys;
>   };
>   
>   /*