1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
6 #include <linux/clk-provider.h>
7 #include <linux/module.h>
8 #include <linux/mod_devicetable.h>
10 #include <linux/platform_device.h>
11 #include <linux/regmap.h>
13 #include <dt-bindings/clock/qcom,sm4450-dispcc.h>
15 #include "clk-alpha-pll.h"
16 #include "clk-branch.h"
19 #include "clk-regmap.h"
20 #include "clk-regmap-divider.h"
31 DT_DSI0_PHY_PLL_OUT_BYTECLK
,
32 DT_DSI0_PHY_PLL_OUT_DSICLK
,
37 P_DISP_CC_PLL0_OUT_MAIN
,
38 P_DISP_CC_PLL1_OUT_EVEN
,
39 P_DISP_CC_PLL1_OUT_MAIN
,
40 P_DSI0_PHY_PLL_OUT_BYTECLK
,
41 P_DSI0_PHY_PLL_OUT_DSICLK
,
45 static const struct pll_vco lucid_evo_vco
[] = {
46 { 249600000, 2020000000, 0 },
49 /* 600.0 MHz Configuration */
50 static const struct alpha_pll_config disp_cc_pll0_config
= {
53 .config_ctl_val
= 0x20485699,
54 .config_ctl_hi_val
= 0x00182261,
55 .config_ctl_hi1_val
= 0x32aa299c,
56 .user_ctl_val
= 0x00000000,
57 .user_ctl_hi_val
= 0x00000805,
60 static struct clk_alpha_pll disp_cc_pll0
= {
62 .vco_table
= lucid_evo_vco
,
63 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
64 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
66 .hw
.init
= &(const struct clk_init_data
) {
67 .name
= "disp_cc_pll0",
68 .parent_data
= &(const struct clk_parent_data
) {
72 .ops
= &clk_alpha_pll_lucid_evo_ops
,
77 static struct clk_alpha_pll disp_cc_pll1
= {
79 .vco_table
= lucid_evo_vco
,
80 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
81 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
83 .hw
.init
= &(const struct clk_init_data
) {
84 .name
= "disp_cc_pll1",
85 .parent_data
= &(const struct clk_parent_data
) {
89 .ops
= &clk_alpha_pll_lucid_evo_ops
,
94 static const struct parent_map disp_cc_parent_map_0
[] = {
96 { P_DSI0_PHY_PLL_OUT_DSICLK
, 1 },
97 { P_DSI0_PHY_PLL_OUT_BYTECLK
, 2 },
100 static const struct clk_parent_data disp_cc_parent_data_0
[] = {
101 { .index
= DT_BI_TCXO
},
102 { .index
= DT_DSI0_PHY_PLL_OUT_DSICLK
},
103 { .index
= DT_DSI0_PHY_PLL_OUT_BYTECLK
},
106 static const struct parent_map disp_cc_parent_map_1
[] = {
108 { P_DISP_CC_PLL0_OUT_MAIN
, 1 },
109 { P_DISP_CC_PLL1_OUT_MAIN
, 4 },
110 { P_DISP_CC_PLL1_OUT_EVEN
, 6 },
113 static const struct clk_parent_data disp_cc_parent_data_1
[] = {
114 { .index
= DT_BI_TCXO
},
115 { .hw
= &disp_cc_pll0
.clkr
.hw
},
116 { .hw
= &disp_cc_pll1
.clkr
.hw
},
117 { .hw
= &disp_cc_pll1
.clkr
.hw
},
120 static const struct parent_map disp_cc_parent_map_2
[] = {
124 static const struct clk_parent_data disp_cc_parent_data_2
[] = {
125 { .index
= DT_BI_TCXO
},
128 static const struct clk_parent_data disp_cc_parent_data_2_ao
[] = {
129 { .index
= DT_BI_TCXO_AO
},
132 static const struct parent_map disp_cc_parent_map_3
[] = {
134 { P_DISP_CC_PLL1_OUT_MAIN
, 4 },
135 { P_DISP_CC_PLL1_OUT_EVEN
, 6 },
138 static const struct clk_parent_data disp_cc_parent_data_3
[] = {
139 { .index
= DT_BI_TCXO
},
140 { .hw
= &disp_cc_pll1
.clkr
.hw
},
141 { .hw
= &disp_cc_pll1
.clkr
.hw
},
144 static const struct parent_map disp_cc_parent_map_4
[] = {
146 { P_DSI0_PHY_PLL_OUT_BYTECLK
, 2 },
149 static const struct clk_parent_data disp_cc_parent_data_4
[] = {
150 { .index
= DT_BI_TCXO
},
151 { .index
= DT_DSI0_PHY_PLL_OUT_BYTECLK
},
154 static const struct parent_map disp_cc_parent_map_5
[] = {
158 static const struct clk_parent_data disp_cc_parent_data_5
[] = {
159 { .index
= DT_SLEEP_CLK
},
162 static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src
[] = {
163 F(19200000, P_BI_TCXO
, 1, 0, 0),
164 F(37500000, P_DISP_CC_PLL1_OUT_MAIN
, 16, 0, 0),
165 F(75000000, P_DISP_CC_PLL1_OUT_MAIN
, 8, 0, 0),
169 static struct clk_rcg2 disp_cc_mdss_ahb_clk_src
= {
173 .parent_map
= disp_cc_parent_map_3
,
174 .freq_tbl
= ftbl_disp_cc_mdss_ahb_clk_src
,
175 .clkr
.hw
.init
= &(const struct clk_init_data
) {
176 .name
= "disp_cc_mdss_ahb_clk_src",
177 .parent_data
= disp_cc_parent_data_3
,
178 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_3
),
179 .flags
= CLK_SET_RATE_PARENT
,
180 .ops
= &clk_rcg2_shared_ops
,
184 static const struct freq_tbl ftbl_disp_cc_mdss_byte0_clk_src
[] = {
185 F(19200000, P_BI_TCXO
, 1, 0, 0),
189 static struct clk_rcg2 disp_cc_mdss_byte0_clk_src
= {
193 .parent_map
= disp_cc_parent_map_0
,
194 .freq_tbl
= ftbl_disp_cc_mdss_byte0_clk_src
,
195 .clkr
.hw
.init
= &(const struct clk_init_data
) {
196 .name
= "disp_cc_mdss_byte0_clk_src",
197 .parent_data
= disp_cc_parent_data_0
,
198 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
199 .flags
= CLK_SET_RATE_PARENT
,
200 .ops
= &clk_byte2_ops
,
204 static struct clk_rcg2 disp_cc_mdss_esc0_clk_src
= {
208 .parent_map
= disp_cc_parent_map_4
,
209 .freq_tbl
= ftbl_disp_cc_mdss_byte0_clk_src
,
210 .clkr
.hw
.init
= &(const struct clk_init_data
) {
211 .name
= "disp_cc_mdss_esc0_clk_src",
212 .parent_data
= disp_cc_parent_data_4
,
213 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_4
),
214 .flags
= CLK_SET_RATE_PARENT
,
215 .ops
= &clk_rcg2_shared_ops
,
219 static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src
[] = {
220 F(200000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
221 F(325000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
222 F(380000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
223 F(506000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
224 F(608000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
228 static struct clk_rcg2 disp_cc_mdss_mdp_clk_src
= {
232 .parent_map
= disp_cc_parent_map_1
,
233 .freq_tbl
= ftbl_disp_cc_mdss_mdp_clk_src
,
234 .clkr
.hw
.init
= &(const struct clk_init_data
) {
235 .name
= "disp_cc_mdss_mdp_clk_src",
236 .parent_data
= disp_cc_parent_data_1
,
237 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
238 .flags
= CLK_SET_RATE_PARENT
,
239 .ops
= &clk_rcg2_shared_ops
,
243 static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src
= {
247 .parent_map
= disp_cc_parent_map_0
,
248 .freq_tbl
= ftbl_disp_cc_mdss_byte0_clk_src
,
249 .clkr
.hw
.init
= &(const struct clk_init_data
) {
250 .name
= "disp_cc_mdss_pclk0_clk_src",
251 .parent_data
= disp_cc_parent_data_0
,
252 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
253 .flags
= CLK_SET_RATE_PARENT
,
254 .ops
= &clk_pixel_ops
,
258 static const struct freq_tbl ftbl_disp_cc_mdss_rot_clk_src
[] = {
259 F(200000000, P_DISP_CC_PLL1_OUT_MAIN
, 3, 0, 0),
260 F(300000000, P_DISP_CC_PLL1_OUT_MAIN
, 2, 0, 0),
264 static struct clk_rcg2 disp_cc_mdss_rot_clk_src
= {
268 .parent_map
= disp_cc_parent_map_1
,
269 .freq_tbl
= ftbl_disp_cc_mdss_rot_clk_src
,
270 .clkr
.hw
.init
= &(const struct clk_init_data
) {
271 .name
= "disp_cc_mdss_rot_clk_src",
272 .parent_data
= disp_cc_parent_data_1
,
273 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
274 .flags
= CLK_SET_RATE_PARENT
,
275 .ops
= &clk_rcg2_shared_ops
,
279 static struct clk_rcg2 disp_cc_mdss_vsync_clk_src
= {
283 .parent_map
= disp_cc_parent_map_2
,
284 .freq_tbl
= ftbl_disp_cc_mdss_byte0_clk_src
,
285 .clkr
.hw
.init
= &(const struct clk_init_data
) {
286 .name
= "disp_cc_mdss_vsync_clk_src",
287 .parent_data
= disp_cc_parent_data_2
,
288 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_2
),
289 .flags
= CLK_SET_RATE_PARENT
,
290 .ops
= &clk_rcg2_shared_ops
,
294 static const struct freq_tbl ftbl_disp_cc_sleep_clk_src
[] = {
295 F(32000, P_SLEEP_CLK
, 1, 0, 0),
299 static struct clk_rcg2 disp_cc_sleep_clk_src
= {
303 .parent_map
= disp_cc_parent_map_5
,
304 .freq_tbl
= ftbl_disp_cc_sleep_clk_src
,
305 .clkr
.hw
.init
= &(const struct clk_init_data
) {
306 .name
= "disp_cc_sleep_clk_src",
307 .parent_data
= disp_cc_parent_data_5
,
308 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_5
),
309 .flags
= CLK_SET_RATE_PARENT
,
310 .ops
= &clk_rcg2_shared_ops
,
314 static struct clk_rcg2 disp_cc_xo_clk_src
= {
318 .parent_map
= disp_cc_parent_map_2
,
319 .freq_tbl
= ftbl_disp_cc_mdss_byte0_clk_src
,
320 .clkr
.hw
.init
= &(const struct clk_init_data
) {
321 .name
= "disp_cc_xo_clk_src",
322 .parent_data
= disp_cc_parent_data_2_ao
,
323 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_2_ao
),
324 .flags
= CLK_SET_RATE_PARENT
,
325 .ops
= &clk_rcg2_shared_ops
,
329 static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src
= {
333 .clkr
.hw
.init
= &(const struct clk_init_data
) {
334 .name
= "disp_cc_mdss_byte0_div_clk_src",
335 .parent_hws
= (const struct clk_hw
*[]) {
336 &disp_cc_mdss_byte0_clk_src
.clkr
.hw
,
339 .flags
= CLK_SET_RATE_PARENT
,
340 .ops
= &clk_regmap_div_ops
,
344 static struct clk_branch disp_cc_mdss_ahb1_clk
= {
346 .halt_check
= BRANCH_HALT
,
348 .enable_reg
= 0xa020,
349 .enable_mask
= BIT(0),
350 .hw
.init
= &(const struct clk_init_data
) {
351 .name
= "disp_cc_mdss_ahb1_clk",
352 .parent_hws
= (const struct clk_hw
*[]) {
353 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
356 .flags
= CLK_SET_RATE_PARENT
,
357 .ops
= &clk_branch2_ops
,
362 static struct clk_branch disp_cc_mdss_ahb_clk
= {
364 .halt_check
= BRANCH_HALT
,
366 .enable_reg
= 0x8094,
367 .enable_mask
= BIT(0),
368 .hw
.init
= &(const struct clk_init_data
) {
369 .name
= "disp_cc_mdss_ahb_clk",
370 .parent_hws
= (const struct clk_hw
*[]) {
371 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
374 .flags
= CLK_SET_RATE_PARENT
,
375 .ops
= &clk_branch2_ops
,
380 static struct clk_branch disp_cc_mdss_byte0_clk
= {
382 .halt_check
= BRANCH_HALT
,
384 .enable_reg
= 0x8024,
385 .enable_mask
= BIT(0),
386 .hw
.init
= &(const struct clk_init_data
) {
387 .name
= "disp_cc_mdss_byte0_clk",
388 .parent_hws
= (const struct clk_hw
*[]) {
389 &disp_cc_mdss_byte0_clk_src
.clkr
.hw
,
392 .flags
= CLK_SET_RATE_PARENT
,
393 .ops
= &clk_branch2_ops
,
398 static struct clk_branch disp_cc_mdss_byte0_intf_clk
= {
400 .halt_check
= BRANCH_HALT
,
402 .enable_reg
= 0x8028,
403 .enable_mask
= BIT(0),
404 .hw
.init
= &(const struct clk_init_data
) {
405 .name
= "disp_cc_mdss_byte0_intf_clk",
406 .parent_hws
= (const struct clk_hw
*[]) {
407 &disp_cc_mdss_byte0_div_clk_src
.clkr
.hw
,
410 .flags
= CLK_SET_RATE_PARENT
,
411 .ops
= &clk_branch2_ops
,
416 static struct clk_branch disp_cc_mdss_esc0_clk
= {
418 .halt_check
= BRANCH_HALT
,
420 .enable_reg
= 0x802c,
421 .enable_mask
= BIT(0),
422 .hw
.init
= &(const struct clk_init_data
) {
423 .name
= "disp_cc_mdss_esc0_clk",
424 .parent_hws
= (const struct clk_hw
*[]) {
425 &disp_cc_mdss_esc0_clk_src
.clkr
.hw
,
428 .flags
= CLK_SET_RATE_PARENT
,
429 .ops
= &clk_branch2_ops
,
434 static struct clk_branch disp_cc_mdss_mdp1_clk
= {
436 .halt_check
= BRANCH_HALT
,
438 .enable_reg
= 0xa004,
439 .enable_mask
= BIT(0),
440 .hw
.init
= &(const struct clk_init_data
) {
441 .name
= "disp_cc_mdss_mdp1_clk",
442 .parent_hws
= (const struct clk_hw
*[]) {
443 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
446 .flags
= CLK_SET_RATE_PARENT
,
447 .ops
= &clk_branch2_ops
,
452 static struct clk_branch disp_cc_mdss_mdp_clk
= {
454 .halt_check
= BRANCH_HALT
,
456 .enable_reg
= 0x8008,
457 .enable_mask
= BIT(0),
458 .hw
.init
= &(const struct clk_init_data
) {
459 .name
= "disp_cc_mdss_mdp_clk",
460 .parent_hws
= (const struct clk_hw
*[]) {
461 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
464 .flags
= CLK_SET_RATE_PARENT
,
465 .ops
= &clk_branch2_ops
,
470 static struct clk_branch disp_cc_mdss_mdp_lut1_clk
= {
472 .halt_check
= BRANCH_HALT
,
474 .enable_reg
= 0xa014,
475 .enable_mask
= BIT(0),
476 .hw
.init
= &(const struct clk_init_data
) {
477 .name
= "disp_cc_mdss_mdp_lut1_clk",
478 .parent_hws
= (const struct clk_hw
*[]) {
479 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
482 .flags
= CLK_SET_RATE_PARENT
,
483 .ops
= &clk_branch2_ops
,
488 static struct clk_branch disp_cc_mdss_mdp_lut_clk
= {
490 .halt_check
= BRANCH_HALT_VOTED
,
492 .enable_reg
= 0x8018,
493 .enable_mask
= BIT(0),
494 .hw
.init
= &(const struct clk_init_data
) {
495 .name
= "disp_cc_mdss_mdp_lut_clk",
496 .parent_hws
= (const struct clk_hw
*[]) {
497 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
500 .flags
= CLK_SET_RATE_PARENT
,
501 .ops
= &clk_branch2_ops
,
506 static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk
= {
508 .halt_check
= BRANCH_HALT_VOTED
,
510 .enable_reg
= 0xc004,
511 .enable_mask
= BIT(0),
512 .hw
.init
= &(const struct clk_init_data
) {
513 .name
= "disp_cc_mdss_non_gdsc_ahb_clk",
514 .parent_hws
= (const struct clk_hw
*[]) {
515 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
518 .flags
= CLK_SET_RATE_PARENT
,
519 .ops
= &clk_branch2_ops
,
524 static struct clk_branch disp_cc_mdss_pclk0_clk
= {
526 .halt_check
= BRANCH_HALT
,
528 .enable_reg
= 0x8004,
529 .enable_mask
= BIT(0),
530 .hw
.init
= &(const struct clk_init_data
) {
531 .name
= "disp_cc_mdss_pclk0_clk",
532 .parent_hws
= (const struct clk_hw
*[]) {
533 &disp_cc_mdss_pclk0_clk_src
.clkr
.hw
,
536 .flags
= CLK_SET_RATE_PARENT
,
537 .ops
= &clk_branch2_ops
,
542 static struct clk_branch disp_cc_mdss_rot1_clk
= {
544 .halt_check
= BRANCH_HALT
,
546 .enable_reg
= 0xa00c,
547 .enable_mask
= BIT(0),
548 .hw
.init
= &(const struct clk_init_data
) {
549 .name
= "disp_cc_mdss_rot1_clk",
550 .parent_hws
= (const struct clk_hw
*[]) {
551 &disp_cc_mdss_rot_clk_src
.clkr
.hw
,
554 .flags
= CLK_SET_RATE_PARENT
,
555 .ops
= &clk_branch2_ops
,
560 static struct clk_branch disp_cc_mdss_rot_clk
= {
562 .halt_check
= BRANCH_HALT
,
564 .enable_reg
= 0x8010,
565 .enable_mask
= BIT(0),
566 .hw
.init
= &(const struct clk_init_data
) {
567 .name
= "disp_cc_mdss_rot_clk",
568 .parent_hws
= (const struct clk_hw
*[]) {
569 &disp_cc_mdss_rot_clk_src
.clkr
.hw
,
572 .flags
= CLK_SET_RATE_PARENT
,
573 .ops
= &clk_branch2_ops
,
578 static struct clk_branch disp_cc_mdss_rscc_ahb_clk
= {
580 .halt_check
= BRANCH_HALT
,
582 .enable_reg
= 0xc00c,
583 .enable_mask
= BIT(0),
584 .hw
.init
= &(const struct clk_init_data
) {
585 .name
= "disp_cc_mdss_rscc_ahb_clk",
586 .parent_hws
= (const struct clk_hw
*[]) {
587 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
590 .flags
= CLK_SET_RATE_PARENT
,
591 .ops
= &clk_branch2_ops
,
596 static struct clk_branch disp_cc_mdss_rscc_vsync_clk
= {
598 .halt_check
= BRANCH_HALT
,
600 .enable_reg
= 0xc008,
601 .enable_mask
= BIT(0),
602 .hw
.init
= &(const struct clk_init_data
) {
603 .name
= "disp_cc_mdss_rscc_vsync_clk",
604 .parent_hws
= (const struct clk_hw
*[]) {
605 &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
608 .flags
= CLK_SET_RATE_PARENT
,
609 .ops
= &clk_branch2_ops
,
614 static struct clk_branch disp_cc_mdss_vsync1_clk
= {
616 .halt_check
= BRANCH_HALT
,
618 .enable_reg
= 0xa01c,
619 .enable_mask
= BIT(0),
620 .hw
.init
= &(const struct clk_init_data
) {
621 .name
= "disp_cc_mdss_vsync1_clk",
622 .parent_hws
= (const struct clk_hw
*[]) {
623 &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
626 .flags
= CLK_SET_RATE_PARENT
,
627 .ops
= &clk_branch2_ops
,
632 static struct clk_branch disp_cc_mdss_vsync_clk
= {
634 .halt_check
= BRANCH_HALT
,
636 .enable_reg
= 0x8020,
637 .enable_mask
= BIT(0),
638 .hw
.init
= &(const struct clk_init_data
) {
639 .name
= "disp_cc_mdss_vsync_clk",
640 .parent_hws
= (const struct clk_hw
*[]) {
641 &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
644 .flags
= CLK_SET_RATE_PARENT
,
645 .ops
= &clk_branch2_ops
,
650 static struct gdsc disp_cc_mdss_core_gdsc
= {
652 .en_rest_wait_val
= 0x2,
653 .en_few_wait_val
= 0x2,
654 .clk_dis_wait_val
= 0xf,
656 .name
= "disp_cc_mdss_core_gdsc",
658 .pwrsts
= PWRSTS_OFF_ON
,
659 .flags
= HW_CTRL
| POLL_CFG_GDSCR
| RETAIN_FF_ENABLE
,
662 static struct gdsc disp_cc_mdss_core_int2_gdsc
= {
664 .en_rest_wait_val
= 0x2,
665 .en_few_wait_val
= 0x2,
666 .clk_dis_wait_val
= 0xf,
668 .name
= "disp_cc_mdss_core_int2_gdsc",
670 .pwrsts
= PWRSTS_OFF_ON
,
671 .flags
= HW_CTRL
| POLL_CFG_GDSCR
| RETAIN_FF_ENABLE
,
674 static struct clk_regmap
*disp_cc_sm4450_clocks
[] = {
675 [DISP_CC_MDSS_AHB1_CLK
] = &disp_cc_mdss_ahb1_clk
.clkr
,
676 [DISP_CC_MDSS_AHB_CLK
] = &disp_cc_mdss_ahb_clk
.clkr
,
677 [DISP_CC_MDSS_AHB_CLK_SRC
] = &disp_cc_mdss_ahb_clk_src
.clkr
,
678 [DISP_CC_MDSS_BYTE0_CLK
] = &disp_cc_mdss_byte0_clk
.clkr
,
679 [DISP_CC_MDSS_BYTE0_CLK_SRC
] = &disp_cc_mdss_byte0_clk_src
.clkr
,
680 [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC
] = &disp_cc_mdss_byte0_div_clk_src
.clkr
,
681 [DISP_CC_MDSS_BYTE0_INTF_CLK
] = &disp_cc_mdss_byte0_intf_clk
.clkr
,
682 [DISP_CC_MDSS_ESC0_CLK
] = &disp_cc_mdss_esc0_clk
.clkr
,
683 [DISP_CC_MDSS_ESC0_CLK_SRC
] = &disp_cc_mdss_esc0_clk_src
.clkr
,
684 [DISP_CC_MDSS_MDP1_CLK
] = &disp_cc_mdss_mdp1_clk
.clkr
,
685 [DISP_CC_MDSS_MDP_CLK
] = &disp_cc_mdss_mdp_clk
.clkr
,
686 [DISP_CC_MDSS_MDP_CLK_SRC
] = &disp_cc_mdss_mdp_clk_src
.clkr
,
687 [DISP_CC_MDSS_MDP_LUT1_CLK
] = &disp_cc_mdss_mdp_lut1_clk
.clkr
,
688 [DISP_CC_MDSS_MDP_LUT_CLK
] = &disp_cc_mdss_mdp_lut_clk
.clkr
,
689 [DISP_CC_MDSS_NON_GDSC_AHB_CLK
] = &disp_cc_mdss_non_gdsc_ahb_clk
.clkr
,
690 [DISP_CC_MDSS_PCLK0_CLK
] = &disp_cc_mdss_pclk0_clk
.clkr
,
691 [DISP_CC_MDSS_PCLK0_CLK_SRC
] = &disp_cc_mdss_pclk0_clk_src
.clkr
,
692 [DISP_CC_MDSS_ROT1_CLK
] = &disp_cc_mdss_rot1_clk
.clkr
,
693 [DISP_CC_MDSS_ROT_CLK
] = &disp_cc_mdss_rot_clk
.clkr
,
694 [DISP_CC_MDSS_ROT_CLK_SRC
] = &disp_cc_mdss_rot_clk_src
.clkr
,
695 [DISP_CC_MDSS_RSCC_AHB_CLK
] = &disp_cc_mdss_rscc_ahb_clk
.clkr
,
696 [DISP_CC_MDSS_RSCC_VSYNC_CLK
] = &disp_cc_mdss_rscc_vsync_clk
.clkr
,
697 [DISP_CC_MDSS_VSYNC1_CLK
] = &disp_cc_mdss_vsync1_clk
.clkr
,
698 [DISP_CC_MDSS_VSYNC_CLK
] = &disp_cc_mdss_vsync_clk
.clkr
,
699 [DISP_CC_MDSS_VSYNC_CLK_SRC
] = &disp_cc_mdss_vsync_clk_src
.clkr
,
700 [DISP_CC_PLL0
] = &disp_cc_pll0
.clkr
,
701 [DISP_CC_PLL1
] = &disp_cc_pll1
.clkr
,
702 [DISP_CC_SLEEP_CLK_SRC
] = &disp_cc_sleep_clk_src
.clkr
,
703 [DISP_CC_XO_CLK_SRC
] = &disp_cc_xo_clk_src
.clkr
,
706 static struct gdsc
*disp_cc_sm4450_gdscs
[] = {
707 [DISP_CC_MDSS_CORE_GDSC
] = &disp_cc_mdss_core_gdsc
,
708 [DISP_CC_MDSS_CORE_INT2_GDSC
] = &disp_cc_mdss_core_int2_gdsc
,
711 static const struct qcom_reset_map disp_cc_sm4450_resets
[] = {
712 [DISP_CC_MDSS_CORE_BCR
] = { 0x8000 },
713 [DISP_CC_MDSS_CORE_INT2_BCR
] = { 0xa000 },
714 [DISP_CC_MDSS_RSCC_BCR
] = { 0xc000 },
717 static const struct regmap_config disp_cc_sm4450_regmap_config
= {
721 .max_register
= 0x11008,
725 static struct qcom_cc_desc disp_cc_sm4450_desc
= {
726 .config
= &disp_cc_sm4450_regmap_config
,
727 .clks
= disp_cc_sm4450_clocks
,
728 .num_clks
= ARRAY_SIZE(disp_cc_sm4450_clocks
),
729 .resets
= disp_cc_sm4450_resets
,
730 .num_resets
= ARRAY_SIZE(disp_cc_sm4450_resets
),
731 .gdscs
= disp_cc_sm4450_gdscs
,
732 .num_gdscs
= ARRAY_SIZE(disp_cc_sm4450_gdscs
),
735 static const struct of_device_id disp_cc_sm4450_match_table
[] = {
736 { .compatible
= "qcom,sm4450-dispcc" },
739 MODULE_DEVICE_TABLE(of
, disp_cc_sm4450_match_table
);
741 static int disp_cc_sm4450_probe(struct platform_device
*pdev
)
743 struct regmap
*regmap
;
745 regmap
= qcom_cc_map(pdev
, &disp_cc_sm4450_desc
);
747 return PTR_ERR(regmap
);
749 clk_lucid_evo_pll_configure(&disp_cc_pll0
, regmap
, &disp_cc_pll0_config
);
750 clk_lucid_evo_pll_configure(&disp_cc_pll1
, regmap
, &disp_cc_pll0_config
);
752 /* Keep some clocks always enabled */
753 qcom_branch_set_clk_en(regmap
, 0xe070); /* DISP_CC_SLEEP_CLK */
754 qcom_branch_set_clk_en(regmap
, 0xe054); /* DISP_CC_XO_CLK */
756 return qcom_cc_really_probe(&pdev
->dev
, &disp_cc_sm4450_desc
, regmap
);
759 static struct platform_driver disp_cc_sm4450_driver
= {
760 .probe
= disp_cc_sm4450_probe
,
762 .name
= "dispcc-sm4450",
763 .of_match_table
= disp_cc_sm4450_match_table
,
767 module_platform_driver(disp_cc_sm4450_driver
);
769 MODULE_DESCRIPTION("QTI DISPCC SM4450 Driver");
770 MODULE_LICENSE("GPL");