1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
7 #include <linux/clk-provider.h>
8 #include <linux/module.h>
9 #include <linux/platform_device.h>
10 #include <linux/regmap.h>
12 #include <dt-bindings/clock/qcom,dispcc-sm6350.h>
14 #include "clk-alpha-pll.h"
15 #include "clk-branch.h"
17 #include "clk-regmap.h"
18 #include "clk-regmap-divider.h"
25 P_DISP_CC_PLL0_OUT_EVEN
,
26 P_DISP_CC_PLL0_OUT_MAIN
,
27 P_DP_PHY_PLL_LINK_CLK
,
28 P_DP_PHY_PLL_VCO_DIV_CLK
,
29 P_DSI0_PHY_PLL_OUT_BYTECLK
,
30 P_DSI0_PHY_PLL_OUT_DSICLK
,
34 static const struct pll_vco fabia_vco
[] = {
35 { 249600000, 2000000000, 0 },
38 static const struct alpha_pll_config disp_cc_pll0_config
= {
41 .config_ctl_val
= 0x20485699,
42 .config_ctl_hi_val
= 0x00002067,
43 .test_ctl_val
= 0x40000000,
44 .test_ctl_hi_val
= 0x00000002,
45 .user_ctl_val
= 0x00000000,
46 .user_ctl_hi_val
= 0x00004805,
49 static struct clk_alpha_pll disp_cc_pll0
= {
51 .vco_table
= fabia_vco
,
52 .num_vco
= ARRAY_SIZE(fabia_vco
),
53 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
55 .hw
.init
= &(struct clk_init_data
){
56 .name
= "disp_cc_pll0",
57 .parent_data
= &(const struct clk_parent_data
){
61 .ops
= &clk_alpha_pll_fabia_ops
,
66 static const struct parent_map disp_cc_parent_map_0
[] = {
68 { P_DP_PHY_PLL_LINK_CLK
, 1 },
69 { P_DP_PHY_PLL_VCO_DIV_CLK
, 2 },
72 static const struct clk_parent_data disp_cc_parent_data_0
[] = {
73 { .fw_name
= "bi_tcxo" },
74 { .fw_name
= "dp_phy_pll_link_clk" },
75 { .fw_name
= "dp_phy_pll_vco_div_clk" },
78 static const struct parent_map disp_cc_parent_map_1
[] = {
80 { P_DSI0_PHY_PLL_OUT_BYTECLK
, 1 },
83 static const struct clk_parent_data disp_cc_parent_data_1
[] = {
84 { .fw_name
= "bi_tcxo" },
85 { .fw_name
= "dsi0_phy_pll_out_byteclk" },
88 static const struct parent_map disp_cc_parent_map_3
[] = {
90 { P_DISP_CC_PLL0_OUT_MAIN
, 1 },
91 { P_GCC_DISP_GPLL0_CLK
, 4 },
92 { P_DISP_CC_PLL0_OUT_EVEN
, 5 },
95 static const struct clk_parent_data disp_cc_parent_data_3
[] = {
96 { .fw_name
= "bi_tcxo" },
97 { .hw
= &disp_cc_pll0
.clkr
.hw
},
98 { .fw_name
= "gcc_disp_gpll0_clk" },
99 { .hw
= &disp_cc_pll0
.clkr
.hw
},
102 static const struct parent_map disp_cc_parent_map_4
[] = {
104 { P_GCC_DISP_GPLL0_CLK
, 4 },
107 static const struct clk_parent_data disp_cc_parent_data_4
[] = {
108 { .fw_name
= "bi_tcxo" },
109 { .fw_name
= "gcc_disp_gpll0_clk" },
112 static const struct parent_map disp_cc_parent_map_5
[] = {
114 { P_DSI0_PHY_PLL_OUT_DSICLK
, 1 },
117 static const struct clk_parent_data disp_cc_parent_data_5
[] = {
118 { .fw_name
= "bi_tcxo" },
119 { .fw_name
= "dsi0_phy_pll_out_dsiclk" },
122 static const struct parent_map disp_cc_parent_map_6
[] = {
126 static const struct clk_parent_data disp_cc_parent_data_6
[] = {
127 { .fw_name
= "bi_tcxo" },
130 static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src
[] = {
131 F(19200000, P_BI_TCXO
, 1, 0, 0),
132 F(37500000, P_GCC_DISP_GPLL0_CLK
, 16, 0, 0),
133 F(75000000, P_GCC_DISP_GPLL0_CLK
, 8, 0, 0),
137 static struct clk_rcg2 disp_cc_mdss_ahb_clk_src
= {
141 .parent_map
= disp_cc_parent_map_4
,
142 .freq_tbl
= ftbl_disp_cc_mdss_ahb_clk_src
,
143 .clkr
.hw
.init
= &(struct clk_init_data
){
144 .name
= "disp_cc_mdss_ahb_clk_src",
145 .parent_data
= disp_cc_parent_data_4
,
146 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_4
),
147 .flags
= CLK_SET_RATE_PARENT
,
148 .ops
= &clk_rcg2_ops
,
152 static struct clk_rcg2 disp_cc_mdss_byte0_clk_src
= {
156 .parent_map
= disp_cc_parent_map_1
,
157 .clkr
.hw
.init
= &(struct clk_init_data
){
158 .name
= "disp_cc_mdss_byte0_clk_src",
159 .parent_data
= disp_cc_parent_data_1
,
160 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
161 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
162 .ops
= &clk_byte2_ops
,
166 static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src
= {
170 .clkr
.hw
.init
= &(struct clk_init_data
) {
171 .name
= "disp_cc_mdss_byte0_div_clk_src",
172 .parent_hws
= (const struct clk_hw
*[]){
173 &disp_cc_mdss_byte0_clk_src
.clkr
.hw
,
176 .flags
= CLK_GET_RATE_NOCACHE
,
177 .ops
= &clk_regmap_div_ro_ops
,
181 static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux_clk_src
[] = {
182 F(19200000, P_BI_TCXO
, 1, 0, 0),
186 static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src
= {
190 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
191 .clkr
.hw
.init
= &(struct clk_init_data
){
192 .name
= "disp_cc_mdss_dp_aux_clk_src",
193 .parent_data
= &(const struct clk_parent_data
){
194 .fw_name
= "bi_tcxo",
197 .ops
= &clk_rcg2_ops
,
201 static const struct freq_tbl ftbl_disp_cc_mdss_dp_crypto_clk_src
[] = {
202 F(108000, P_DP_PHY_PLL_LINK_CLK
, 3, 0, 0),
203 F(180000, P_DP_PHY_PLL_LINK_CLK
, 3, 0, 0),
204 F(360000, P_DP_PHY_PLL_LINK_CLK
, 1.5, 0, 0),
205 F(540000, P_DP_PHY_PLL_LINK_CLK
, 1.5, 0, 0),
209 static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src
= {
213 .parent_map
= disp_cc_parent_map_0
,
214 .freq_tbl
= ftbl_disp_cc_mdss_dp_crypto_clk_src
,
215 .clkr
.hw
.init
= &(struct clk_init_data
){
216 .name
= "disp_cc_mdss_dp_crypto_clk_src",
217 .parent_data
= disp_cc_parent_data_0
,
218 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
219 .flags
= CLK_GET_RATE_NOCACHE
,
220 .ops
= &clk_rcg2_ops
,
224 static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src
= {
228 .parent_map
= disp_cc_parent_map_0
,
229 .clkr
.hw
.init
= &(struct clk_init_data
){
230 .name
= "disp_cc_mdss_dp_link_clk_src",
231 .parent_data
= disp_cc_parent_data_0
,
232 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
233 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
234 .ops
= &clk_byte2_ops
,
238 static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src
= {
242 .parent_map
= disp_cc_parent_map_0
,
243 .clkr
.hw
.init
= &(struct clk_init_data
){
244 .name
= "disp_cc_mdss_dp_pixel_clk_src",
245 .parent_data
= disp_cc_parent_data_0
,
246 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
247 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
252 static struct clk_rcg2 disp_cc_mdss_esc0_clk_src
= {
256 .parent_map
= disp_cc_parent_map_1
,
257 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
258 .clkr
.hw
.init
= &(struct clk_init_data
){
259 .name
= "disp_cc_mdss_esc0_clk_src",
260 .parent_data
= disp_cc_parent_data_1
,
261 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
262 .ops
= &clk_rcg2_ops
,
266 static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src
[] = {
267 F(19200000, P_BI_TCXO
, 1, 0, 0),
268 F(200000000, P_GCC_DISP_GPLL0_CLK
, 3, 0, 0),
269 F(300000000, P_GCC_DISP_GPLL0_CLK
, 2, 0, 0),
270 F(373333333, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
271 F(448000000, P_DISP_CC_PLL0_OUT_MAIN
, 2.5, 0, 0),
272 F(560000000, P_DISP_CC_PLL0_OUT_MAIN
, 2, 0, 0),
276 static struct clk_rcg2 disp_cc_mdss_mdp_clk_src
= {
280 .parent_map
= disp_cc_parent_map_3
,
281 .freq_tbl
= ftbl_disp_cc_mdss_mdp_clk_src
,
282 .clkr
.hw
.init
= &(struct clk_init_data
){
283 .name
= "disp_cc_mdss_mdp_clk_src",
284 .parent_data
= disp_cc_parent_data_3
,
285 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_3
),
286 .flags
= CLK_SET_RATE_PARENT
,
287 .ops
= &clk_rcg2_ops
,
291 static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src
= {
295 .parent_map
= disp_cc_parent_map_5
,
296 .clkr
.hw
.init
= &(struct clk_init_data
){
297 .name
= "disp_cc_mdss_pclk0_clk_src",
298 .parent_data
= disp_cc_parent_data_5
,
299 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_5
),
300 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
| CLK_OPS_PARENT_ENABLE
,
301 .ops
= &clk_pixel_ops
,
305 static struct clk_rcg2 disp_cc_mdss_rot_clk_src
= {
309 .parent_map
= disp_cc_parent_map_3
,
310 .freq_tbl
= ftbl_disp_cc_mdss_mdp_clk_src
,
311 .clkr
.hw
.init
= &(struct clk_init_data
){
312 .name
= "disp_cc_mdss_rot_clk_src",
313 .parent_data
= disp_cc_parent_data_3
,
314 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_3
),
315 .flags
= CLK_SET_RATE_PARENT
,
316 .ops
= &clk_rcg2_ops
,
320 static struct clk_rcg2 disp_cc_mdss_vsync_clk_src
= {
324 .parent_map
= disp_cc_parent_map_6
,
325 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
326 .clkr
.hw
.init
= &(struct clk_init_data
){
327 .name
= "disp_cc_mdss_vsync_clk_src",
328 .parent_data
= disp_cc_parent_data_6
,
329 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_6
),
330 .ops
= &clk_rcg2_ops
,
334 static struct clk_regmap_div disp_cc_mdss_dp_link_div_clk_src
= {
338 .clkr
.hw
.init
= &(struct clk_init_data
) {
339 .name
= "disp_cc_mdss_dp_link_div_clk_src",
340 .parent_hws
= (const struct clk_hw
*[]){
341 &disp_cc_mdss_dp_link_clk_src
.clkr
.hw
,
344 .flags
= CLK_GET_RATE_NOCACHE
,
345 .ops
= &clk_regmap_div_ro_ops
,
349 static struct clk_branch disp_cc_mdss_ahb_clk
= {
351 .halt_check
= BRANCH_HALT
,
353 .enable_reg
= 0x104c,
354 .enable_mask
= BIT(0),
355 .hw
.init
= &(struct clk_init_data
){
356 .name
= "disp_cc_mdss_ahb_clk",
357 .parent_hws
= (const struct clk_hw
*[]){
358 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
361 .flags
= CLK_SET_RATE_PARENT
,
362 .ops
= &clk_branch2_ops
,
367 static struct clk_branch disp_cc_mdss_byte0_clk
= {
369 .halt_check
= BRANCH_HALT
,
371 .enable_reg
= 0x102c,
372 .enable_mask
= BIT(0),
373 .hw
.init
= &(struct clk_init_data
){
374 .name
= "disp_cc_mdss_byte0_clk",
375 .parent_hws
= (const struct clk_hw
*[]){
376 &disp_cc_mdss_byte0_clk_src
.clkr
.hw
,
379 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
| CLK_OPS_PARENT_ENABLE
,
380 .ops
= &clk_branch2_ops
,
385 static struct clk_branch disp_cc_mdss_byte0_intf_clk
= {
387 .halt_check
= BRANCH_HALT
,
389 .enable_reg
= 0x1030,
390 .enable_mask
= BIT(0),
391 .hw
.init
= &(struct clk_init_data
){
392 .name
= "disp_cc_mdss_byte0_intf_clk",
393 .parent_hws
= (const struct clk_hw
*[]){
394 &disp_cc_mdss_byte0_div_clk_src
.clkr
.hw
,
397 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
398 .ops
= &clk_branch2_ops
,
403 static struct clk_branch disp_cc_mdss_dp_aux_clk
= {
405 .halt_check
= BRANCH_HALT
,
407 .enable_reg
= 0x1048,
408 .enable_mask
= BIT(0),
409 .hw
.init
= &(struct clk_init_data
){
410 .name
= "disp_cc_mdss_dp_aux_clk",
411 .parent_hws
= (const struct clk_hw
*[]){
412 &disp_cc_mdss_dp_aux_clk_src
.clkr
.hw
,
415 .flags
= CLK_SET_RATE_PARENT
,
416 .ops
= &clk_branch2_ops
,
421 static struct clk_branch disp_cc_mdss_dp_crypto_clk
= {
423 .halt_check
= BRANCH_HALT
,
425 .enable_reg
= 0x1040,
426 .enable_mask
= BIT(0),
427 .hw
.init
= &(struct clk_init_data
){
428 .name
= "disp_cc_mdss_dp_crypto_clk",
429 .parent_hws
= (const struct clk_hw
*[]){
430 &disp_cc_mdss_dp_crypto_clk_src
.clkr
.hw
,
433 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
434 .ops
= &clk_branch2_ops
,
439 static struct clk_branch disp_cc_mdss_dp_link_clk
= {
441 .halt_check
= BRANCH_HALT
,
443 .enable_reg
= 0x1038,
444 .enable_mask
= BIT(0),
445 .hw
.init
= &(struct clk_init_data
){
446 .name
= "disp_cc_mdss_dp_link_clk",
447 .parent_hws
= (const struct clk_hw
*[]){
448 &disp_cc_mdss_dp_link_clk_src
.clkr
.hw
,
451 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
452 .ops
= &clk_branch2_ops
,
457 static struct clk_branch disp_cc_mdss_dp_link_intf_clk
= {
459 .halt_check
= BRANCH_HALT
,
461 .enable_reg
= 0x103c,
462 .enable_mask
= BIT(0),
463 .hw
.init
= &(struct clk_init_data
){
464 .name
= "disp_cc_mdss_dp_link_intf_clk",
465 .parent_hws
= (const struct clk_hw
*[]){
466 &disp_cc_mdss_dp_link_div_clk_src
.clkr
.hw
,
469 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
470 .ops
= &clk_branch2_ops
,
475 static struct clk_branch disp_cc_mdss_dp_pixel_clk
= {
477 .halt_check
= BRANCH_HALT
,
479 .enable_reg
= 0x1044,
480 .enable_mask
= BIT(0),
481 .hw
.init
= &(struct clk_init_data
){
482 .name
= "disp_cc_mdss_dp_pixel_clk",
483 .parent_hws
= (const struct clk_hw
*[]){
484 &disp_cc_mdss_dp_pixel_clk_src
.clkr
.hw
,
487 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
488 .ops
= &clk_branch2_ops
,
493 static struct clk_branch disp_cc_mdss_esc0_clk
= {
495 .halt_check
= BRANCH_HALT
,
497 .enable_reg
= 0x1034,
498 .enable_mask
= BIT(0),
499 .hw
.init
= &(struct clk_init_data
){
500 .name
= "disp_cc_mdss_esc0_clk",
501 .parent_hws
= (const struct clk_hw
*[]){
502 &disp_cc_mdss_esc0_clk_src
.clkr
.hw
,
505 .flags
= CLK_SET_RATE_PARENT
,
506 .ops
= &clk_branch2_ops
,
511 static struct clk_branch disp_cc_mdss_mdp_clk
= {
513 .halt_check
= BRANCH_HALT
,
515 .enable_reg
= 0x1010,
516 .enable_mask
= BIT(0),
517 .hw
.init
= &(struct clk_init_data
){
518 .name
= "disp_cc_mdss_mdp_clk",
519 .parent_hws
= (const struct clk_hw
*[]){
520 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
523 .flags
= CLK_SET_RATE_PARENT
,
524 .ops
= &clk_branch2_ops
,
529 static struct clk_branch disp_cc_mdss_mdp_lut_clk
= {
531 .halt_check
= BRANCH_HALT_VOTED
,
533 .enable_reg
= 0x1020,
534 .enable_mask
= BIT(0),
535 .hw
.init
= &(struct clk_init_data
){
536 .name
= "disp_cc_mdss_mdp_lut_clk",
537 .parent_hws
= (const struct clk_hw
*[]){
538 &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
541 .flags
= CLK_SET_RATE_PARENT
,
542 .ops
= &clk_branch2_ops
,
547 static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk
= {
549 .halt_check
= BRANCH_HALT_VOTED
,
551 .enable_reg
= 0x2004,
552 .enable_mask
= BIT(0),
553 .hw
.init
= &(struct clk_init_data
){
554 .name
= "disp_cc_mdss_non_gdsc_ahb_clk",
555 .parent_hws
= (const struct clk_hw
*[]){
556 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
559 .flags
= CLK_SET_RATE_PARENT
,
560 .ops
= &clk_branch2_ops
,
565 static struct clk_branch disp_cc_mdss_pclk0_clk
= {
567 .halt_check
= BRANCH_HALT
,
569 .enable_reg
= 0x100c,
570 .enable_mask
= BIT(0),
571 .hw
.init
= &(struct clk_init_data
){
572 .name
= "disp_cc_mdss_pclk0_clk",
573 .parent_hws
= (const struct clk_hw
*[]){
574 &disp_cc_mdss_pclk0_clk_src
.clkr
.hw
,
577 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
578 .ops
= &clk_branch2_ops
,
583 static struct clk_branch disp_cc_mdss_rot_clk
= {
585 .halt_check
= BRANCH_HALT
,
587 .enable_reg
= 0x1018,
588 .enable_mask
= BIT(0),
589 .hw
.init
= &(struct clk_init_data
){
590 .name
= "disp_cc_mdss_rot_clk",
591 .parent_hws
= (const struct clk_hw
*[]){
592 &disp_cc_mdss_rot_clk_src
.clkr
.hw
,
595 .flags
= CLK_SET_RATE_PARENT
,
596 .ops
= &clk_branch2_ops
,
601 static struct clk_branch disp_cc_mdss_rscc_ahb_clk
= {
603 .halt_check
= BRANCH_HALT
,
605 .enable_reg
= 0x200c,
606 .enable_mask
= BIT(0),
607 .hw
.init
= &(struct clk_init_data
){
608 .name
= "disp_cc_mdss_rscc_ahb_clk",
609 .parent_hws
= (const struct clk_hw
*[]){
610 &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
613 .flags
= CLK_SET_RATE_PARENT
,
614 .ops
= &clk_branch2_ops
,
619 static struct clk_branch disp_cc_mdss_rscc_vsync_clk
= {
621 .halt_check
= BRANCH_HALT
,
623 .enable_reg
= 0x2008,
624 .enable_mask
= BIT(0),
625 .hw
.init
= &(struct clk_init_data
){
626 .name
= "disp_cc_mdss_rscc_vsync_clk",
627 .parent_hws
= (const struct clk_hw
*[]){
628 &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
631 .flags
= CLK_SET_RATE_PARENT
,
632 .ops
= &clk_branch2_ops
,
637 static struct clk_branch disp_cc_mdss_vsync_clk
= {
639 .halt_check
= BRANCH_HALT
,
641 .enable_reg
= 0x1028,
642 .enable_mask
= BIT(0),
643 .hw
.init
= &(struct clk_init_data
){
644 .name
= "disp_cc_mdss_vsync_clk",
645 .parent_hws
= (const struct clk_hw
*[]){
646 &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
649 .flags
= CLK_SET_RATE_PARENT
,
650 .ops
= &clk_branch2_ops
,
655 static struct clk_branch disp_cc_sleep_clk
= {
657 .halt_check
= BRANCH_HALT
,
659 .enable_reg
= 0x5004,
660 .enable_mask
= BIT(0),
661 .hw
.init
= &(struct clk_init_data
){
662 .name
= "disp_cc_sleep_clk",
663 .ops
= &clk_branch2_ops
,
668 static struct clk_branch disp_cc_xo_clk
= {
670 .halt_check
= BRANCH_HALT
,
672 .enable_reg
= 0x5008,
673 .enable_mask
= BIT(0),
674 .hw
.init
= &(struct clk_init_data
){
675 .name
= "disp_cc_xo_clk",
676 .flags
= CLK_IS_CRITICAL
,
677 .ops
= &clk_branch2_ops
,
682 static struct gdsc mdss_gdsc
= {
687 .pwrsts
= PWRSTS_OFF_ON
,
688 .flags
= RETAIN_FF_ENABLE
,
691 static struct clk_regmap
*disp_cc_sm6350_clocks
[] = {
692 [DISP_CC_MDSS_AHB_CLK
] = &disp_cc_mdss_ahb_clk
.clkr
,
693 [DISP_CC_MDSS_AHB_CLK_SRC
] = &disp_cc_mdss_ahb_clk_src
.clkr
,
694 [DISP_CC_MDSS_BYTE0_CLK
] = &disp_cc_mdss_byte0_clk
.clkr
,
695 [DISP_CC_MDSS_BYTE0_CLK_SRC
] = &disp_cc_mdss_byte0_clk_src
.clkr
,
696 [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC
] = &disp_cc_mdss_byte0_div_clk_src
.clkr
,
697 [DISP_CC_MDSS_BYTE0_INTF_CLK
] = &disp_cc_mdss_byte0_intf_clk
.clkr
,
698 [DISP_CC_MDSS_DP_AUX_CLK
] = &disp_cc_mdss_dp_aux_clk
.clkr
,
699 [DISP_CC_MDSS_DP_AUX_CLK_SRC
] = &disp_cc_mdss_dp_aux_clk_src
.clkr
,
700 [DISP_CC_MDSS_DP_CRYPTO_CLK
] = &disp_cc_mdss_dp_crypto_clk
.clkr
,
701 [DISP_CC_MDSS_DP_CRYPTO_CLK_SRC
] = &disp_cc_mdss_dp_crypto_clk_src
.clkr
,
702 [DISP_CC_MDSS_DP_LINK_CLK
] = &disp_cc_mdss_dp_link_clk
.clkr
,
703 [DISP_CC_MDSS_DP_LINK_CLK_SRC
] = &disp_cc_mdss_dp_link_clk_src
.clkr
,
704 [DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC
] =
705 &disp_cc_mdss_dp_link_div_clk_src
.clkr
,
706 [DISP_CC_MDSS_DP_LINK_INTF_CLK
] = &disp_cc_mdss_dp_link_intf_clk
.clkr
,
707 [DISP_CC_MDSS_DP_PIXEL_CLK
] = &disp_cc_mdss_dp_pixel_clk
.clkr
,
708 [DISP_CC_MDSS_DP_PIXEL_CLK_SRC
] = &disp_cc_mdss_dp_pixel_clk_src
.clkr
,
709 [DISP_CC_MDSS_ESC0_CLK
] = &disp_cc_mdss_esc0_clk
.clkr
,
710 [DISP_CC_MDSS_ESC0_CLK_SRC
] = &disp_cc_mdss_esc0_clk_src
.clkr
,
711 [DISP_CC_MDSS_MDP_CLK
] = &disp_cc_mdss_mdp_clk
.clkr
,
712 [DISP_CC_MDSS_MDP_CLK_SRC
] = &disp_cc_mdss_mdp_clk_src
.clkr
,
713 [DISP_CC_MDSS_MDP_LUT_CLK
] = &disp_cc_mdss_mdp_lut_clk
.clkr
,
714 [DISP_CC_MDSS_NON_GDSC_AHB_CLK
] = &disp_cc_mdss_non_gdsc_ahb_clk
.clkr
,
715 [DISP_CC_MDSS_PCLK0_CLK
] = &disp_cc_mdss_pclk0_clk
.clkr
,
716 [DISP_CC_MDSS_PCLK0_CLK_SRC
] = &disp_cc_mdss_pclk0_clk_src
.clkr
,
717 [DISP_CC_MDSS_ROT_CLK
] = &disp_cc_mdss_rot_clk
.clkr
,
718 [DISP_CC_MDSS_ROT_CLK_SRC
] = &disp_cc_mdss_rot_clk_src
.clkr
,
719 [DISP_CC_MDSS_RSCC_AHB_CLK
] = &disp_cc_mdss_rscc_ahb_clk
.clkr
,
720 [DISP_CC_MDSS_RSCC_VSYNC_CLK
] = &disp_cc_mdss_rscc_vsync_clk
.clkr
,
721 [DISP_CC_MDSS_VSYNC_CLK
] = &disp_cc_mdss_vsync_clk
.clkr
,
722 [DISP_CC_MDSS_VSYNC_CLK_SRC
] = &disp_cc_mdss_vsync_clk_src
.clkr
,
723 [DISP_CC_PLL0
] = &disp_cc_pll0
.clkr
,
724 [DISP_CC_SLEEP_CLK
] = &disp_cc_sleep_clk
.clkr
,
725 [DISP_CC_XO_CLK
] = &disp_cc_xo_clk
.clkr
,
728 static struct gdsc
*disp_cc_sm6350_gdscs
[] = {
729 [MDSS_GDSC
] = &mdss_gdsc
,
732 static const struct regmap_config disp_cc_sm6350_regmap_config
= {
736 .max_register
= 0x10000,
740 static const struct qcom_cc_desc disp_cc_sm6350_desc
= {
741 .config
= &disp_cc_sm6350_regmap_config
,
742 .clks
= disp_cc_sm6350_clocks
,
743 .num_clks
= ARRAY_SIZE(disp_cc_sm6350_clocks
),
744 .gdscs
= disp_cc_sm6350_gdscs
,
745 .num_gdscs
= ARRAY_SIZE(disp_cc_sm6350_gdscs
),
748 static const struct of_device_id disp_cc_sm6350_match_table
[] = {
749 { .compatible
= "qcom,sm6350-dispcc" },
752 MODULE_DEVICE_TABLE(of
, disp_cc_sm6350_match_table
);
754 static int disp_cc_sm6350_probe(struct platform_device
*pdev
)
756 struct regmap
*regmap
;
758 regmap
= qcom_cc_map(pdev
, &disp_cc_sm6350_desc
);
760 return PTR_ERR(regmap
);
762 clk_fabia_pll_configure(&disp_cc_pll0
, regmap
, &disp_cc_pll0_config
);
764 return qcom_cc_really_probe(&pdev
->dev
, &disp_cc_sm6350_desc
, regmap
);
767 static struct platform_driver disp_cc_sm6350_driver
= {
768 .probe
= disp_cc_sm6350_probe
,
770 .name
= "disp_cc-sm6350",
771 .of_match_table
= disp_cc_sm6350_match_table
,
775 module_platform_driver(disp_cc_sm6350_driver
);
777 MODULE_DESCRIPTION("QTI DISP_CC SM6350 Driver");
778 MODULE_LICENSE("GPL v2");