1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2021 MediaTek Inc.
4 * Copyright (c) 2024 Collabora Ltd.
5 * AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
8 #include <linux/device.h>
9 #include <linux/interconnect.h>
10 #include <linux/interconnect-provider.h>
11 #include <linux/mod_devicetable.h>
12 #include <linux/module.h>
13 #include <linux/platform_device.h>
14 #include <dt-bindings/interconnect/mediatek,mt8183.h>
18 static struct mtk_icc_node ddr_emi
= {
24 static struct mtk_icc_node mcusys
= {
29 .links
= { SLAVE_DDR_EMI
}
32 static struct mtk_icc_node gpu
= {
37 .links
= { SLAVE_DDR_EMI
}
40 static struct mtk_icc_node mmsys
= {
45 .links
= { SLAVE_DDR_EMI
}
48 static struct mtk_icc_node mm_vpu
= {
53 .links
= { MASTER_MMSYS
}
56 static struct mtk_icc_node mm_disp
= {
61 .links
= { MASTER_MMSYS
}
64 static struct mtk_icc_node mm_vdec
= {
69 .links
= { MASTER_MMSYS
}
72 static struct mtk_icc_node mm_venc
= {
77 .links
= { MASTER_MMSYS
}
80 static struct mtk_icc_node mm_cam
= {
85 .links
= { MASTER_MMSYS
}
88 static struct mtk_icc_node mm_img
= {
93 .links
= { MASTER_MMSYS
}
96 static struct mtk_icc_node mm_mdp
= {
101 .links
= { MASTER_MMSYS
}
104 static struct mtk_icc_node
*mt8183_emi_icc_nodes
[] = {
105 [SLAVE_DDR_EMI
] = &ddr_emi
,
106 [MASTER_MCUSYS
] = &mcusys
,
108 [MASTER_MMSYS
] = &mmsys
,
109 [MASTER_MM_VPU
] = &mm_vpu
,
110 [MASTER_MM_DISP
] = &mm_disp
,
111 [MASTER_MM_VDEC
] = &mm_vdec
,
112 [MASTER_MM_VENC
] = &mm_venc
,
113 [MASTER_MM_CAM
] = &mm_cam
,
114 [MASTER_MM_IMG
] = &mm_img
,
115 [MASTER_MM_MDP
] = &mm_mdp
118 static const struct mtk_icc_desc mt8183_emi_icc
= {
119 .nodes
= mt8183_emi_icc_nodes
,
120 .num_nodes
= ARRAY_SIZE(mt8183_emi_icc_nodes
),
123 static const struct of_device_id mtk_mt8183_emi_icc_of_match
[] = {
124 { .compatible
= "mediatek,mt8183-emi", .data
= &mt8183_emi_icc
},
127 MODULE_DEVICE_TABLE(of
, mtk_mt8183_emi_icc_of_match
);
129 static struct platform_driver mtk_emi_icc_mt8183_driver
= {
131 .name
= "emi-icc-mt8183",
132 .of_match_table
= mtk_mt8183_emi_icc_of_match
,
133 .sync_state
= icc_sync_state
,
135 .probe
= mtk_emi_icc_probe
,
136 .remove
= mtk_emi_icc_remove
,
139 module_platform_driver(mtk_emi_icc_mt8183_driver
);
141 MODULE_AUTHOR("AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>");
142 MODULE_DESCRIPTION("MediaTek MT8183 EMI ICC driver");
143 MODULE_LICENSE("GPL");