Debian Codegraph @

drivers/clk/qcom/dispcc-kaanapali.c

raw
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4 */
5
6 #include <linux/clk-provider.h>
7 #include <linux/mod_devicetable.h>
8 #include <linux/module.h>
9 #include <linux/of.h>
10 #include <linux/platform_device.h>
11 #include <linux/pm_runtime.h>
12 #include <linux/regmap.h>
13
14 #include <dt-bindings/clock/qcom,kaanapali-dispcc.h>
15
16 #include "clk-alpha-pll.h"
17 #include "clk-branch.h"
18 #include "clk-pll.h"
19 #include "clk-rcg.h"
20 #include "clk-regmap.h"
21 #include "clk-regmap-divider.h"
22 #include "clk-regmap-mux.h"
23 #include "common.h"
24 #include "gdsc.h"
25 #include "reset.h"
26
27 #define DISP_CC_MISC_CMD 0xF000
28
29 enum {
30 DT_BI_TCXO,
31 DT_BI_TCXO_AO,
32 DT_AHB_CLK,
33 DT_SLEEP_CLK,
34 DT_DP0_PHY_PLL_LINK_CLK,
35 DT_DP0_PHY_PLL_VCO_DIV_CLK,
36 DT_DP1_PHY_PLL_LINK_CLK,
37 DT_DP1_PHY_PLL_VCO_DIV_CLK,
38 DT_DP2_PHY_PLL_LINK_CLK,
39 DT_DP2_PHY_PLL_VCO_DIV_CLK,
40 DT_DP3_PHY_PLL_LINK_CLK,
41 DT_DP3_PHY_PLL_VCO_DIV_CLK,
42 DT_DSI0_PHY_PLL_OUT_BYTECLK,
43 DT_DSI0_PHY_PLL_OUT_DSICLK,
44 DT_DSI1_PHY_PLL_OUT_BYTECLK,
45 DT_DSI1_PHY_PLL_OUT_DSICLK,
46 };
47
48 enum {
49 P_BI_TCXO,
50 P_DISP_CC_PLL0_OUT_MAIN,
51 P_DISP_CC_PLL1_OUT_EVEN,
52 P_DISP_CC_PLL1_OUT_MAIN,
53 P_DISP_CC_PLL2_OUT_MAIN,
54 P_DP0_PHY_PLL_LINK_CLK,
55 P_DP0_PHY_PLL_VCO_DIV_CLK,
56 P_DP1_PHY_PLL_LINK_CLK,
57 P_DP1_PHY_PLL_VCO_DIV_CLK,
58 P_DP2_PHY_PLL_LINK_CLK,
59 P_DP2_PHY_PLL_VCO_DIV_CLK,
60 P_DP3_PHY_PLL_LINK_CLK,
61 P_DP3_PHY_PLL_VCO_DIV_CLK,
62 P_DSI0_PHY_PLL_OUT_BYTECLK,
63 P_DSI0_PHY_PLL_OUT_DSICLK,
64 P_DSI1_PHY_PLL_OUT_BYTECLK,
65 P_DSI1_PHY_PLL_OUT_DSICLK,
66 };
67
68 static const struct pll_vco pongo_eko_t_vco[] = {
69 { 38400000, 153600000, 0 },
70 };
71
72 static const struct pll_vco taycan_eko_t_vco[] = {
73 { 249600000, 2500000000, 0 },
74 };
75
76 /* 257.142858 MHz Configuration */
77 static const struct alpha_pll_config disp_cc_pll0_config = {
78 .l = 0xd,
79 .cal_l = 0x48,
80 .alpha = 0x6492,
81 .config_ctl_val = 0x25c400e7,
82 .config_ctl_hi_val = 0x0a8062e0,
83 .config_ctl_hi1_val = 0xf51dea20,
84 .user_ctl_val = 0x00000008,
85 .user_ctl_hi_val = 0x00000002,
86 };
87
88 static struct clk_alpha_pll disp_cc_pll0 = {
89 .offset = 0x0,
90 .config = &disp_cc_pll0_config,
91 .vco_table = taycan_eko_t_vco,
92 .num_vco = ARRAY_SIZE(taycan_eko_t_vco),
93 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TAYCAN_EKO_T],
94 .clkr = {
95 .hw.init = &(const struct clk_init_data) {
96 .name = "disp_cc_pll0",
97 .parent_data = &(const struct clk_parent_data) {
98 .index = DT_BI_TCXO,
99 },
100 .num_parents = 1,
101 .ops = &clk_alpha_pll_taycan_eko_t_ops,
102 },
103 },
104 };
105
106 /* 300.0 MHz Configuration */
107 static const struct alpha_pll_config disp_cc_pll1_config = {
108 .l = 0xf,
109 .cal_l = 0x48,
110 .alpha = 0xa000,
111 .config_ctl_val = 0x25c400e7,
112 .config_ctl_hi_val = 0x0a8062e0,
113 .config_ctl_hi1_val = 0xf51dea20,
114 .user_ctl_val = 0x00000008,
115 .user_ctl_hi_val = 0x00000002,
116 };
117
118 static struct clk_alpha_pll disp_cc_pll1 = {
119 .offset = 0x1000,
120 .config = &disp_cc_pll1_config,
121 .vco_table = taycan_eko_t_vco,
122 .num_vco = ARRAY_SIZE(taycan_eko_t_vco),
123 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TAYCAN_EKO_T],
124 .clkr = {
125 .hw.init = &(const struct clk_init_data) {
126 .name = "disp_cc_pll1",
127 .parent_data = &(const struct clk_parent_data) {
128 .index = DT_BI_TCXO,
129 },
130 .num_parents = 1,
131 .ops = &clk_alpha_pll_taycan_eko_t_ops,
132 },
133 },
134 };
135
136 /* 38.4 MHz Configuration */
137 static const struct alpha_pll_config disp_cc_pll2_config = {
138 .l = 0x493,
139 .cal_l = 0x493,
140 .alpha = 0x0,
141 .config_ctl_val = 0x60000f68,
142 .config_ctl_hi_val = 0x0001c808,
143 .config_ctl_hi1_val = 0x00000000,
144 .config_ctl_hi2_val = 0x040082f4,
145 .test_ctl_val = 0x00000000,
146 .test_ctl_hi_val = 0x0080c496,
147 .test_ctl_hi1_val = 0x40100080,
148 .test_ctl_hi2_val = 0x001001bc,
149 .test_ctl_hi3_val = 0x002003d8,
150 .user_ctl_val = 0x00000400,
151 .user_ctl_hi_val = 0x00e50302,
152 };
153
154 static struct clk_alpha_pll disp_cc_pll2 = {
155 .offset = 0x2000,
156 .config = &disp_cc_pll2_config,
157 .vco_table = pongo_eko_t_vco,
158 .num_vco = ARRAY_SIZE(pongo_eko_t_vco),
159 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_PONGO_EKO_T],
160 .clkr = {
161 .hw.init = &(const struct clk_init_data) {
162 .name = "disp_cc_pll2",
163 .parent_data = &(const struct clk_parent_data) {
164 .index = DT_SLEEP_CLK,
165 },
166 .num_parents = 1,
167 .ops = &clk_alpha_pll_pongo_eko_t_ops,
168 },
169 },
170 };
171
172 static const struct parent_map disp_cc_parent_map_0[] = {
173 { P_BI_TCXO, 0 },
174 };
175
176 static const struct clk_parent_data disp_cc_parent_data_0[] = {
177 { .index = DT_BI_TCXO },
178 };
179
180 static const struct parent_map disp_cc_parent_map_1[] = {
181 { P_BI_TCXO, 0 },
182 { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
183 { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
184 { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
185 { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
186 };
187
188 static const struct clk_parent_data disp_cc_parent_data_1[] = {
189 { .index = DT_BI_TCXO },
190 { .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
191 { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
192 { .index = DT_DSI1_PHY_PLL_OUT_DSICLK },
193 { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
194 };
195
196 static const struct parent_map disp_cc_parent_map_2[] = {
197 { P_BI_TCXO, 0 },
198 { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
199 { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
200 { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
201 };
202
203 static const struct clk_parent_data disp_cc_parent_data_2[] = {
204 { .index = DT_BI_TCXO },
205 { .index = DT_DP3_PHY_PLL_VCO_DIV_CLK },
206 { .index = DT_DP1_PHY_PLL_VCO_DIV_CLK },
207 { .index = DT_DP2_PHY_PLL_VCO_DIV_CLK },
208 };
209
210 static const struct parent_map disp_cc_parent_map_3[] = {
211 { P_BI_TCXO, 0 },
212 { P_DP1_PHY_PLL_LINK_CLK, 2 },
213 { P_DP2_PHY_PLL_LINK_CLK, 3 },
214 { P_DP3_PHY_PLL_LINK_CLK, 4 },
215 };
216
217 static const struct clk_parent_data disp_cc_parent_data_3[] = {
218 { .index = DT_BI_TCXO },
219 { .index = DT_DP1_PHY_PLL_LINK_CLK },
220 { .index = DT_DP2_PHY_PLL_LINK_CLK },
221 { .index = DT_DP3_PHY_PLL_LINK_CLK },
222 };
223
224 static const struct parent_map disp_cc_parent_map_4[] = {
225 { P_BI_TCXO, 0 },
226 { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
227 { P_DISP_CC_PLL2_OUT_MAIN, 2 },
228 { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
229 };
230
231 static const struct clk_parent_data disp_cc_parent_data_4[] = {
232 { .index = DT_BI_TCXO },
233 { .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
234 { .hw = &disp_cc_pll2.clkr.hw },
235 { .index = DT_DSI1_PHY_PLL_OUT_DSICLK },
236 };
237
238 static const struct parent_map disp_cc_parent_map_5[] = {
239 { P_BI_TCXO, 0 },
240 { P_DP0_PHY_PLL_LINK_CLK, 1 },
241 { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
242 { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
243 { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
244 { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
245 };
246
247 static const struct clk_parent_data disp_cc_parent_data_5[] = {
248 { .index = DT_BI_TCXO },
249 { .index = DT_DP0_PHY_PLL_LINK_CLK },
250 { .index = DT_DP0_PHY_PLL_VCO_DIV_CLK },
251 { .index = DT_DP3_PHY_PLL_VCO_DIV_CLK },
252 { .index = DT_DP1_PHY_PLL_VCO_DIV_CLK },
253 { .index = DT_DP2_PHY_PLL_VCO_DIV_CLK },
254 };
255
256 static const struct parent_map disp_cc_parent_map_6[] = {
257 { P_BI_TCXO, 0 },
258 { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
259 { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
260 };
261
262 static const struct clk_parent_data disp_cc_parent_data_6[] = {
263 { .index = DT_BI_TCXO },
264 { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
265 { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
266 };
267
268 static const struct parent_map disp_cc_parent_map_7[] = {
269 { P_BI_TCXO, 0 },
270 { P_DISP_CC_PLL1_OUT_MAIN, 4 },
271 { P_DISP_CC_PLL1_OUT_EVEN, 6 },
272 };
273
274 static const struct clk_parent_data disp_cc_parent_data_7[] = {
275 { .index = DT_BI_TCXO },
276 { .hw = &disp_cc_pll1.clkr.hw },
277 { .hw = &disp_cc_pll1.clkr.hw },
278 };
279
280 static const struct parent_map disp_cc_parent_map_8[] = {
281 { P_BI_TCXO, 0 },
282 { P_DP0_PHY_PLL_LINK_CLK, 1 },
283 { P_DP1_PHY_PLL_LINK_CLK, 2 },
284 { P_DP2_PHY_PLL_LINK_CLK, 3 },
285 { P_DP3_PHY_PLL_LINK_CLK, 4 },
286 };
287
288 static const struct clk_parent_data disp_cc_parent_data_8[] = {
289 { .index = DT_BI_TCXO },
290 { .index = DT_DP0_PHY_PLL_LINK_CLK },
291 { .index = DT_DP1_PHY_PLL_LINK_CLK },
292 { .index = DT_DP2_PHY_PLL_LINK_CLK },
293 { .index = DT_DP3_PHY_PLL_LINK_CLK },
294 };
295
296 static const struct parent_map disp_cc_parent_map_9[] = {
297 { P_BI_TCXO, 0 },
298 { P_DISP_CC_PLL0_OUT_MAIN, 1 },
299 { P_DISP_CC_PLL1_OUT_MAIN, 4 },
300 { P_DISP_CC_PLL1_OUT_EVEN, 6 },
301 };
302
303 static const struct clk_parent_data disp_cc_parent_data_9[] = {
304 { .index = DT_BI_TCXO },
305 { .hw = &disp_cc_pll0.clkr.hw },
306 { .hw = &disp_cc_pll1.clkr.hw },
307 { .hw = &disp_cc_pll1.clkr.hw },
308 };
309
310 static const struct parent_map disp_cc_parent_map_10[] = {
311 { P_BI_TCXO, 0 },
312 { P_DISP_CC_PLL2_OUT_MAIN, 2 },
313 };
314
315 static const struct clk_parent_data disp_cc_parent_data_10[] = {
316 { .index = DT_BI_TCXO },
317 { .hw = &disp_cc_pll2.clkr.hw },
318 };
319
320 static const struct freq_tbl ftbl_disp_cc_esync0_clk_src[] = {
321 F(19200000, P_BI_TCXO, 1, 0, 0),
322 { }
323 };
324
325 static struct clk_rcg2 disp_cc_esync0_clk_src = {
326 .cmd_rcgr = 0x80d4,
327 .mnd_width = 16,
328 .hid_width = 5,
329 .parent_map = disp_cc_parent_map_4,
330 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
331 .clkr.hw.init = &(const struct clk_init_data) {
332 .name = "disp_cc_esync0_clk_src",
333 .parent_data = disp_cc_parent_data_4,
334 .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
335 .flags = CLK_SET_RATE_PARENT,
336 .ops = &clk_pixel_ops,
337 },
338 };
339
340 static struct clk_rcg2 disp_cc_esync1_clk_src = {
341 .cmd_rcgr = 0x80ec,
342 .mnd_width = 16,
343 .hid_width = 5,
344 .parent_map = disp_cc_parent_map_4,
345 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
346 .clkr.hw.init = &(const struct clk_init_data) {
347 .name = "disp_cc_esync1_clk_src",
348 .parent_data = disp_cc_parent_data_4,
349 .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
350 .flags = CLK_SET_RATE_PARENT,
351 .ops = &clk_pixel_ops,
352 },
353 };
354
355 static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
356 F(19200000, P_BI_TCXO, 1, 0, 0),
357 F(100000000, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
358 F(120000000, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
359 F(165000000, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
360 F(200000000, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
361 F(233333333, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
362 F(261666667, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
363 F(283333333, P_DISP_CC_PLL1_OUT_EVEN, 3, 0, 0),
364 { }
365 };
366
367 static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
368 .cmd_rcgr = 0x8378,
369 .mnd_width = 0,
370 .hid_width = 5,
371 .parent_map = disp_cc_parent_map_7,
372 .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
373 .hw_clk_ctrl = true,
374 .clkr.hw.init = &(const struct clk_init_data) {
375 .name = "disp_cc_mdss_ahb_clk_src",
376 .parent_data = disp_cc_parent_data_7,
377 .num_parents = ARRAY_SIZE(disp_cc_parent_data_7),
378 .flags = CLK_SET_RATE_PARENT,
379 .ops = &clk_rcg2_shared_ops,
380 },
381 };
382
383 static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
384 .cmd_rcgr = 0x8194,
385 .mnd_width = 0,
386 .hid_width = 5,
387 .parent_map = disp_cc_parent_map_1,
388 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
389 .clkr.hw.init = &(const struct clk_init_data) {
390 .name = "disp_cc_mdss_byte0_clk_src",
391 .parent_data = disp_cc_parent_data_1,
392 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
393 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
394 .ops = &clk_byte2_ops,
395 },
396 };
397
398 static struct clk_rcg2 disp_cc_mdss_byte1_clk_src = {
399 .cmd_rcgr = 0x81b0,
400 .mnd_width = 0,
401 .hid_width = 5,
402 .parent_map = disp_cc_parent_map_1,
403 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
404 .clkr.hw.init = &(const struct clk_init_data) {
405 .name = "disp_cc_mdss_byte1_clk_src",
406 .parent_data = disp_cc_parent_data_1,
407 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
408 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
409 .ops = &clk_byte2_ops,
410 },
411 };
412
413 static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
414 .cmd_rcgr = 0x8248,
415 .mnd_width = 0,
416 .hid_width = 5,
417 .parent_map = disp_cc_parent_map_0,
418 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
419 .clkr.hw.init = &(const struct clk_init_data) {
420 .name = "disp_cc_mdss_dptx0_aux_clk_src",
421 .parent_data = disp_cc_parent_data_0,
422 .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
423 .flags = CLK_SET_RATE_PARENT,
424 .ops = &clk_rcg2_ops,
425 },
426 };
427
428 static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
429 .cmd_rcgr = 0x81fc,
430 .mnd_width = 0,
431 .hid_width = 5,
432 .parent_map = disp_cc_parent_map_8,
433 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
434 .clkr.hw.init = &(const struct clk_init_data) {
435 .name = "disp_cc_mdss_dptx0_link_clk_src",
436 .parent_data = disp_cc_parent_data_8,
437 .num_parents = ARRAY_SIZE(disp_cc_parent_data_8),
438 .flags = CLK_SET_RATE_PARENT,
439 .ops = &clk_byte2_ops,
440 },
441 };
442
443 static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
444 .cmd_rcgr = 0x8218,
445 .mnd_width = 16,
446 .hid_width = 5,
447 .parent_map = disp_cc_parent_map_5,
448 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
449 .clkr.hw.init = &(const struct clk_init_data) {
450 .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
451 .parent_data = disp_cc_parent_data_5,
452 .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
453 .flags = CLK_SET_RATE_PARENT,
454 .ops = &clk_dp_ops,
455 },
456 };
457
458 static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
459 .cmd_rcgr = 0x8230,
460 .mnd_width = 16,
461 .hid_width = 5,
462 .parent_map = disp_cc_parent_map_5,
463 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
464 .clkr.hw.init = &(const struct clk_init_data) {
465 .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
466 .parent_data = disp_cc_parent_data_5,
467 .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
468 .flags = CLK_SET_RATE_PARENT,
469 .ops = &clk_dp_ops,
470 },
471 };
472
473 static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = {
474 .cmd_rcgr = 0x82ac,
475 .mnd_width = 0,
476 .hid_width = 5,
477 .parent_map = disp_cc_parent_map_0,
478 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
479 .clkr.hw.init = &(const struct clk_init_data) {
480 .name = "disp_cc_mdss_dptx1_aux_clk_src",
481 .parent_data = disp_cc_parent_data_0,
482 .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
483 .flags = CLK_SET_RATE_PARENT,
484 .ops = &clk_rcg2_shared_ops,
485 },
486 };
487
488 static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = {
489 .cmd_rcgr = 0x8290,
490 .mnd_width = 0,
491 .hid_width = 5,
492 .parent_map = disp_cc_parent_map_3,
493 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
494 .clkr.hw.init = &(const struct clk_init_data) {
495 .name = "disp_cc_mdss_dptx1_link_clk_src",
496 .parent_data = disp_cc_parent_data_3,
497 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
498 .flags = CLK_SET_RATE_PARENT,
499 .ops = &clk_byte2_ops,
500 },
501 };
502
503 static struct clk_rcg2 disp_cc_mdss_dptx1_pixel0_clk_src = {
504 .cmd_rcgr = 0x8260,
505 .mnd_width = 16,
506 .hid_width = 5,
507 .parent_map = disp_cc_parent_map_2,
508 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
509 .clkr.hw.init = &(const struct clk_init_data) {
510 .name = "disp_cc_mdss_dptx1_pixel0_clk_src",
511 .parent_data = disp_cc_parent_data_2,
512 .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
513 .flags = CLK_SET_RATE_PARENT,
514 .ops = &clk_dp_ops,
515 },
516 };
517
518 static struct clk_rcg2 disp_cc_mdss_dptx1_pixel1_clk_src = {
519 .cmd_rcgr = 0x8278,
520 .mnd_width = 16,
521 .hid_width = 5,
522 .parent_map = disp_cc_parent_map_2,
523 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
524 .clkr.hw.init = &(const struct clk_init_data) {
525 .name = "disp_cc_mdss_dptx1_pixel1_clk_src",
526 .parent_data = disp_cc_parent_data_2,
527 .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
528 .flags = CLK_SET_RATE_PARENT,
529 .ops = &clk_dp_ops,
530 },
531 };
532
533 static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = {
534 .cmd_rcgr = 0x8310,
535 .mnd_width = 0,
536 .hid_width = 5,
537 .parent_map = disp_cc_parent_map_0,
538 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
539 .clkr.hw.init = &(const struct clk_init_data) {
540 .name = "disp_cc_mdss_dptx2_aux_clk_src",
541 .parent_data = disp_cc_parent_data_0,
542 .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
543 .flags = CLK_SET_RATE_PARENT,
544 .ops = &clk_rcg2_shared_ops,
545 },
546 };
547
548 static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = {
549 .cmd_rcgr = 0x82c4,
550 .mnd_width = 0,
551 .hid_width = 5,
552 .parent_map = disp_cc_parent_map_3,
553 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
554 .clkr.hw.init = &(const struct clk_init_data) {
555 .name = "disp_cc_mdss_dptx2_link_clk_src",
556 .parent_data = disp_cc_parent_data_3,
557 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
558 .flags = CLK_SET_RATE_PARENT,
559 .ops = &clk_byte2_ops,
560 },
561 };
562
563 static struct clk_rcg2 disp_cc_mdss_dptx2_pixel0_clk_src = {
564 .cmd_rcgr = 0x82e0,
565 .mnd_width = 16,
566 .hid_width = 5,
567 .parent_map = disp_cc_parent_map_2,
568 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
569 .clkr.hw.init = &(const struct clk_init_data) {
570 .name = "disp_cc_mdss_dptx2_pixel0_clk_src",
571 .parent_data = disp_cc_parent_data_2,
572 .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
573 .flags = CLK_SET_RATE_PARENT,
574 .ops = &clk_dp_ops,
575 },
576 };
577
578 static struct clk_rcg2 disp_cc_mdss_dptx2_pixel1_clk_src = {
579 .cmd_rcgr = 0x82f8,
580 .mnd_width = 16,
581 .hid_width = 5,
582 .parent_map = disp_cc_parent_map_2,
583 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
584 .clkr.hw.init = &(const struct clk_init_data) {
585 .name = "disp_cc_mdss_dptx2_pixel1_clk_src",
586 .parent_data = disp_cc_parent_data_2,
587 .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
588 .flags = CLK_SET_RATE_PARENT,
589 .ops = &clk_dp_ops,
590 },
591 };
592
593 static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = {
594 .cmd_rcgr = 0x835c,
595 .mnd_width = 0,
596 .hid_width = 5,
597 .parent_map = disp_cc_parent_map_0,
598 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
599 .clkr.hw.init = &(const struct clk_init_data) {
600 .name = "disp_cc_mdss_dptx3_aux_clk_src",
601 .parent_data = disp_cc_parent_data_0,
602 .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
603 .flags = CLK_SET_RATE_PARENT,
604 .ops = &clk_rcg2_shared_ops,
605 },
606 };
607
608 static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = {
609 .cmd_rcgr = 0x8340,
610 .mnd_width = 0,
611 .hid_width = 5,
612 .parent_map = disp_cc_parent_map_3,
613 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
614 .clkr.hw.init = &(const struct clk_init_data) {
615 .name = "disp_cc_mdss_dptx3_link_clk_src",
616 .parent_data = disp_cc_parent_data_3,
617 .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
618 .flags = CLK_SET_RATE_PARENT,
619 .ops = &clk_byte2_ops,
620 },
621 };
622
623 static struct clk_rcg2 disp_cc_mdss_dptx3_pixel0_clk_src = {
624 .cmd_rcgr = 0x8328,
625 .mnd_width = 16,
626 .hid_width = 5,
627 .parent_map = disp_cc_parent_map_2,
628 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
629 .clkr.hw.init = &(const struct clk_init_data) {
630 .name = "disp_cc_mdss_dptx3_pixel0_clk_src",
631 .parent_data = disp_cc_parent_data_2,
632 .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
633 .flags = CLK_SET_RATE_PARENT,
634 .ops = &clk_dp_ops,
635 },
636 };
637
638 static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
639 .cmd_rcgr = 0x81cc,
640 .mnd_width = 0,
641 .hid_width = 5,
642 .parent_map = disp_cc_parent_map_6,
643 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
644 .clkr.hw.init = &(const struct clk_init_data) {
645 .name = "disp_cc_mdss_esc0_clk_src",
646 .parent_data = disp_cc_parent_data_6,
647 .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
648 .flags = CLK_SET_RATE_PARENT,
649 .ops = &clk_rcg2_shared_ops,
650 },
651 };
652
653 static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = {
654 .cmd_rcgr = 0x81e4,
655 .mnd_width = 0,
656 .hid_width = 5,
657 .parent_map = disp_cc_parent_map_6,
658 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
659 .clkr.hw.init = &(const struct clk_init_data) {
660 .name = "disp_cc_mdss_esc1_clk_src",
661 .parent_data = disp_cc_parent_data_6,
662 .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
663 .flags = CLK_SET_RATE_PARENT,
664 .ops = &clk_rcg2_shared_ops,
665 },
666 };
667
668 static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
669 F(19200000, P_BI_TCXO, 1, 0, 0),
670 F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
671 F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
672 F(156000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
673 F(207000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
674 F(337000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
675 F(417000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
676 F(532000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
677 F(600000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
678 F(650000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
679 { }
680 };
681
682 static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
683 .cmd_rcgr = 0x8164,
684 .mnd_width = 0,
685 .hid_width = 5,
686 .parent_map = disp_cc_parent_map_9,
687 .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
688 .hw_clk_ctrl = true,
689 .clkr.hw.init = &(const struct clk_init_data) {
690 .name = "disp_cc_mdss_mdp_clk_src",
691 .parent_data = disp_cc_parent_data_9,
692 .num_parents = ARRAY_SIZE(disp_cc_parent_data_9),
693 .flags = CLK_SET_RATE_PARENT,
694 .ops = &clk_rcg2_shared_ops,
695 },
696 };
697
698 static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
699 .cmd_rcgr = 0x811c,
700 .mnd_width = 8,
701 .hid_width = 5,
702 .parent_map = disp_cc_parent_map_1,
703 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
704 .clkr.hw.init = &(const struct clk_init_data) {
705 .name = "disp_cc_mdss_pclk0_clk_src",
706 .parent_data = disp_cc_parent_data_1,
707 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
708 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
709 .ops = &clk_pixel_ops,
710 },
711 };
712
713 static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
714 .cmd_rcgr = 0x8134,
715 .mnd_width = 8,
716 .hid_width = 5,
717 .parent_map = disp_cc_parent_map_1,
718 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
719 .clkr.hw.init = &(const struct clk_init_data) {
720 .name = "disp_cc_mdss_pclk1_clk_src",
721 .parent_data = disp_cc_parent_data_1,
722 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
723 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
724 .ops = &clk_pixel_ops,
725 },
726 };
727
728 static struct clk_rcg2 disp_cc_mdss_pclk2_clk_src = {
729 .cmd_rcgr = 0x814c,
730 .mnd_width = 8,
731 .hid_width = 5,
732 .parent_map = disp_cc_parent_map_1,
733 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
734 .clkr.hw.init = &(const struct clk_init_data) {
735 .name = "disp_cc_mdss_pclk2_clk_src",
736 .parent_data = disp_cc_parent_data_1,
737 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
738 .flags = CLK_SET_RATE_PARENT,
739 .ops = &clk_pixel_ops,
740 },
741 };
742
743 static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
744 .cmd_rcgr = 0x817c,
745 .mnd_width = 0,
746 .hid_width = 5,
747 .parent_map = disp_cc_parent_map_0,
748 .freq_tbl = ftbl_disp_cc_esync0_clk_src,
749 .clkr.hw.init = &(const struct clk_init_data) {
750 .name = "disp_cc_mdss_vsync_clk_src",
751 .parent_data = disp_cc_parent_data_0,
752 .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
753 .flags = CLK_SET_RATE_PARENT,
754 .ops = &clk_rcg2_shared_ops,
755 },
756 };
757
758 static const struct freq_tbl ftbl_disp_cc_osc_clk_src[] = {
759 F(38400000, P_DISP_CC_PLL2_OUT_MAIN, 1, 0, 0),
760 { }
761 };
762
763 static struct clk_rcg2 disp_cc_osc_clk_src = {
764 .cmd_rcgr = 0x8104,
765 .mnd_width = 0,
766 .hid_width = 5,
767 .parent_map = disp_cc_parent_map_10,
768 .freq_tbl = ftbl_disp_cc_osc_clk_src,
769 .clkr.hw.init = &(const struct clk_init_data) {
770 .name = "disp_cc_osc_clk_src",
771 .parent_data = disp_cc_parent_data_10,
772 .num_parents = ARRAY_SIZE(disp_cc_parent_data_10),
773 .flags = CLK_SET_RATE_PARENT,
774 .ops = &clk_rcg2_shared_ops,
775 },
776 };
777
778 static struct clk_regmap_div disp_cc_mdss_ahb_swi_div_clk_src = {
779 .reg = 0x8374,
780 .shift = 0,
781 .width = 4,
782 .clkr.hw.init = &(const struct clk_init_data) {
783 .name = "disp_cc_mdss_ahb_swi_div_clk_src",
784 .parent_hws = (const struct clk_hw*[]) {
785 &disp_cc_mdss_ahb_clk_src.clkr.hw,
786 },
787 .num_parents = 1,
788 .flags = CLK_SET_RATE_PARENT,
789 .ops = &clk_regmap_div_ro_ops,
790 },
791 };
792
793 static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
794 .reg = 0x81ac,
795 .shift = 0,
796 .width = 4,
797 .clkr.hw.init = &(const struct clk_init_data) {
798 .name = "disp_cc_mdss_byte0_div_clk_src",
799 .parent_hws = (const struct clk_hw*[]) {
800 &disp_cc_mdss_byte0_clk_src.clkr.hw,
801 },
802 .num_parents = 1,
803 .ops = &clk_regmap_div_ops,
804 },
805 };
806
807 static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = {
808 .reg = 0x81c8,
809 .shift = 0,
810 .width = 4,
811 .clkr.hw.init = &(const struct clk_init_data) {
812 .name = "disp_cc_mdss_byte1_div_clk_src",
813 .parent_hws = (const struct clk_hw*[]) {
814 &disp_cc_mdss_byte1_clk_src.clkr.hw,
815 },
816 .num_parents = 1,
817 .ops = &clk_regmap_div_ops,
818 },
819 };
820
821 static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
822 .reg = 0x8214,
823 .shift = 0,
824 .width = 4,
825 .clkr.hw.init = &(const struct clk_init_data) {
826 .name = "disp_cc_mdss_dptx0_link_div_clk_src",
827 .parent_hws = (const struct clk_hw*[]) {
828 &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
829 },
830 .num_parents = 1,
831 .flags = CLK_SET_RATE_PARENT,
832 .ops = &clk_regmap_div_ro_ops,
833 },
834 };
835
836 static struct clk_regmap_div disp_cc_mdss_dptx1_link_div_clk_src = {
837 .reg = 0x82a8,
838 .shift = 0,
839 .width = 4,
840 .clkr.hw.init = &(const struct clk_init_data) {
841 .name = "disp_cc_mdss_dptx1_link_div_clk_src",
842 .parent_hws = (const struct clk_hw*[]) {
843 &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
844 },
845 .num_parents = 1,
846 .flags = CLK_SET_RATE_PARENT,
847 .ops = &clk_regmap_div_ro_ops,
848 },
849 };
850
851 static struct clk_regmap_div disp_cc_mdss_dptx2_link_div_clk_src = {
852 .reg = 0x82dc,
853 .shift = 0,
854 .width = 4,
855 .clkr.hw.init = &(const struct clk_init_data) {
856 .name = "disp_cc_mdss_dptx2_link_div_clk_src",
857 .parent_hws = (const struct clk_hw*[]) {
858 &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
859 },
860 .num_parents = 1,
861 .flags = CLK_SET_RATE_PARENT,
862 .ops = &clk_regmap_div_ro_ops,
863 },
864 };
865
866 static struct clk_regmap_div disp_cc_mdss_dptx3_link_div_clk_src = {
867 .reg = 0x8358,
868 .shift = 0,
869 .width = 4,
870 .clkr.hw.init = &(const struct clk_init_data) {
871 .name = "disp_cc_mdss_dptx3_link_div_clk_src",
872 .parent_hws = (const struct clk_hw*[]) {
873 &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
874 },
875 .num_parents = 1,
876 .flags = CLK_SET_RATE_PARENT,
877 .ops = &clk_regmap_div_ro_ops,
878 },
879 };
880
881 static struct clk_branch disp_cc_esync0_clk = {
882 .halt_reg = 0x80cc,
883 .halt_check = BRANCH_HALT,
884 .clkr = {
885 .enable_reg = 0x80cc,
886 .enable_mask = BIT(0),
887 .hw.init = &(const struct clk_init_data) {
888 .name = "disp_cc_esync0_clk",
889 .parent_hws = (const struct clk_hw*[]) {
890 &disp_cc_esync0_clk_src.clkr.hw,
891 },
892 .num_parents = 1,
893 .flags = CLK_SET_RATE_PARENT,
894 .ops = &clk_branch2_ops,
895 },
896 },
897 };
898
899 static struct clk_branch disp_cc_esync1_clk = {
900 .halt_reg = 0x80d0,
901 .halt_check = BRANCH_HALT,
902 .clkr = {
903 .enable_reg = 0x80d0,
904 .enable_mask = BIT(0),
905 .hw.init = &(const struct clk_init_data) {
906 .name = "disp_cc_esync1_clk",
907 .parent_hws = (const struct clk_hw*[]) {
908 &disp_cc_esync1_clk_src.clkr.hw,
909 },
910 .num_parents = 1,
911 .flags = CLK_SET_RATE_PARENT,
912 .ops = &clk_branch2_ops,
913 },
914 },
915 };
916
917 static struct clk_branch disp_cc_mdss_accu_shift_clk = {
918 .halt_reg = 0xe060,
919 .halt_check = BRANCH_HALT_VOTED,
920 .clkr = {
921 .enable_reg = 0xe060,
922 .enable_mask = BIT(0),
923 .hw.init = &(const struct clk_init_data) {
924 .name = "disp_cc_mdss_accu_shift_clk",
925 .ops = &clk_branch2_ops,
926 },
927 },
928 };
929
930 static struct clk_branch disp_cc_mdss_ahb1_clk = {
931 .halt_reg = 0xa028,
932 .halt_check = BRANCH_HALT,
933 .clkr = {
934 .enable_reg = 0xa028,
935 .enable_mask = BIT(0),
936 .hw.init = &(const struct clk_init_data) {
937 .name = "disp_cc_mdss_ahb1_clk",
938 .parent_hws = (const struct clk_hw*[]) {
939 &disp_cc_mdss_ahb_clk_src.clkr.hw,
940 },
941 .num_parents = 1,
942 .flags = CLK_SET_RATE_PARENT,
943 .ops = &clk_branch2_ops,
944 },
945 },
946 };
947
948 static struct clk_branch disp_cc_mdss_ahb_clk = {
949 .halt_reg = 0x80c4,
950 .halt_check = BRANCH_HALT,
951 .clkr = {
952 .enable_reg = 0x80c4,
953 .enable_mask = BIT(0),
954 .hw.init = &(const struct clk_init_data) {
955 .name = "disp_cc_mdss_ahb_clk",
956 .parent_hws = (const struct clk_hw*[]) {
957 &disp_cc_mdss_ahb_clk_src.clkr.hw,
958 },
959 .num_parents = 1,
960 .flags = CLK_SET_RATE_PARENT,
961 .ops = &clk_branch2_ops,
962 },
963 },
964 };
965
966 static struct clk_branch disp_cc_mdss_ahb_swi_clk = {
967 .halt_reg = 0x80c0,
968 .halt_check = BRANCH_HALT,
969 .clkr = {
970 .enable_reg = 0x80c0,
971 .enable_mask = BIT(0),
972 .hw.init = &(const struct clk_init_data) {
973 .name = "disp_cc_mdss_ahb_swi_clk",
974 .parent_hws = (const struct clk_hw*[]) {
975 &disp_cc_mdss_ahb_swi_div_clk_src.clkr.hw,
976 },
977 .num_parents = 1,
978 .flags = CLK_SET_RATE_PARENT,
979 .ops = &clk_branch2_ops,
980 },
981 },
982 };
983
984 static struct clk_branch disp_cc_mdss_byte0_clk = {
985 .halt_reg = 0x8044,
986 .halt_check = BRANCH_HALT,
987 .clkr = {
988 .enable_reg = 0x8044,
989 .enable_mask = BIT(0),
990 .hw.init = &(const struct clk_init_data) {
991 .name = "disp_cc_mdss_byte0_clk",
992 .parent_hws = (const struct clk_hw*[]) {
993 &disp_cc_mdss_byte0_clk_src.clkr.hw,
994 },
995 .num_parents = 1,
996 .flags = CLK_SET_RATE_PARENT,
997 .ops = &clk_branch2_ops,
998 },
999 },
1000 };
1001
1002 static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
1003 .halt_reg = 0x8048,
1004 .halt_check = BRANCH_HALT,
1005 .clkr = {
1006 .enable_reg = 0x8048,
1007 .enable_mask = BIT(0),
1008 .hw.init = &(const struct clk_init_data) {
1009 .name = "disp_cc_mdss_byte0_intf_clk",
1010 .parent_hws = (const struct clk_hw*[]) {
1011 &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
1012 },
1013 .num_parents = 1,
1014 .flags = CLK_SET_RATE_PARENT,
1015 .ops = &clk_branch2_ops,
1016 },
1017 },
1018 };
1019
1020 static struct clk_branch disp_cc_mdss_byte1_clk = {
1021 .halt_reg = 0x804c,
1022 .halt_check = BRANCH_HALT,
1023 .clkr = {
1024 .enable_reg = 0x804c,
1025 .enable_mask = BIT(0),
1026 .hw.init = &(const struct clk_init_data) {
1027 .name = "disp_cc_mdss_byte1_clk",
1028 .parent_hws = (const struct clk_hw*[]) {
1029 &disp_cc_mdss_byte1_clk_src.clkr.hw,
1030 },
1031 .num_parents = 1,
1032 .flags = CLK_SET_RATE_PARENT,
1033 .ops = &clk_branch2_ops,
1034 },
1035 },
1036 };
1037
1038 static struct clk_branch disp_cc_mdss_byte1_intf_clk = {
1039 .halt_reg = 0x8050,
1040 .halt_check = BRANCH_HALT,
1041 .clkr = {
1042 .enable_reg = 0x8050,
1043 .enable_mask = BIT(0),
1044 .hw.init = &(const struct clk_init_data) {
1045 .name = "disp_cc_mdss_byte1_intf_clk",
1046 .parent_hws = (const struct clk_hw*[]) {
1047 &disp_cc_mdss_byte1_div_clk_src.clkr.hw,
1048 },
1049 .num_parents = 1,
1050 .flags = CLK_SET_RATE_PARENT,
1051 .ops = &clk_branch2_ops,
1052 },
1053 },
1054 };
1055
1056 static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
1057 .halt_reg = 0x8074,
1058 .halt_check = BRANCH_HALT,
1059 .clkr = {
1060 .enable_reg = 0x8074,
1061 .enable_mask = BIT(0),
1062 .hw.init = &(const struct clk_init_data) {
1063 .name = "disp_cc_mdss_dptx0_aux_clk",
1064 .parent_hws = (const struct clk_hw*[]) {
1065 &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
1066 },
1067 .num_parents = 1,
1068 .flags = CLK_SET_RATE_PARENT,
1069 .ops = &clk_branch2_ops,
1070 },
1071 },
1072 };
1073
1074 static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = {
1075 .halt_reg = 0x8068,
1076 .halt_check = BRANCH_HALT_VOTED,
1077 .clkr = {
1078 .enable_reg = 0x8068,
1079 .enable_mask = BIT(0),
1080 .hw.init = &(const struct clk_init_data) {
1081 .name = "disp_cc_mdss_dptx0_crypto_clk",
1082 .parent_hws = (const struct clk_hw*[]) {
1083 &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
1084 },
1085 .num_parents = 1,
1086 .flags = CLK_SET_RATE_PARENT,
1087 .ops = &clk_branch2_ops,
1088 },
1089 },
1090 };
1091
1092 static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
1093 .halt_reg = 0x805c,
1094 .halt_check = BRANCH_HALT,
1095 .clkr = {
1096 .enable_reg = 0x805c,
1097 .enable_mask = BIT(0),
1098 .hw.init = &(const struct clk_init_data) {
1099 .name = "disp_cc_mdss_dptx0_link_clk",
1100 .parent_hws = (const struct clk_hw*[]) {
1101 &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
1102 },
1103 .num_parents = 1,
1104 .flags = CLK_SET_RATE_PARENT,
1105 .ops = &clk_branch2_ops,
1106 },
1107 },
1108 };
1109
1110 static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
1111 .halt_reg = 0x8064,
1112 .halt_check = BRANCH_HALT,
1113 .clkr = {
1114 .enable_reg = 0x8064,
1115 .enable_mask = BIT(0),
1116 .hw.init = &(const struct clk_init_data) {
1117 .name = "disp_cc_mdss_dptx0_link_intf_clk",
1118 .parent_hws = (const struct clk_hw*[]) {
1119 &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
1120 },
1121 .num_parents = 1,
1122 .flags = CLK_SET_RATE_PARENT,
1123 .ops = &clk_branch2_ops,
1124 },
1125 },
1126 };
1127
1128 static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
1129 .halt_reg = 0x806c,
1130 .halt_check = BRANCH_HALT,
1131 .clkr = {
1132 .enable_reg = 0x806c,
1133 .enable_mask = BIT(0),
1134 .hw.init = &(const struct clk_init_data) {
1135 .name = "disp_cc_mdss_dptx0_pixel0_clk",
1136 .parent_hws = (const struct clk_hw*[]) {
1137 &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
1138 },
1139 .num_parents = 1,
1140 .flags = CLK_SET_RATE_PARENT,
1141 .ops = &clk_branch2_ops,
1142 },
1143 },
1144 };
1145
1146 static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
1147 .halt_reg = 0x8070,
1148 .halt_check = BRANCH_HALT,
1149 .clkr = {
1150 .enable_reg = 0x8070,
1151 .enable_mask = BIT(0),
1152 .hw.init = &(const struct clk_init_data) {
1153 .name = "disp_cc_mdss_dptx0_pixel1_clk",
1154 .parent_hws = (const struct clk_hw*[]) {
1155 &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
1156 },
1157 .num_parents = 1,
1158 .flags = CLK_SET_RATE_PARENT,
1159 .ops = &clk_branch2_ops,
1160 },
1161 },
1162 };
1163
1164 static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
1165 .halt_reg = 0x8060,
1166 .halt_check = BRANCH_HALT,
1167 .clkr = {
1168 .enable_reg = 0x8060,
1169 .enable_mask = BIT(0),
1170 .hw.init = &(const struct clk_init_data) {
1171 .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
1172 .parent_hws = (const struct clk_hw*[]) {
1173 &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
1174 },
1175 .num_parents = 1,
1176 .flags = CLK_SET_RATE_PARENT,
1177 .ops = &clk_branch2_ops,
1178 },
1179 },
1180 };
1181
1182 static struct clk_branch disp_cc_mdss_dptx1_aux_clk = {
1183 .halt_reg = 0x8090,
1184 .halt_check = BRANCH_HALT,
1185 .clkr = {
1186 .enable_reg = 0x8090,
1187 .enable_mask = BIT(0),
1188 .hw.init = &(const struct clk_init_data) {
1189 .name = "disp_cc_mdss_dptx1_aux_clk",
1190 .parent_hws = (const struct clk_hw*[]) {
1191 &disp_cc_mdss_dptx1_aux_clk_src.clkr.hw,
1192 },
1193 .num_parents = 1,
1194 .flags = CLK_SET_RATE_PARENT,
1195 .ops = &clk_branch2_ops,
1196 },
1197 },
1198 };
1199
1200 static struct clk_branch disp_cc_mdss_dptx1_crypto_clk = {
1201 .halt_reg = 0x808c,
1202 .halt_check = BRANCH_HALT_VOTED,
1203 .clkr = {
1204 .enable_reg = 0x808c,
1205 .enable_mask = BIT(0),
1206 .hw.init = &(const struct clk_init_data) {
1207 .name = "disp_cc_mdss_dptx1_crypto_clk",
1208 .parent_hws = (const struct clk_hw*[]) {
1209 &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
1210 },
1211 .num_parents = 1,
1212 .flags = CLK_SET_RATE_PARENT,
1213 .ops = &clk_branch2_ops,
1214 },
1215 },
1216 };
1217
1218 static struct clk_branch disp_cc_mdss_dptx1_link_clk = {
1219 .halt_reg = 0x8080,
1220 .halt_check = BRANCH_HALT,
1221 .clkr = {
1222 .enable_reg = 0x8080,
1223 .enable_mask = BIT(0),
1224 .hw.init = &(const struct clk_init_data) {
1225 .name = "disp_cc_mdss_dptx1_link_clk",
1226 .parent_hws = (const struct clk_hw*[]) {
1227 &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
1228 },
1229 .num_parents = 1,
1230 .flags = CLK_SET_RATE_PARENT,
1231 .ops = &clk_branch2_ops,
1232 },
1233 },
1234 };
1235
1236 static struct clk_branch disp_cc_mdss_dptx1_link_intf_clk = {
1237 .halt_reg = 0x8088,
1238 .halt_check = BRANCH_HALT,
1239 .clkr = {
1240 .enable_reg = 0x8088,
1241 .enable_mask = BIT(0),
1242 .hw.init = &(const struct clk_init_data) {
1243 .name = "disp_cc_mdss_dptx1_link_intf_clk",
1244 .parent_hws = (const struct clk_hw*[]) {
1245 &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
1246 },
1247 .num_parents = 1,
1248 .flags = CLK_SET_RATE_PARENT,
1249 .ops = &clk_branch2_ops,
1250 },
1251 },
1252 };
1253
1254 static struct clk_branch disp_cc_mdss_dptx1_pixel0_clk = {
1255 .halt_reg = 0x8078,
1256 .halt_check = BRANCH_HALT,
1257 .clkr = {
1258 .enable_reg = 0x8078,
1259 .enable_mask = BIT(0),
1260 .hw.init = &(const struct clk_init_data) {
1261 .name = "disp_cc_mdss_dptx1_pixel0_clk",
1262 .parent_hws = (const struct clk_hw*[]) {
1263 &disp_cc_mdss_dptx1_pixel0_clk_src.clkr.hw,
1264 },
1265 .num_parents = 1,
1266 .flags = CLK_SET_RATE_PARENT,
1267 .ops = &clk_branch2_ops,
1268 },
1269 },
1270 };
1271
1272 static struct clk_branch disp_cc_mdss_dptx1_pixel1_clk = {
1273 .halt_reg = 0x807c,
1274 .halt_check = BRANCH_HALT,
1275 .clkr = {
1276 .enable_reg = 0x807c,
1277 .enable_mask = BIT(0),
1278 .hw.init = &(const struct clk_init_data) {
1279 .name = "disp_cc_mdss_dptx1_pixel1_clk",
1280 .parent_hws = (const struct clk_hw*[]) {
1281 &disp_cc_mdss_dptx1_pixel1_clk_src.clkr.hw,
1282 },
1283 .num_parents = 1,
1284 .flags = CLK_SET_RATE_PARENT,
1285 .ops = &clk_branch2_ops,
1286 },
1287 },
1288 };
1289
1290 static struct clk_branch disp_cc_mdss_dptx1_usb_router_link_intf_clk = {
1291 .halt_reg = 0x8084,
1292 .halt_check = BRANCH_HALT,
1293 .clkr = {
1294 .enable_reg = 0x8084,
1295 .enable_mask = BIT(0),
1296 .hw.init = &(const struct clk_init_data) {
1297 .name = "disp_cc_mdss_dptx1_usb_router_link_intf_clk",
1298 .parent_hws = (const struct clk_hw*[]) {
1299 &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
1300 },
1301 .num_parents = 1,
1302 .flags = CLK_SET_RATE_PARENT,
1303 .ops = &clk_branch2_ops,
1304 },
1305 },
1306 };
1307
1308 static struct clk_branch disp_cc_mdss_dptx2_aux_clk = {
1309 .halt_reg = 0x80a8,
1310 .halt_check = BRANCH_HALT,
1311 .clkr = {
1312 .enable_reg = 0x80a8,
1313 .enable_mask = BIT(0),
1314 .hw.init = &(const struct clk_init_data) {
1315 .name = "disp_cc_mdss_dptx2_aux_clk",
1316 .parent_hws = (const struct clk_hw*[]) {
1317 &disp_cc_mdss_dptx2_aux_clk_src.clkr.hw,
1318 },
1319 .num_parents = 1,
1320 .flags = CLK_SET_RATE_PARENT,
1321 .ops = &clk_branch2_ops,
1322 },
1323 },
1324 };
1325
1326 static struct clk_branch disp_cc_mdss_dptx2_crypto_clk = {
1327 .halt_reg = 0x80a4,
1328 .halt_check = BRANCH_HALT_VOTED,
1329 .clkr = {
1330 .enable_reg = 0x80a4,
1331 .enable_mask = BIT(0),
1332 .hw.init = &(const struct clk_init_data) {
1333 .name = "disp_cc_mdss_dptx2_crypto_clk",
1334 .parent_hws = (const struct clk_hw*[]) {
1335 &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
1336 },
1337 .num_parents = 1,
1338 .flags = CLK_SET_RATE_PARENT,
1339 .ops = &clk_branch2_ops,
1340 },
1341 },
1342 };
1343
1344 static struct clk_branch disp_cc_mdss_dptx2_link_clk = {
1345 .halt_reg = 0x809c,
1346 .halt_check = BRANCH_HALT,
1347 .clkr = {
1348 .enable_reg = 0x809c,
1349 .enable_mask = BIT(0),
1350 .hw.init = &(const struct clk_init_data) {
1351 .name = "disp_cc_mdss_dptx2_link_clk",
1352 .parent_hws = (const struct clk_hw*[]) {
1353 &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
1354 },
1355 .num_parents = 1,
1356 .flags = CLK_SET_RATE_PARENT,
1357 .ops = &clk_branch2_ops,
1358 },
1359 },
1360 };
1361
1362 static struct clk_branch disp_cc_mdss_dptx2_link_intf_clk = {
1363 .halt_reg = 0x80a0,
1364 .halt_check = BRANCH_HALT,
1365 .clkr = {
1366 .enable_reg = 0x80a0,
1367 .enable_mask = BIT(0),
1368 .hw.init = &(const struct clk_init_data) {
1369 .name = "disp_cc_mdss_dptx2_link_intf_clk",
1370 .parent_hws = (const struct clk_hw*[]) {
1371 &disp_cc_mdss_dptx2_link_div_clk_src.clkr.hw,
1372 },
1373 .num_parents = 1,
1374 .flags = CLK_SET_RATE_PARENT,
1375 .ops = &clk_branch2_ops,
1376 },
1377 },
1378 };
1379
1380 static struct clk_branch disp_cc_mdss_dptx2_pixel0_clk = {
1381 .halt_reg = 0x8094,
1382 .halt_check = BRANCH_HALT,
1383 .clkr = {
1384 .enable_reg = 0x8094,
1385 .enable_mask = BIT(0),
1386 .hw.init = &(const struct clk_init_data) {
1387 .name = "disp_cc_mdss_dptx2_pixel0_clk",
1388 .parent_hws = (const struct clk_hw*[]) {
1389 &disp_cc_mdss_dptx2_pixel0_clk_src.clkr.hw,
1390 },
1391 .num_parents = 1,
1392 .flags = CLK_SET_RATE_PARENT,
1393 .ops = &clk_branch2_ops,
1394 },
1395 },
1396 };
1397
1398 static struct clk_branch disp_cc_mdss_dptx2_pixel1_clk = {
1399 .halt_reg = 0x8098,
1400 .halt_check = BRANCH_HALT,
1401 .clkr = {
1402 .enable_reg = 0x8098,
1403 .enable_mask = BIT(0),
1404 .hw.init = &(const struct clk_init_data) {
1405 .name = "disp_cc_mdss_dptx2_pixel1_clk",
1406 .parent_hws = (const struct clk_hw*[]) {
1407 &disp_cc_mdss_dptx2_pixel1_clk_src.clkr.hw,
1408 },
1409 .num_parents = 1,
1410 .flags = CLK_SET_RATE_PARENT,
1411 .ops = &clk_branch2_ops,
1412 },
1413 },
1414 };
1415
1416 static struct clk_branch disp_cc_mdss_dptx3_aux_clk = {
1417 .halt_reg = 0x80b8,
1418 .halt_check = BRANCH_HALT,
1419 .clkr = {
1420 .enable_reg = 0x80b8,
1421 .enable_mask = BIT(0),
1422 .hw.init = &(const struct clk_init_data) {
1423 .name = "disp_cc_mdss_dptx3_aux_clk",
1424 .parent_hws = (const struct clk_hw*[]) {
1425 &disp_cc_mdss_dptx3_aux_clk_src.clkr.hw,
1426 },
1427 .num_parents = 1,
1428 .flags = CLK_SET_RATE_PARENT,
1429 .ops = &clk_branch2_ops,
1430 },
1431 },
1432 };
1433
1434 static struct clk_branch disp_cc_mdss_dptx3_crypto_clk = {
1435 .halt_reg = 0x80bc,
1436 .halt_check = BRANCH_HALT_VOTED,
1437 .clkr = {
1438 .enable_reg = 0x80bc,
1439 .enable_mask = BIT(0),
1440 .hw.init = &(const struct clk_init_data) {
1441 .name = "disp_cc_mdss_dptx3_crypto_clk",
1442 .parent_hws = (const struct clk_hw*[]) {
1443 &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
1444 },
1445 .num_parents = 1,
1446 .flags = CLK_SET_RATE_PARENT,
1447 .ops = &clk_branch2_ops,
1448 },
1449 },
1450 };
1451
1452 static struct clk_branch disp_cc_mdss_dptx3_link_clk = {
1453 .halt_reg = 0x80b0,
1454 .halt_check = BRANCH_HALT,
1455 .clkr = {
1456 .enable_reg = 0x80b0,
1457 .enable_mask = BIT(0),
1458 .hw.init = &(const struct clk_init_data) {
1459 .name = "disp_cc_mdss_dptx3_link_clk",
1460 .parent_hws = (const struct clk_hw*[]) {
1461 &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
1462 },
1463 .num_parents = 1,
1464 .flags = CLK_SET_RATE_PARENT,
1465 .ops = &clk_branch2_ops,
1466 },
1467 },
1468 };
1469
1470 static struct clk_branch disp_cc_mdss_dptx3_link_intf_clk = {
1471 .halt_reg = 0x80b4,
1472 .halt_check = BRANCH_HALT,
1473 .clkr = {
1474 .enable_reg = 0x80b4,
1475 .enable_mask = BIT(0),
1476 .hw.init = &(const struct clk_init_data) {
1477 .name = "disp_cc_mdss_dptx3_link_intf_clk",
1478 .parent_hws = (const struct clk_hw*[]) {
1479 &disp_cc_mdss_dptx3_link_div_clk_src.clkr.hw,
1480 },
1481 .num_parents = 1,
1482 .flags = CLK_SET_RATE_PARENT,
1483 .ops = &clk_branch2_ops,
1484 },
1485 },
1486 };
1487
1488 static struct clk_branch disp_cc_mdss_dptx3_pixel0_clk = {
1489 .halt_reg = 0x80ac,
1490 .halt_check = BRANCH_HALT,
1491 .clkr = {
1492 .enable_reg = 0x80ac,
1493 .enable_mask = BIT(0),
1494 .hw.init = &(const struct clk_init_data) {
1495 .name = "disp_cc_mdss_dptx3_pixel0_clk",
1496 .parent_hws = (const struct clk_hw*[]) {
1497 &disp_cc_mdss_dptx3_pixel0_clk_src.clkr.hw,
1498 },
1499 .num_parents = 1,
1500 .flags = CLK_SET_RATE_PARENT,
1501 .ops = &clk_branch2_ops,
1502 },
1503 },
1504 };
1505
1506 static struct clk_branch disp_cc_mdss_esc0_clk = {
1507 .halt_reg = 0x8054,
1508 .halt_check = BRANCH_HALT,
1509 .clkr = {
1510 .enable_reg = 0x8054,
1511 .enable_mask = BIT(0),
1512 .hw.init = &(const struct clk_init_data) {
1513 .name = "disp_cc_mdss_esc0_clk",
1514 .parent_hws = (const struct clk_hw*[]) {
1515 &disp_cc_mdss_esc0_clk_src.clkr.hw,
1516 },
1517 .num_parents = 1,
1518 .flags = CLK_SET_RATE_PARENT,
1519 .ops = &clk_branch2_ops,
1520 },
1521 },
1522 };
1523
1524 static struct clk_branch disp_cc_mdss_esc1_clk = {
1525 .halt_reg = 0x8058,
1526 .halt_check = BRANCH_HALT,
1527 .clkr = {
1528 .enable_reg = 0x8058,
1529 .enable_mask = BIT(0),
1530 .hw.init = &(const struct clk_init_data) {
1531 .name = "disp_cc_mdss_esc1_clk",
1532 .parent_hws = (const struct clk_hw*[]) {
1533 &disp_cc_mdss_esc1_clk_src.clkr.hw,
1534 },
1535 .num_parents = 1,
1536 .flags = CLK_SET_RATE_PARENT,
1537 .ops = &clk_branch2_ops,
1538 },
1539 },
1540 };
1541
1542 static struct clk_branch disp_cc_mdss_mdp1_clk = {
1543 .halt_reg = 0xa004,
1544 .halt_check = BRANCH_HALT,
1545 .clkr = {
1546 .enable_reg = 0xa004,
1547 .enable_mask = BIT(0),
1548 .hw.init = &(const struct clk_init_data) {
1549 .name = "disp_cc_mdss_mdp1_clk",
1550 .parent_hws = (const struct clk_hw*[]) {
1551 &disp_cc_mdss_mdp_clk_src.clkr.hw,
1552 },
1553 .num_parents = 1,
1554 .flags = CLK_SET_RATE_PARENT,
1555 .ops = &clk_branch2_ops,
1556 },
1557 },
1558 };
1559
1560 static struct clk_branch disp_cc_mdss_mdp_clk = {
1561 .halt_reg = 0x8010,
1562 .halt_check = BRANCH_HALT_VOTED,
1563 .clkr = {
1564 .enable_reg = 0x8010,
1565 .enable_mask = BIT(0),
1566 .hw.init = &(const struct clk_init_data) {
1567 .name = "disp_cc_mdss_mdp_clk",
1568 .parent_hws = (const struct clk_hw*[]) {
1569 &disp_cc_mdss_mdp_clk_src.clkr.hw,
1570 },
1571 .num_parents = 1,
1572 .flags = CLK_SET_RATE_PARENT,
1573 .ops = &clk_branch2_aon_ops,
1574 },
1575 },
1576 };
1577
1578 static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
1579 .halt_reg = 0xa014,
1580 .halt_check = BRANCH_HALT_VOTED,
1581 .clkr = {
1582 .enable_reg = 0xa014,
1583 .enable_mask = BIT(0),
1584 .hw.init = &(const struct clk_init_data) {
1585 .name = "disp_cc_mdss_mdp_lut1_clk",
1586 .parent_hws = (const struct clk_hw*[]) {
1587 &disp_cc_mdss_mdp_clk_src.clkr.hw,
1588 },
1589 .num_parents = 1,
1590 .flags = CLK_SET_RATE_PARENT,
1591 .ops = &clk_branch2_ops,
1592 },
1593 },
1594 };
1595
1596 static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
1597 .halt_reg = 0x8020,
1598 .halt_check = BRANCH_HALT_VOTED,
1599 .clkr = {
1600 .enable_reg = 0x8020,
1601 .enable_mask = BIT(0),
1602 .hw.init = &(const struct clk_init_data) {
1603 .name = "disp_cc_mdss_mdp_lut_clk",
1604 .parent_hws = (const struct clk_hw*[]) {
1605 &disp_cc_mdss_mdp_clk_src.clkr.hw,
1606 },
1607 .num_parents = 1,
1608 .flags = CLK_SET_RATE_PARENT,
1609 .ops = &clk_branch2_ops,
1610 },
1611 },
1612 };
1613
1614 static struct clk_branch disp_cc_mdss_mdp_ss_ip_clk = {
1615 .halt_reg = 0x8030,
1616 .halt_check = BRANCH_HALT_VOTED,
1617 .clkr = {
1618 .enable_reg = 0x8030,
1619 .enable_mask = BIT(0),
1620 .hw.init = &(const struct clk_init_data) {
1621 .name = "disp_cc_mdss_mdp_ss_ip_clk",
1622 .parent_hws = (const struct clk_hw*[]) {
1623 &disp_cc_mdss_mdp_clk_src.clkr.hw,
1624 },
1625 .num_parents = 1,
1626 .flags = CLK_SET_RATE_PARENT,
1627 .ops = &clk_branch2_ops,
1628 },
1629 },
1630 };
1631
1632 static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
1633 .halt_reg = 0xc004,
1634 .halt_check = BRANCH_HALT_VOTED,
1635 .clkr = {
1636 .enable_reg = 0xc004,
1637 .enable_mask = BIT(0),
1638 .hw.init = &(const struct clk_init_data) {
1639 .name = "disp_cc_mdss_non_gdsc_ahb_clk",
1640 .parent_hws = (const struct clk_hw*[]) {
1641 &disp_cc_mdss_ahb_clk_src.clkr.hw,
1642 },
1643 .num_parents = 1,
1644 .flags = CLK_SET_RATE_PARENT,
1645 .ops = &clk_branch2_ops,
1646 },
1647 },
1648 };
1649
1650 static struct clk_branch disp_cc_mdss_pclk0_clk = {
1651 .halt_reg = 0x8004,
1652 .halt_check = BRANCH_HALT,
1653 .clkr = {
1654 .enable_reg = 0x8004,
1655 .enable_mask = BIT(0),
1656 .hw.init = &(const struct clk_init_data) {
1657 .name = "disp_cc_mdss_pclk0_clk",
1658 .parent_hws = (const struct clk_hw*[]) {
1659 &disp_cc_mdss_pclk0_clk_src.clkr.hw,
1660 },
1661 .num_parents = 1,
1662 .flags = CLK_SET_RATE_PARENT,
1663 .ops = &clk_branch2_ops,
1664 },
1665 },
1666 };
1667
1668 static struct clk_branch disp_cc_mdss_pclk1_clk = {
1669 .halt_reg = 0x8008,
1670 .halt_check = BRANCH_HALT,
1671 .clkr = {
1672 .enable_reg = 0x8008,
1673 .enable_mask = BIT(0),
1674 .hw.init = &(const struct clk_init_data) {
1675 .name = "disp_cc_mdss_pclk1_clk",
1676 .parent_hws = (const struct clk_hw*[]) {
1677 &disp_cc_mdss_pclk1_clk_src.clkr.hw,
1678 },
1679 .num_parents = 1,
1680 .flags = CLK_SET_RATE_PARENT,
1681 .ops = &clk_branch2_ops,
1682 },
1683 },
1684 };
1685
1686 static struct clk_branch disp_cc_mdss_pclk2_clk = {
1687 .halt_reg = 0x800c,
1688 .halt_check = BRANCH_HALT,
1689 .clkr = {
1690 .enable_reg = 0x800c,
1691 .enable_mask = BIT(0),
1692 .hw.init = &(const struct clk_init_data) {
1693 .name = "disp_cc_mdss_pclk2_clk",
1694 .parent_hws = (const struct clk_hw*[]) {
1695 &disp_cc_mdss_pclk2_clk_src.clkr.hw,
1696 },
1697 .num_parents = 1,
1698 .flags = CLK_SET_RATE_PARENT,
1699 .ops = &clk_branch2_ops,
1700 },
1701 },
1702 };
1703
1704 static struct clk_branch disp_cc_mdss_vsync1_clk = {
1705 .halt_reg = 0xa024,
1706 .halt_check = BRANCH_HALT,
1707 .clkr = {
1708 .enable_reg = 0xa024,
1709 .enable_mask = BIT(0),
1710 .hw.init = &(const struct clk_init_data) {
1711 .name = "disp_cc_mdss_vsync1_clk",
1712 .parent_hws = (const struct clk_hw*[]) {
1713 &disp_cc_mdss_vsync_clk_src.clkr.hw,
1714 },
1715 .num_parents = 1,
1716 .flags = CLK_SET_RATE_PARENT,
1717 .ops = &clk_branch2_ops,
1718 },
1719 },
1720 };
1721
1722 static struct clk_branch disp_cc_mdss_vsync_clk = {
1723 .halt_reg = 0x8040,
1724 .halt_check = BRANCH_HALT,
1725 .clkr = {
1726 .enable_reg = 0x8040,
1727 .enable_mask = BIT(0),
1728 .hw.init = &(const struct clk_init_data) {
1729 .name = "disp_cc_mdss_vsync_clk",
1730 .parent_hws = (const struct clk_hw*[]) {
1731 &disp_cc_mdss_vsync_clk_src.clkr.hw,
1732 },
1733 .num_parents = 1,
1734 .flags = CLK_SET_RATE_PARENT,
1735 .ops = &clk_branch2_ops,
1736 },
1737 },
1738 };
1739
1740 static struct clk_branch disp_cc_osc_clk = {
1741 .halt_reg = 0x80c8,
1742 .halt_check = BRANCH_HALT,
1743 .clkr = {
1744 .enable_reg = 0x80c8,
1745 .enable_mask = BIT(0),
1746 .hw.init = &(const struct clk_init_data) {
1747 .name = "disp_cc_osc_clk",
1748 .parent_hws = (const struct clk_hw*[]) {
1749 &disp_cc_osc_clk_src.clkr.hw,
1750 },
1751 .num_parents = 1,
1752 .flags = CLK_SET_RATE_PARENT,
1753 .ops = &clk_branch2_ops,
1754 },
1755 },
1756 };
1757
1758 static struct gdsc disp_cc_mdss_core_gdsc = {
1759 .gdscr = 0x9000,
1760 .en_rest_wait_val = 0x2,
1761 .en_few_wait_val = 0x2,
1762 .clk_dis_wait_val = 0xf,
1763 .pd = {
1764 .name = "disp_cc_mdss_core_gdsc",
1765 },
1766 .pwrsts = PWRSTS_OFF_ON,
1767 .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | HW_CTRL_TRIGGER,
1768 };
1769
1770 static struct gdsc disp_cc_mdss_core_int2_gdsc = {
1771 .gdscr = 0xb000,
1772 .en_rest_wait_val = 0x2,
1773 .en_few_wait_val = 0x2,
1774 .clk_dis_wait_val = 0xf,
1775 .pd = {
1776 .name = "disp_cc_mdss_core_int2_gdsc",
1777 },
1778 .pwrsts = PWRSTS_OFF_ON,
1779 .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | HW_CTRL_TRIGGER,
1780 };
1781
1782 static struct clk_regmap *disp_cc_kaanapali_clocks[] = {
1783 [DISP_CC_ESYNC0_CLK] = &disp_cc_esync0_clk.clkr,
1784 [DISP_CC_ESYNC0_CLK_SRC] = &disp_cc_esync0_clk_src.clkr,
1785 [DISP_CC_ESYNC1_CLK] = &disp_cc_esync1_clk.clkr,
1786 [DISP_CC_ESYNC1_CLK_SRC] = &disp_cc_esync1_clk_src.clkr,
1787 [DISP_CC_MDSS_ACCU_SHIFT_CLK] = &disp_cc_mdss_accu_shift_clk.clkr,
1788 [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
1789 [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
1790 [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
1791 [DISP_CC_MDSS_AHB_SWI_CLK] = &disp_cc_mdss_ahb_swi_clk.clkr,
1792 [DISP_CC_MDSS_AHB_SWI_DIV_CLK_SRC] = &disp_cc_mdss_ahb_swi_div_clk_src.clkr,
1793 [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
1794 [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
1795 [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
1796 [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
1797 [DISP_CC_MDSS_BYTE1_CLK] = &disp_cc_mdss_byte1_clk.clkr,
1798 [DISP_CC_MDSS_BYTE1_CLK_SRC] = &disp_cc_mdss_byte1_clk_src.clkr,
1799 [DISP_CC_MDSS_BYTE1_DIV_CLK_SRC] = &disp_cc_mdss_byte1_div_clk_src.clkr,
1800 [DISP_CC_MDSS_BYTE1_INTF_CLK] = &disp_cc_mdss_byte1_intf_clk.clkr,
1801 [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
1802 [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
1803 [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr,
1804 [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
1805 [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
1806 [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
1807 [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
1808 [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
1809 [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
1810 [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
1811 [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
1812 [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
1813 &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
1814 [DISP_CC_MDSS_DPTX1_AUX_CLK] = &disp_cc_mdss_dptx1_aux_clk.clkr,
1815 [DISP_CC_MDSS_DPTX1_AUX_CLK_SRC] = &disp_cc_mdss_dptx1_aux_clk_src.clkr,
1816 [DISP_CC_MDSS_DPTX1_CRYPTO_CLK] = &disp_cc_mdss_dptx1_crypto_clk.clkr,
1817 [DISP_CC_MDSS_DPTX1_LINK_CLK] = &disp_cc_mdss_dptx1_link_clk.clkr,
1818 [DISP_CC_MDSS_DPTX1_LINK_CLK_SRC] = &disp_cc_mdss_dptx1_link_clk_src.clkr,
1819 [DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx1_link_div_clk_src.clkr,
1820 [DISP_CC_MDSS_DPTX1_LINK_INTF_CLK] = &disp_cc_mdss_dptx1_link_intf_clk.clkr,
1821 [DISP_CC_MDSS_DPTX1_PIXEL0_CLK] = &disp_cc_mdss_dptx1_pixel0_clk.clkr,
1822 [DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx1_pixel0_clk_src.clkr,
1823 [DISP_CC_MDSS_DPTX1_PIXEL1_CLK] = &disp_cc_mdss_dptx1_pixel1_clk.clkr,
1824 [DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx1_pixel1_clk_src.clkr,
1825 [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK] =
1826 &disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr,
1827 [DISP_CC_MDSS_DPTX2_AUX_CLK] = &disp_cc_mdss_dptx2_aux_clk.clkr,
1828 [DISP_CC_MDSS_DPTX2_AUX_CLK_SRC] = &disp_cc_mdss_dptx2_aux_clk_src.clkr,
1829 [DISP_CC_MDSS_DPTX2_CRYPTO_CLK] = &disp_cc_mdss_dptx2_crypto_clk.clkr,
1830 [DISP_CC_MDSS_DPTX2_LINK_CLK] = &disp_cc_mdss_dptx2_link_clk.clkr,
1831 [DISP_CC_MDSS_DPTX2_LINK_CLK_SRC] = &disp_cc_mdss_dptx2_link_clk_src.clkr,
1832 [DISP_CC_MDSS_DPTX2_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx2_link_div_clk_src.clkr,
1833 [DISP_CC_MDSS_DPTX2_LINK_INTF_CLK] = &disp_cc_mdss_dptx2_link_intf_clk.clkr,
1834 [DISP_CC_MDSS_DPTX2_PIXEL0_CLK] = &disp_cc_mdss_dptx2_pixel0_clk.clkr,
1835 [DISP_CC_MDSS_DPTX2_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx2_pixel0_clk_src.clkr,
1836 [DISP_CC_MDSS_DPTX2_PIXEL1_CLK] = &disp_cc_mdss_dptx2_pixel1_clk.clkr,
1837 [DISP_CC_MDSS_DPTX2_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx2_pixel1_clk_src.clkr,
1838 [DISP_CC_MDSS_DPTX3_AUX_CLK] = &disp_cc_mdss_dptx3_aux_clk.clkr,
1839 [DISP_CC_MDSS_DPTX3_AUX_CLK_SRC] = &disp_cc_mdss_dptx3_aux_clk_src.clkr,
1840 [DISP_CC_MDSS_DPTX3_CRYPTO_CLK] = &disp_cc_mdss_dptx3_crypto_clk.clkr,
1841 [DISP_CC_MDSS_DPTX3_LINK_CLK] = &disp_cc_mdss_dptx3_link_clk.clkr,
1842 [DISP_CC_MDSS_DPTX3_LINK_CLK_SRC] = &disp_cc_mdss_dptx3_link_clk_src.clkr,
1843 [DISP_CC_MDSS_DPTX3_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx3_link_div_clk_src.clkr,
1844 [DISP_CC_MDSS_DPTX3_LINK_INTF_CLK] = &disp_cc_mdss_dptx3_link_intf_clk.clkr,
1845 [DISP_CC_MDSS_DPTX3_PIXEL0_CLK] = &disp_cc_mdss_dptx3_pixel0_clk.clkr,
1846 [DISP_CC_MDSS_DPTX3_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx3_pixel0_clk_src.clkr,
1847 [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
1848 [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
1849 [DISP_CC_MDSS_ESC1_CLK] = &disp_cc_mdss_esc1_clk.clkr,
1850 [DISP_CC_MDSS_ESC1_CLK_SRC] = &disp_cc_mdss_esc1_clk_src.clkr,
1851 [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
1852 [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
1853 [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
1854 [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
1855 [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
1856 [DISP_CC_MDSS_MDP_SS_IP_CLK] = &disp_cc_mdss_mdp_ss_ip_clk.clkr,
1857 [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
1858 [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
1859 [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
1860 [DISP_CC_MDSS_PCLK1_CLK] = &disp_cc_mdss_pclk1_clk.clkr,
1861 [DISP_CC_MDSS_PCLK1_CLK_SRC] = &disp_cc_mdss_pclk1_clk_src.clkr,
1862 [DISP_CC_MDSS_PCLK2_CLK] = &disp_cc_mdss_pclk2_clk.clkr,
1863 [DISP_CC_MDSS_PCLK2_CLK_SRC] = &disp_cc_mdss_pclk2_clk_src.clkr,
1864 [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
1865 [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
1866 [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
1867 [DISP_CC_OSC_CLK] = &disp_cc_osc_clk.clkr,
1868 [DISP_CC_OSC_CLK_SRC] = &disp_cc_osc_clk_src.clkr,
1869 [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
1870 [DISP_CC_PLL1] = &disp_cc_pll1.clkr,
1871 [DISP_CC_PLL2] = &disp_cc_pll2.clkr,
1872 };
1873
1874 static struct gdsc *disp_cc_kaanapali_gdscs[] = {
1875 [DISP_CC_MDSS_CORE_GDSC] = &disp_cc_mdss_core_gdsc,
1876 [DISP_CC_MDSS_CORE_INT2_GDSC] = &disp_cc_mdss_core_int2_gdsc,
1877 };
1878
1879 static const struct qcom_reset_map disp_cc_kaanapali_resets[] = {
1880 [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
1881 [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
1882 [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
1883 };
1884
1885 static struct clk_alpha_pll *disp_cc_kaanapali_plls[] = {
1886 &disp_cc_pll0,
1887 &disp_cc_pll1,
1888 &disp_cc_pll2,
1889 };
1890
1891 static u32 disp_cc_kaanapali_critical_cbcrs[] = {
1892 0xe064, /* DISP_CC_SLEEP_CLK */
1893 0xe05c, /* DISP_CC_XO_CLK */
1894 0xc00c, /* DISP_CC_MDSS_RSCC_AHB_CLK */
1895 0xc008, /* DISP_CC_MDSS_RSCC_VSYNC_CLK */
1896 };
1897
1898 static const struct regmap_config disp_cc_kaanapali_regmap_config = {
1899 .reg_bits = 32,
1900 .reg_stride = 4,
1901 .val_bits = 32,
1902 .max_register = 0x12094,
1903 .fast_io = true,
1904 };
1905
1906 static void clk_kaanapali_regs_configure(struct device *dev, struct regmap *regmap)
1907 {
1908 /* Enable clock gating for MDP clocks */
1909 regmap_update_bits(regmap, DISP_CC_MISC_CMD, BIT(4), BIT(4));
1910 }
1911
1912 static struct qcom_cc_driver_data disp_cc_kaanapali_driver_data = {
1913 .alpha_plls = disp_cc_kaanapali_plls,
1914 .num_alpha_plls = ARRAY_SIZE(disp_cc_kaanapali_plls),
1915 .clk_cbcrs = disp_cc_kaanapali_critical_cbcrs,
1916 .num_clk_cbcrs = ARRAY_SIZE(disp_cc_kaanapali_critical_cbcrs),
1917 .clk_regs_configure = clk_kaanapali_regs_configure,
1918 };
1919
1920 static const struct qcom_cc_desc disp_cc_kaanapali_desc = {
1921 .config = &disp_cc_kaanapali_regmap_config,
1922 .clks = disp_cc_kaanapali_clocks,
1923 .num_clks = ARRAY_SIZE(disp_cc_kaanapali_clocks),
1924 .resets = disp_cc_kaanapali_resets,
1925 .num_resets = ARRAY_SIZE(disp_cc_kaanapali_resets),
1926 .gdscs = disp_cc_kaanapali_gdscs,
1927 .num_gdscs = ARRAY_SIZE(disp_cc_kaanapali_gdscs),
1928 .use_rpm = true,
1929 .driver_data = &disp_cc_kaanapali_driver_data,
1930 };
1931
1932 static const struct of_device_id disp_cc_kaanapali_match_table[] = {
1933 { .compatible = "qcom,kaanapali-dispcc" },
1934 { }
1935 };
1936 MODULE_DEVICE_TABLE(of, disp_cc_kaanapali_match_table);
1937
1938 static int disp_cc_kaanapali_probe(struct platform_device *pdev)
1939 {
1940 return qcom_cc_probe(pdev, &disp_cc_kaanapali_desc);
1941 }
1942
1943 static struct platform_driver disp_cc_kaanapali_driver = {
1944 .probe = disp_cc_kaanapali_probe,
1945 .driver = {
1946 .name = "dispcc-kaanapali",
1947 .of_match_table = disp_cc_kaanapali_match_table,
1948 },
1949 };
1950
1951 module_platform_driver(disp_cc_kaanapali_driver);
1952
1953 MODULE_DESCRIPTION("QTI DISPCC Kaanapali Driver");
1954 MODULE_LICENSE("GPL");