[PATCH v1 3/6] soc: mediatek: mmsys: add support for MT8195 VPPSYS

Moudy Ho moudy.ho at mediatek.com
Tue Oct 4 02:33:16 PDT 2022


From: "Roy-CW.Yeh" <roy-cw.yeh at mediatek.com>

Add MT8195 VPPSYS0 and VPPSYS1 driver data.

Signed-off-by: Roy-CW.Yeh <roy-cw.yeh at mediatek.com>
---
 drivers/soc/mediatek/mtk-mmsys.c | 20 +++++++++++++++++++-
 drivers/soc/mediatek/mtk-mmsys.h |  1 +
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index d2c7a87aab87..c4d15f99f853 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -149,11 +149,25 @@ 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 = {
+	.io_start = 0x14000000,
+	.clk_driver = "clk-mt8195-vpp0",
+	.is_copies = true,
+};
+
+static const struct mtk_mmsys_driver_data mt8195_vppsys1_driver_data = {
+	.io_start = 0x14f00000,
+	.clk_driver = "clk-mt8195-vpp1",
+	.is_copies = true,
+};
+
 static const struct mtk_mmsys_match_data mt8195_mmsys_match_data = {
-	.num_drv_data = 2,
+	.num_drv_data = 4,
 	.drv_data = {
 		&mt8195_vdosys0_driver_data,
 		&mt8195_vdosys1_driver_data,
+		&mt8195_vppsys0_driver_data,
+		&mt8195_vppsys1_driver_data,
 	},
 };
 
@@ -360,6 +374,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
 	if (IS_ERR(clks))
 		return PTR_ERR(clks);
 
+	if (mmsys->data->is_copies)
+		goto out_probe_done;
+
 	drm = platform_device_register_data(&pdev->dev, "mediatek-drm",
 					    PLATFORM_DEVID_AUTO, NULL, 0);
 	if (IS_ERR(drm)) {
@@ -367,6 +384,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
 		return PTR_ERR(drm);
 	}
 
+out_probe_done:
 	return 0;
 }
 
diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
index f01ba206481d..d454b4a256af 100644
--- a/drivers/soc/mediatek/mtk-mmsys.h
+++ b/drivers/soc/mediatek/mtk-mmsys.h
@@ -92,6 +92,7 @@ struct mtk_mmsys_driver_data {
 	const struct mtk_mmsys_routes *routes;
 	const unsigned int num_routes;
 	const u16 sw0_rst_offset;
+	bool is_copies;
 };
 
 struct mtk_mmsys_match_data {
-- 
2.18.0




More information about the linux-arm-kernel mailing list