Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / interconnect / mediatek / mt8183.c
blobc212e79334cf5b2fac1493d1aeb8979b1ec1187b
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2021 MediaTek Inc.
4 * Copyright (c) 2024 Collabora Ltd.
5 * AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
6 */
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>
16 #include "icc-emi.h"
18 static struct mtk_icc_node ddr_emi = {
19 .name = "ddr-emi",
20 .id = SLAVE_DDR_EMI,
21 .ep = 1,
24 static struct mtk_icc_node mcusys = {
25 .name = "mcusys",
26 .id = MASTER_MCUSYS,
27 .ep = 0,
28 .num_links = 1,
29 .links = { SLAVE_DDR_EMI }
32 static struct mtk_icc_node gpu = {
33 .name = "gpu",
34 .id = MASTER_MFG,
35 .ep = 0,
36 .num_links = 1,
37 .links = { SLAVE_DDR_EMI }
40 static struct mtk_icc_node mmsys = {
41 .name = "mmsys",
42 .id = MASTER_MMSYS,
43 .ep = 0,
44 .num_links = 1,
45 .links = { SLAVE_DDR_EMI }
48 static struct mtk_icc_node mm_vpu = {
49 .name = "mm-vpu",
50 .id = MASTER_MM_VPU,
51 .ep = 0,
52 .num_links = 1,
53 .links = { MASTER_MMSYS }
56 static struct mtk_icc_node mm_disp = {
57 .name = "mm-disp",
58 .id = MASTER_MM_DISP,
59 .ep = 0,
60 .num_links = 1,
61 .links = { MASTER_MMSYS }
64 static struct mtk_icc_node mm_vdec = {
65 .name = "mm-vdec",
66 .id = MASTER_MM_VDEC,
67 .ep = 0,
68 .num_links = 1,
69 .links = { MASTER_MMSYS }
72 static struct mtk_icc_node mm_venc = {
73 .name = "mm-venc",
74 .id = MASTER_MM_VENC,
75 .ep = 0,
76 .num_links = 1,
77 .links = { MASTER_MMSYS }
80 static struct mtk_icc_node mm_cam = {
81 .name = "mm-cam",
82 .id = MASTER_MM_CAM,
83 .ep = 0,
84 .num_links = 1,
85 .links = { MASTER_MMSYS }
88 static struct mtk_icc_node mm_img = {
89 .name = "mm-img",
90 .id = MASTER_MM_IMG,
91 .ep = 0,
92 .num_links = 1,
93 .links = { MASTER_MMSYS }
96 static struct mtk_icc_node mm_mdp = {
97 .name = "mm-mdp",
98 .id = MASTER_MM_MDP,
99 .ep = 0,
100 .num_links = 1,
101 .links = { MASTER_MMSYS }
104 static struct mtk_icc_node *mt8183_emi_icc_nodes[] = {
105 [SLAVE_DDR_EMI] = &ddr_emi,
106 [MASTER_MCUSYS] = &mcusys,
107 [MASTER_MFG] = &gpu,
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 },
125 { /* sentinel */ },
127 MODULE_DEVICE_TABLE(of, mtk_mt8183_emi_icc_of_match);
129 static struct platform_driver mtk_emi_icc_mt8183_driver = {
130 .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");