1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
6 #include <linux/clk-provider.h>
7 #include <linux/module.h>
8 #include <linux/platform_device.h>
9 #include <linux/regmap.h>
11 #include <dt-bindings/clock/qcom,dispcc-sc7180.h>
13 #include "clk-alpha-pll.h"
14 #include "clk-branch.h"
16 #include "clk-regmap-divider.h"
23 P_CORE_BI_PLL_TEST_SE
,
24 P_DISP_CC_PLL0_OUT_EVEN
,
25 P_DISP_CC_PLL0_OUT_MAIN
,
26 P_DP_PHY_PLL_LINK_CLK
,
27 P_DP_PHY_PLL_VCO_DIV_CLK
,
28 P_DSI0_PHY_PLL_OUT_BYTECLK
,
29 P_DSI0_PHY_PLL_OUT_DSICLK
,
33 static const struct pll_vco fabia_vco
[] = {
34 { 249600000, 2000000000, 0 },
37 static struct clk_alpha_pll disp_cc_pll0
= {
39 .vco_table
= fabia_vco
,
40 .num_vco
= ARRAY_SIZE(fabia_vco
),
41 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
43 .hw
.init
= &(struct clk_init_data
){
44 .name
= "disp_cc_pll0",
45 .parent_data
= &(const struct clk_parent_data
){
49 .ops
= &clk_alpha_pll_fabia_ops
,
54 static const struct clk_div_table post_div_table_disp_cc_pll0_out_even
[] = {
59 static struct clk_alpha_pll_postdiv disp_cc_pll0_out_even
= {
62 .post_div_table
= post_div_table_disp_cc_pll0_out_even
,
63 .num_post_div
= ARRAY_SIZE(post_div_table_disp_cc_pll0_out_even
),
65 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
66 .clkr
.hw
.init
= &(struct clk_init_data
){
67 .name
= "disp_cc_pll0_out_even",
68 .parent_data
= &(const struct clk_parent_data
){
69 .hw
= &disp_cc_pll0
.clkr
.hw
,
72 .flags
= CLK_SET_RATE_PARENT
,
73 .ops
= &clk_alpha_pll_postdiv_fabia_ops
,
77 static const struct parent_map disp_cc_parent_map_0
[] = {
81 static const struct clk_parent_data disp_cc_parent_data_0
[] = {
82 { .fw_name
= "bi_tcxo" },
85 static const struct parent_map disp_cc_parent_map_1
[] = {
87 { P_DP_PHY_PLL_LINK_CLK
, 1 },
88 { P_DP_PHY_PLL_VCO_DIV_CLK
, 2 },
91 static const struct clk_parent_data disp_cc_parent_data_1
[] = {
92 { .fw_name
= "bi_tcxo" },
93 { .fw_name
= "dp_phy_pll_link_clk" },
94 { .fw_name
= "dp_phy_pll_vco_div_clk" },
97 static const struct parent_map disp_cc_parent_map_2
[] = {
99 { P_DSI0_PHY_PLL_OUT_BYTECLK
, 1 },
102 static const struct clk_parent_data disp_cc_parent_data_2
[] = {
103 { .fw_name
= "bi_tcxo" },
104 { .fw_name
= "dsi0_phy_pll_out_byteclk" },
107 static const struct parent_map disp_cc_parent_map_3
[] = {
109 { P_DISP_CC_PLL0_OUT_MAIN
, 1 },
110 { P_GPLL0_OUT_MAIN
, 4 },
111 { P_DISP_CC_PLL0_OUT_EVEN
, 5 },
114 static const struct clk_parent_data disp_cc_parent_data_3
[] = {
115 { .fw_name
= "bi_tcxo" },
116 { .hw
= &disp_cc_pll0
.clkr
.hw
},
117 { .fw_name
= "gcc_disp_gpll0_clk_src" },
118 { .hw
= &disp_cc_pll0_out_even
.clkr
.hw
},
121 static const struct parent_map disp_cc_parent_map_4
[] = {
123 { P_GPLL0_OUT_MAIN
, 4 },
126 static const struct clk_parent_data disp_cc_parent_data_4
[] = {
127 { .fw_name
= "bi_tcxo" },
128 { .fw_name
= "gcc_disp_gpll0_clk_src" },
131 static const struct parent_map disp_cc_parent_map_5
[] = {
133 { P_DSI0_PHY_PLL_OUT_DSICLK
, 1 },
136 static const struct clk_parent_data disp_cc_parent_data_5
[] = {
137 { .fw_name
= "bi_tcxo" },
138 { .fw_name
= "dsi0_phy_pll_out_dsiclk" },
141 static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src
[] = {
142 F(19200000, P_BI_TCXO
, 1, 0, 0),
143 F(37500000, P_GPLL0_OUT_MAIN
, 16, 0, 0),
144 F(75000000, P_GPLL0_OUT_MAIN
, 8, 0, 0),
148 static struct clk_rcg2 disp_cc_mdss_ahb_clk_src
= {
152 .parent_map
= disp_cc_parent_map_4
,
153 .freq_tbl
= ftbl_disp_cc_mdss_ahb_clk_src
,
154 .clkr
.hw
.init
= &(struct clk_init_data
){
155 .name
= "disp_cc_mdss_ahb_clk_src",
156 .parent_data
= disp_cc_parent_data_4
,
157 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_4
),
158 .flags
= CLK_SET_RATE_PARENT
,
159 .ops
= &clk_rcg2_shared_ops
,
163 static struct clk_rcg2 disp_cc_mdss_byte0_clk_src
= {
167 .parent_map
= disp_cc_parent_map_2
,
168 .clkr
.hw
.init
= &(struct clk_init_data
){
169 .name
= "disp_cc_mdss_byte0_clk_src",
170 .parent_data
= disp_cc_parent_data_2
,
171 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_2
),
172 .flags
= CLK_SET_RATE_PARENT
,
173 .ops
= &clk_byte2_ops
,
177 static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux_clk_src
[] = {
178 F(19200000, P_BI_TCXO
, 1, 0, 0),
182 static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src
= {
186 .parent_map
= disp_cc_parent_map_0
,
187 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
188 .clkr
.hw
.init
= &(struct clk_init_data
){
189 .name
= "disp_cc_mdss_dp_aux_clk_src",
190 .parent_data
= disp_cc_parent_data_0
,
191 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
192 .ops
= &clk_rcg2_ops
,
196 static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src
= {
200 .parent_map
= disp_cc_parent_map_1
,
201 .clkr
.hw
.init
= &(struct clk_init_data
){
202 .name
= "disp_cc_mdss_dp_crypto_clk_src",
203 .parent_data
= disp_cc_parent_data_1
,
204 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
205 .ops
= &clk_byte2_ops
,
209 static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src
= {
213 .parent_map
= disp_cc_parent_map_1
,
214 .clkr
.hw
.init
= &(struct clk_init_data
){
215 .name
= "disp_cc_mdss_dp_link_clk_src",
216 .parent_data
= disp_cc_parent_data_1
,
217 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
218 .ops
= &clk_byte2_ops
,
222 static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src
= {
226 .parent_map
= disp_cc_parent_map_1
,
227 .clkr
.hw
.init
= &(struct clk_init_data
){
228 .name
= "disp_cc_mdss_dp_pixel_clk_src",
229 .parent_data
= disp_cc_parent_data_1
,
230 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_1
),
235 static struct clk_rcg2 disp_cc_mdss_esc0_clk_src
= {
239 .parent_map
= disp_cc_parent_map_2
,
240 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
241 .clkr
.hw
.init
= &(struct clk_init_data
){
242 .name
= "disp_cc_mdss_esc0_clk_src",
243 .parent_data
= disp_cc_parent_data_2
,
244 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_2
),
245 .ops
= &clk_rcg2_ops
,
249 static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src
[] = {
250 F(19200000, P_BI_TCXO
, 1, 0, 0),
251 F(200000000, P_GPLL0_OUT_MAIN
, 3, 0, 0),
252 F(300000000, P_GPLL0_OUT_MAIN
, 2, 0, 0),
253 F(345000000, P_DISP_CC_PLL0_OUT_MAIN
, 4, 0, 0),
254 F(460000000, P_DISP_CC_PLL0_OUT_MAIN
, 3, 0, 0),
258 static struct clk_rcg2 disp_cc_mdss_mdp_clk_src
= {
262 .parent_map
= disp_cc_parent_map_3
,
263 .freq_tbl
= ftbl_disp_cc_mdss_mdp_clk_src
,
264 .clkr
.hw
.init
= &(struct clk_init_data
){
265 .name
= "disp_cc_mdss_mdp_clk_src",
266 .parent_data
= disp_cc_parent_data_3
,
267 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_3
),
268 .ops
= &clk_rcg2_shared_ops
,
272 static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src
= {
276 .parent_map
= disp_cc_parent_map_5
,
277 .clkr
.hw
.init
= &(struct clk_init_data
){
278 .name
= "disp_cc_mdss_pclk0_clk_src",
279 .parent_data
= disp_cc_parent_data_5
,
280 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_5
),
281 .flags
= CLK_SET_RATE_PARENT
,
282 .ops
= &clk_pixel_ops
,
286 static struct clk_rcg2 disp_cc_mdss_rot_clk_src
= {
290 .parent_map
= disp_cc_parent_map_3
,
291 .freq_tbl
= ftbl_disp_cc_mdss_mdp_clk_src
,
292 .clkr
.hw
.init
= &(struct clk_init_data
){
293 .name
= "disp_cc_mdss_rot_clk_src",
294 .parent_data
= disp_cc_parent_data_3
,
295 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_3
),
296 .ops
= &clk_rcg2_shared_ops
,
300 static struct clk_rcg2 disp_cc_mdss_vsync_clk_src
= {
304 .parent_map
= disp_cc_parent_map_0
,
305 .freq_tbl
= ftbl_disp_cc_mdss_dp_aux_clk_src
,
306 .clkr
.hw
.init
= &(struct clk_init_data
){
307 .name
= "disp_cc_mdss_vsync_clk_src",
308 .parent_data
= disp_cc_parent_data_0
,
309 .num_parents
= ARRAY_SIZE(disp_cc_parent_data_0
),
310 .ops
= &clk_rcg2_shared_ops
,
314 static struct clk_branch disp_cc_mdss_ahb_clk
= {
316 .halt_check
= BRANCH_HALT
,
318 .enable_reg
= 0x2080,
319 .enable_mask
= BIT(0),
320 .hw
.init
= &(struct clk_init_data
){
321 .name
= "disp_cc_mdss_ahb_clk",
322 .parent_data
= &(const struct clk_parent_data
){
323 .hw
= &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
326 .flags
= CLK_SET_RATE_PARENT
,
327 .ops
= &clk_branch2_ops
,
332 static struct clk_branch disp_cc_mdss_byte0_clk
= {
334 .halt_check
= BRANCH_HALT
,
336 .enable_reg
= 0x2028,
337 .enable_mask
= BIT(0),
338 .hw
.init
= &(struct clk_init_data
){
339 .name
= "disp_cc_mdss_byte0_clk",
340 .parent_data
= &(const struct clk_parent_data
){
341 .hw
= &disp_cc_mdss_byte0_clk_src
.clkr
.hw
,
344 .flags
= CLK_SET_RATE_PARENT
,
345 .ops
= &clk_branch2_ops
,
350 static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src
= {
354 .clkr
.hw
.init
= &(struct clk_init_data
) {
355 .name
= "disp_cc_mdss_byte0_div_clk_src",
356 .parent_data
= &(const struct clk_parent_data
){
357 .hw
= &disp_cc_mdss_byte0_clk_src
.clkr
.hw
360 .ops
= &clk_regmap_div_ops
,
364 static struct clk_regmap_div disp_cc_mdss_dp_link_div_clk_src
= {
368 .clkr
.hw
.init
= &(struct clk_init_data
) {
369 .name
= "disp_cc_mdss_dp_link_div_clk_src",
370 .parent_data
= &(const struct clk_parent_data
){
371 .hw
= &disp_cc_mdss_dp_link_clk_src
.clkr
.hw
374 .ops
= &clk_regmap_div_ops
,
378 static struct clk_branch disp_cc_mdss_byte0_intf_clk
= {
380 .halt_check
= BRANCH_HALT
,
382 .enable_reg
= 0x202c,
383 .enable_mask
= BIT(0),
384 .hw
.init
= &(struct clk_init_data
){
385 .name
= "disp_cc_mdss_byte0_intf_clk",
386 .parent_data
= &(const struct clk_parent_data
){
387 .hw
= &disp_cc_mdss_byte0_div_clk_src
.clkr
.hw
,
390 .flags
= CLK_SET_RATE_PARENT
,
391 .ops
= &clk_branch2_ops
,
396 static struct clk_branch disp_cc_mdss_dp_aux_clk
= {
398 .halt_check
= BRANCH_HALT
,
400 .enable_reg
= 0x2054,
401 .enable_mask
= BIT(0),
402 .hw
.init
= &(struct clk_init_data
){
403 .name
= "disp_cc_mdss_dp_aux_clk",
404 .parent_data
= &(const struct clk_parent_data
){
405 .hw
= &disp_cc_mdss_dp_aux_clk_src
.clkr
.hw
,
408 .flags
= CLK_SET_RATE_PARENT
,
409 .ops
= &clk_branch2_ops
,
414 static struct clk_branch disp_cc_mdss_dp_crypto_clk
= {
416 .halt_check
= BRANCH_HALT
,
418 .enable_reg
= 0x2048,
419 .enable_mask
= BIT(0),
420 .hw
.init
= &(struct clk_init_data
){
421 .name
= "disp_cc_mdss_dp_crypto_clk",
422 .parent_data
= &(const struct clk_parent_data
){
423 .hw
= &disp_cc_mdss_dp_crypto_clk_src
.clkr
.hw
,
426 .flags
= CLK_SET_RATE_PARENT
,
427 .ops
= &clk_branch2_ops
,
432 static struct clk_branch disp_cc_mdss_dp_link_clk
= {
434 .halt_check
= BRANCH_HALT
,
436 .enable_reg
= 0x2040,
437 .enable_mask
= BIT(0),
438 .hw
.init
= &(struct clk_init_data
){
439 .name
= "disp_cc_mdss_dp_link_clk",
440 .parent_data
= &(const struct clk_parent_data
){
441 .hw
= &disp_cc_mdss_dp_link_clk_src
.clkr
.hw
,
444 .flags
= CLK_SET_RATE_PARENT
,
445 .ops
= &clk_branch2_ops
,
450 static struct clk_branch disp_cc_mdss_dp_link_intf_clk
= {
452 .halt_check
= BRANCH_HALT
,
454 .enable_reg
= 0x2044,
455 .enable_mask
= BIT(0),
456 .hw
.init
= &(struct clk_init_data
){
457 .name
= "disp_cc_mdss_dp_link_intf_clk",
458 .parent_data
= &(const struct clk_parent_data
){
459 .hw
= &disp_cc_mdss_dp_link_div_clk_src
.clkr
.hw
,
462 .ops
= &clk_branch2_ops
,
467 static struct clk_branch disp_cc_mdss_dp_pixel_clk
= {
469 .halt_check
= BRANCH_HALT
,
471 .enable_reg
= 0x204c,
472 .enable_mask
= BIT(0),
473 .hw
.init
= &(struct clk_init_data
){
474 .name
= "disp_cc_mdss_dp_pixel_clk",
475 .parent_data
= &(const struct clk_parent_data
){
476 .hw
= &disp_cc_mdss_dp_pixel_clk_src
.clkr
.hw
,
479 .flags
= CLK_SET_RATE_PARENT
,
480 .ops
= &clk_branch2_ops
,
485 static struct clk_branch disp_cc_mdss_esc0_clk
= {
487 .halt_check
= BRANCH_HALT
,
489 .enable_reg
= 0x2038,
490 .enable_mask
= BIT(0),
491 .hw
.init
= &(struct clk_init_data
){
492 .name
= "disp_cc_mdss_esc0_clk",
493 .parent_data
= &(const struct clk_parent_data
){
494 .hw
= &disp_cc_mdss_esc0_clk_src
.clkr
.hw
,
497 .flags
= CLK_SET_RATE_PARENT
,
498 .ops
= &clk_branch2_ops
,
503 static struct clk_branch disp_cc_mdss_mdp_clk
= {
505 .halt_check
= BRANCH_HALT
,
507 .enable_reg
= 0x200c,
508 .enable_mask
= BIT(0),
509 .hw
.init
= &(struct clk_init_data
){
510 .name
= "disp_cc_mdss_mdp_clk",
511 .parent_data
= &(const struct clk_parent_data
){
512 .hw
= &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
515 .flags
= CLK_SET_RATE_PARENT
,
516 .ops
= &clk_branch2_ops
,
521 static struct clk_branch disp_cc_mdss_mdp_lut_clk
= {
523 .halt_check
= BRANCH_VOTED
,
525 .enable_reg
= 0x201c,
526 .enable_mask
= BIT(0),
527 .hw
.init
= &(struct clk_init_data
){
528 .name
= "disp_cc_mdss_mdp_lut_clk",
529 .parent_data
= &(const struct clk_parent_data
){
530 .hw
= &disp_cc_mdss_mdp_clk_src
.clkr
.hw
,
533 .ops
= &clk_branch2_ops
,
538 static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk
= {
540 .halt_check
= BRANCH_VOTED
,
542 .enable_reg
= 0x4004,
543 .enable_mask
= BIT(0),
544 .hw
.init
= &(struct clk_init_data
){
545 .name
= "disp_cc_mdss_non_gdsc_ahb_clk",
546 .parent_data
= &(const struct clk_parent_data
){
547 .hw
= &disp_cc_mdss_ahb_clk_src
.clkr
.hw
,
550 .flags
= CLK_SET_RATE_PARENT
,
551 .ops
= &clk_branch2_ops
,
556 static struct clk_branch disp_cc_mdss_pclk0_clk
= {
558 .halt_check
= BRANCH_HALT
,
560 .enable_reg
= 0x2004,
561 .enable_mask
= BIT(0),
562 .hw
.init
= &(struct clk_init_data
){
563 .name
= "disp_cc_mdss_pclk0_clk",
564 .parent_data
= &(const struct clk_parent_data
){
565 .hw
= &disp_cc_mdss_pclk0_clk_src
.clkr
.hw
,
568 .flags
= CLK_SET_RATE_PARENT
,
569 .ops
= &clk_branch2_ops
,
574 static struct clk_branch disp_cc_mdss_rot_clk
= {
576 .halt_check
= BRANCH_HALT
,
578 .enable_reg
= 0x2014,
579 .enable_mask
= BIT(0),
580 .hw
.init
= &(struct clk_init_data
){
581 .name
= "disp_cc_mdss_rot_clk",
582 .parent_data
= &(const struct clk_parent_data
){
583 .hw
= &disp_cc_mdss_rot_clk_src
.clkr
.hw
,
586 .flags
= CLK_SET_RATE_PARENT
,
587 .ops
= &clk_branch2_ops
,
592 static struct clk_branch disp_cc_mdss_rscc_vsync_clk
= {
594 .halt_check
= BRANCH_HALT
,
596 .enable_reg
= 0x4008,
597 .enable_mask
= BIT(0),
598 .hw
.init
= &(struct clk_init_data
){
599 .name
= "disp_cc_mdss_rscc_vsync_clk",
600 .parent_data
= &(const struct clk_parent_data
){
601 .hw
= &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
604 .flags
= CLK_SET_RATE_PARENT
,
605 .ops
= &clk_branch2_ops
,
610 static struct clk_branch disp_cc_mdss_vsync_clk
= {
612 .halt_check
= BRANCH_HALT
,
614 .enable_reg
= 0x2024,
615 .enable_mask
= BIT(0),
616 .hw
.init
= &(struct clk_init_data
){
617 .name
= "disp_cc_mdss_vsync_clk",
618 .parent_data
= &(const struct clk_parent_data
){
619 .hw
= &disp_cc_mdss_vsync_clk_src
.clkr
.hw
,
622 .flags
= CLK_SET_RATE_PARENT
,
623 .ops
= &clk_branch2_ops
,
628 static struct gdsc mdss_gdsc
= {
633 .pwrsts
= PWRSTS_OFF_ON
,
637 static struct gdsc
*disp_cc_sc7180_gdscs
[] = {
638 [MDSS_GDSC
] = &mdss_gdsc
,
641 static struct clk_regmap
*disp_cc_sc7180_clocks
[] = {
642 [DISP_CC_MDSS_AHB_CLK
] = &disp_cc_mdss_ahb_clk
.clkr
,
643 [DISP_CC_MDSS_AHB_CLK_SRC
] = &disp_cc_mdss_ahb_clk_src
.clkr
,
644 [DISP_CC_MDSS_BYTE0_CLK
] = &disp_cc_mdss_byte0_clk
.clkr
,
645 [DISP_CC_MDSS_BYTE0_CLK_SRC
] = &disp_cc_mdss_byte0_clk_src
.clkr
,
646 [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC
] = &disp_cc_mdss_byte0_div_clk_src
.clkr
,
647 [DISP_CC_MDSS_BYTE0_INTF_CLK
] = &disp_cc_mdss_byte0_intf_clk
.clkr
,
648 [DISP_CC_MDSS_DP_AUX_CLK
] = &disp_cc_mdss_dp_aux_clk
.clkr
,
649 [DISP_CC_MDSS_DP_AUX_CLK_SRC
] = &disp_cc_mdss_dp_aux_clk_src
.clkr
,
650 [DISP_CC_MDSS_DP_CRYPTO_CLK
] = &disp_cc_mdss_dp_crypto_clk
.clkr
,
651 [DISP_CC_MDSS_DP_CRYPTO_CLK_SRC
] = &disp_cc_mdss_dp_crypto_clk_src
.clkr
,
652 [DISP_CC_MDSS_DP_LINK_CLK
] = &disp_cc_mdss_dp_link_clk
.clkr
,
653 [DISP_CC_MDSS_DP_LINK_CLK_SRC
] = &disp_cc_mdss_dp_link_clk_src
.clkr
,
654 [DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC
] =
655 &disp_cc_mdss_dp_link_div_clk_src
.clkr
,
656 [DISP_CC_MDSS_DP_LINK_INTF_CLK
] = &disp_cc_mdss_dp_link_intf_clk
.clkr
,
657 [DISP_CC_MDSS_DP_PIXEL_CLK
] = &disp_cc_mdss_dp_pixel_clk
.clkr
,
658 [DISP_CC_MDSS_DP_PIXEL_CLK_SRC
] = &disp_cc_mdss_dp_pixel_clk_src
.clkr
,
659 [DISP_CC_MDSS_ESC0_CLK
] = &disp_cc_mdss_esc0_clk
.clkr
,
660 [DISP_CC_MDSS_ESC0_CLK_SRC
] = &disp_cc_mdss_esc0_clk_src
.clkr
,
661 [DISP_CC_MDSS_MDP_CLK
] = &disp_cc_mdss_mdp_clk
.clkr
,
662 [DISP_CC_MDSS_MDP_CLK_SRC
] = &disp_cc_mdss_mdp_clk_src
.clkr
,
663 [DISP_CC_MDSS_MDP_LUT_CLK
] = &disp_cc_mdss_mdp_lut_clk
.clkr
,
664 [DISP_CC_MDSS_NON_GDSC_AHB_CLK
] = &disp_cc_mdss_non_gdsc_ahb_clk
.clkr
,
665 [DISP_CC_MDSS_PCLK0_CLK
] = &disp_cc_mdss_pclk0_clk
.clkr
,
666 [DISP_CC_MDSS_PCLK0_CLK_SRC
] = &disp_cc_mdss_pclk0_clk_src
.clkr
,
667 [DISP_CC_MDSS_ROT_CLK
] = &disp_cc_mdss_rot_clk
.clkr
,
668 [DISP_CC_MDSS_ROT_CLK_SRC
] = &disp_cc_mdss_rot_clk_src
.clkr
,
669 [DISP_CC_MDSS_RSCC_VSYNC_CLK
] = &disp_cc_mdss_rscc_vsync_clk
.clkr
,
670 [DISP_CC_MDSS_VSYNC_CLK
] = &disp_cc_mdss_vsync_clk
.clkr
,
671 [DISP_CC_MDSS_VSYNC_CLK_SRC
] = &disp_cc_mdss_vsync_clk_src
.clkr
,
672 [DISP_CC_PLL0
] = &disp_cc_pll0
.clkr
,
673 [DISP_CC_PLL0_OUT_EVEN
] = &disp_cc_pll0_out_even
.clkr
,
676 static const struct regmap_config disp_cc_sc7180_regmap_config
= {
680 .max_register
= 0x10000,
684 static const struct qcom_cc_desc disp_cc_sc7180_desc
= {
685 .config
= &disp_cc_sc7180_regmap_config
,
686 .clks
= disp_cc_sc7180_clocks
,
687 .num_clks
= ARRAY_SIZE(disp_cc_sc7180_clocks
),
688 .gdscs
= disp_cc_sc7180_gdscs
,
689 .num_gdscs
= ARRAY_SIZE(disp_cc_sc7180_gdscs
),
692 static const struct of_device_id disp_cc_sc7180_match_table
[] = {
693 { .compatible
= "qcom,sc7180-dispcc" },
696 MODULE_DEVICE_TABLE(of
, disp_cc_sc7180_match_table
);
698 static int disp_cc_sc7180_probe(struct platform_device
*pdev
)
700 struct regmap
*regmap
;
701 struct alpha_pll_config disp_cc_pll_config
= {};
703 regmap
= qcom_cc_map(pdev
, &disp_cc_sc7180_desc
);
705 return PTR_ERR(regmap
);
707 /* 1380MHz configuration */
708 disp_cc_pll_config
.l
= 0x47;
709 disp_cc_pll_config
.alpha
= 0xe000;
710 disp_cc_pll_config
.user_ctl_val
= 0x00000001;
711 disp_cc_pll_config
.user_ctl_hi_val
= 0x00004805;
713 clk_fabia_pll_configure(&disp_cc_pll0
, regmap
, &disp_cc_pll_config
);
715 return qcom_cc_really_probe(pdev
, &disp_cc_sc7180_desc
, regmap
);
718 static struct platform_driver disp_cc_sc7180_driver
= {
719 .probe
= disp_cc_sc7180_probe
,
721 .name
= "sc7180-dispcc",
722 .of_match_table
= disp_cc_sc7180_match_table
,
726 static int __init
disp_cc_sc7180_init(void)
728 return platform_driver_register(&disp_cc_sc7180_driver
);
730 subsys_initcall(disp_cc_sc7180_init
);
732 static void __exit
disp_cc_sc7180_exit(void)
734 platform_driver_unregister(&disp_cc_sc7180_driver
);
736 module_exit(disp_cc_sc7180_exit
);
738 MODULE_DESCRIPTION("QTI DISP_CC SC7180 Driver");
739 MODULE_LICENSE("GPL v2");