1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2022, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022, Linaro Limited
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,sm6350-camcc.h>
14 #include "clk-alpha-pll.h"
15 #include "clk-branch.h"
26 P_CAMCC_PLL0_OUT_EVEN
,
27 P_CAMCC_PLL0_OUT_MAIN
,
28 P_CAMCC_PLL1_OUT_EVEN
,
29 P_CAMCC_PLL1_OUT_MAIN
,
30 P_CAMCC_PLL2_OUT_EARLY
,
31 P_CAMCC_PLL2_OUT_MAIN
,
32 P_CAMCC_PLL3_OUT_MAIN
,
35 static const struct pll_vco fabia_vco
[] = {
36 { 249600000, 2000000000, 0 },
39 /* 600MHz configuration */
40 static const struct alpha_pll_config camcc_pll0_config
= {
43 .config_ctl_val
= 0x20485699,
44 .config_ctl_hi_val
= 0x00002067,
45 .test_ctl_val
= 0x40000000,
46 .test_ctl_hi_val
= 0x00000002,
47 .user_ctl_val
= 0x00000101,
48 .user_ctl_hi_val
= 0x00004805,
51 static struct clk_alpha_pll camcc_pll0
= {
53 .vco_table
= fabia_vco
,
54 .num_vco
= ARRAY_SIZE(fabia_vco
),
55 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
57 .hw
.init
= &(struct clk_init_data
){
59 .parent_data
= &(const struct clk_parent_data
){
63 .ops
= &clk_alpha_pll_fabia_ops
,
68 static const struct clk_div_table post_div_table_camcc_pll0_out_even
[] = {
73 static struct clk_alpha_pll_postdiv camcc_pll0_out_even
= {
76 .post_div_table
= post_div_table_camcc_pll0_out_even
,
77 .num_post_div
= ARRAY_SIZE(post_div_table_camcc_pll0_out_even
),
79 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
80 .clkr
.hw
.init
= &(struct clk_init_data
){
81 .name
= "camcc_pll0_out_even",
82 .parent_hws
= (const struct clk_hw
*[]){
86 .flags
= CLK_SET_RATE_PARENT
,
87 .ops
= &clk_alpha_pll_postdiv_fabia_ops
,
91 /* 808MHz configuration */
92 static const struct alpha_pll_config camcc_pll1_config
= {
95 .config_ctl_val
= 0x20485699,
96 .config_ctl_hi_val
= 0x00002067,
97 .test_ctl_val
= 0x40000000,
98 .test_ctl_hi_val
= 0x00000000,
99 .user_ctl_val
= 0x00000101,
100 .user_ctl_hi_val
= 0x00004805,
103 static struct clk_alpha_pll camcc_pll1
= {
105 .vco_table
= fabia_vco
,
106 .num_vco
= ARRAY_SIZE(fabia_vco
),
107 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
109 .hw
.init
= &(struct clk_init_data
){
110 .name
= "camcc_pll1",
111 .parent_data
= &(const struct clk_parent_data
){
115 .ops
= &clk_alpha_pll_fabia_ops
,
120 static const struct clk_div_table post_div_table_camcc_pll1_out_even
[] = {
125 static struct clk_alpha_pll_postdiv camcc_pll1_out_even
= {
128 .post_div_table
= post_div_table_camcc_pll1_out_even
,
129 .num_post_div
= ARRAY_SIZE(post_div_table_camcc_pll1_out_even
),
131 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
132 .clkr
.hw
.init
= &(struct clk_init_data
){
133 .name
= "camcc_pll1_out_even",
134 .parent_hws
= (const struct clk_hw
*[]){
138 .flags
= CLK_SET_RATE_PARENT
,
139 .ops
= &clk_alpha_pll_postdiv_fabia_ops
,
143 /* 1920MHz configuration */
144 static const struct alpha_pll_config camcc_pll2_config
= {
147 .post_div_val
= 0x3 << 8,
148 .post_div_mask
= 0x3 << 8,
149 .aux_output_mask
= BIT(1),
150 .main_output_mask
= BIT(0),
151 .early_output_mask
= BIT(3),
152 .config_ctl_val
= 0x20000800,
153 .config_ctl_hi_val
= 0x400003d2,
154 .test_ctl_val
= 0x04000400,
155 .test_ctl_hi_val
= 0x00004000,
158 static struct clk_alpha_pll camcc_pll2
= {
160 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_AGERA
],
162 .hw
.init
= &(struct clk_init_data
){
163 .name
= "camcc_pll2",
164 .parent_data
= &(const struct clk_parent_data
){
168 .ops
= &clk_alpha_pll_agera_ops
,
173 static struct clk_fixed_factor camcc_pll2_out_early
= {
176 .hw
.init
= &(struct clk_init_data
){
177 .name
= "camcc_pll2_out_early",
178 .parent_hws
= (const struct clk_hw
*[]){
182 .ops
= &clk_fixed_factor_ops
,
186 static const struct clk_div_table post_div_table_camcc_pll2_out_main
[] = {
191 static struct clk_alpha_pll_postdiv camcc_pll2_out_main
= {
194 .post_div_table
= post_div_table_camcc_pll2_out_main
,
195 .num_post_div
= ARRAY_SIZE(post_div_table_camcc_pll2_out_main
),
197 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_AGERA
],
198 .clkr
.hw
.init
= &(struct clk_init_data
){
199 .name
= "camcc_pll2_out_main",
200 .parent_hws
= (const struct clk_hw
*[]){
204 .flags
= CLK_SET_RATE_PARENT
,
205 .ops
= &clk_alpha_pll_postdiv_ops
,
209 /* 384MHz configuration */
210 static const struct alpha_pll_config camcc_pll3_config
= {
213 .config_ctl_val
= 0x20485699,
214 .config_ctl_hi_val
= 0x00002067,
215 .test_ctl_val
= 0x40000000,
216 .test_ctl_hi_val
= 0x00000002,
217 .user_ctl_val
= 0x00000001,
218 .user_ctl_hi_val
= 0x00014805,
221 static struct clk_alpha_pll camcc_pll3
= {
223 .vco_table
= fabia_vco
,
224 .num_vco
= ARRAY_SIZE(fabia_vco
),
225 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_FABIA
],
227 .hw
.init
= &(struct clk_init_data
){
228 .name
= "camcc_pll3",
229 .parent_data
= &(const struct clk_parent_data
){
233 .ops
= &clk_alpha_pll_fabia_ops
,
238 static const struct parent_map camcc_parent_map_0
[] = {
240 { P_CAMCC_PLL0_OUT_EVEN
, 6 },
243 static const struct clk_parent_data camcc_parent_data_0
[] = {
244 { .fw_name
= "bi_tcxo" },
245 { .hw
= &camcc_pll0_out_even
.clkr
.hw
},
248 static const struct parent_map camcc_parent_map_1
[] = {
250 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
251 { P_CAMCC_PLL1_OUT_EVEN
, 3 },
252 { P_CAMCC_PLL2_OUT_MAIN
, 4 },
255 static const struct clk_parent_data camcc_parent_data_1
[] = {
256 { .fw_name
= "bi_tcxo" },
257 { .hw
= &camcc_pll0
.clkr
.hw
},
258 { .hw
= &camcc_pll1_out_even
.clkr
.hw
},
259 { .hw
= &camcc_pll2_out_main
.clkr
.hw
},
262 static const struct parent_map camcc_parent_map_2
[] = {
264 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
265 { P_CAMCC_PLL3_OUT_MAIN
, 5 },
268 static const struct clk_parent_data camcc_parent_data_2
[] = {
269 { .fw_name
= "bi_tcxo" },
270 { .hw
= &camcc_pll0
.clkr
.hw
},
271 { .hw
= &camcc_pll3
.clkr
.hw
},
274 static const struct parent_map camcc_parent_map_3
[] = {
276 { P_CAMCC_PLL2_OUT_EARLY
, 3 },
279 static const struct clk_parent_data camcc_parent_data_3
[] = {
280 { .fw_name
= "bi_tcxo" },
281 { .hw
= &camcc_pll2_out_early
.hw
},
284 static const struct parent_map camcc_parent_map_4
[] = {
286 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
287 { P_CAMCC_PLL1_OUT_EVEN
, 3 },
290 static const struct clk_parent_data camcc_parent_data_4
[] = {
291 { .fw_name
= "bi_tcxo" },
292 { .hw
= &camcc_pll0
.clkr
.hw
},
293 { .hw
= &camcc_pll1_out_even
.clkr
.hw
},
296 static const struct parent_map camcc_parent_map_5
[] = {
298 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
299 { P_CAMCC_PLL1_OUT_EVEN
, 3 },
300 { P_CAMCC_PLL3_OUT_MAIN
, 5 },
303 static const struct clk_parent_data camcc_parent_data_5
[] = {
304 { .fw_name
= "bi_tcxo" },
305 { .hw
= &camcc_pll0
.clkr
.hw
},
306 { .hw
= &camcc_pll1_out_even
.clkr
.hw
},
307 { .hw
= &camcc_pll3
.clkr
.hw
},
310 static const struct parent_map camcc_parent_map_6
[] = {
312 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
313 { P_CAMCC_PLL2_OUT_MAIN
, 4 },
316 static const struct clk_parent_data camcc_parent_data_6
[] = {
317 { .fw_name
= "bi_tcxo" },
318 { .hw
= &camcc_pll0
.clkr
.hw
},
319 { .hw
= &camcc_pll2_out_main
.clkr
.hw
},
322 static const struct parent_map camcc_parent_map_7
[] = {
324 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
325 { P_CAMCC_PLL1_OUT_MAIN
, 2 },
326 { P_CAMCC_PLL2_OUT_MAIN
, 4 },
329 static const struct clk_parent_data camcc_parent_data_7
[] = {
330 { .fw_name
= "bi_tcxo" },
331 { .hw
= &camcc_pll0
.clkr
.hw
},
332 { .hw
= &camcc_pll1
.clkr
.hw
},
333 { .hw
= &camcc_pll2_out_main
.clkr
.hw
},
336 static const struct parent_map camcc_parent_map_8
[] = {
338 { P_CAMCC_PLL0_OUT_MAIN
, 1 },
339 { P_CAMCC_PLL1_OUT_MAIN
, 2 },
342 static const struct clk_parent_data camcc_parent_data_8
[] = {
343 { .fw_name
= "bi_tcxo" },
344 { .hw
= &camcc_pll0
.clkr
.hw
},
345 { .hw
= &camcc_pll1
.clkr
.hw
},
348 static const struct parent_map camcc_parent_map_9
[] = {
350 { P_CAMCC_PLL2_OUT_MAIN
, 4 },
353 static const struct clk_parent_data camcc_parent_data_9
[] = {
354 { .fw_name
= "bi_tcxo" },
355 { .hw
= &camcc_pll2_out_main
.clkr
.hw
},
358 static const struct freq_tbl ftbl_camcc_bps_clk_src
[] = {
359 F(200000000, P_CAMCC_PLL0_OUT_MAIN
, 3, 0, 0),
360 F(320000000, P_CAMCC_PLL2_OUT_MAIN
, 1.5, 0, 0),
361 F(404000000, P_CAMCC_PLL1_OUT_EVEN
, 1, 0, 0),
362 F(480000000, P_CAMCC_PLL2_OUT_MAIN
, 1, 0, 0),
363 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
367 static struct clk_rcg2 camcc_bps_clk_src
= {
371 .parent_map
= camcc_parent_map_1
,
372 .freq_tbl
= ftbl_camcc_bps_clk_src
,
373 .clkr
.hw
.init
= &(struct clk_init_data
){
374 .name
= "camcc_bps_clk_src",
375 .parent_data
= camcc_parent_data_1
,
376 .num_parents
= ARRAY_SIZE(camcc_parent_data_1
),
377 .ops
= &clk_rcg2_ops
,
381 static const struct freq_tbl ftbl_camcc_cci_0_clk_src
[] = {
382 F(37500000, P_CAMCC_PLL0_OUT_EVEN
, 8, 0, 0),
383 F(50000000, P_CAMCC_PLL0_OUT_EVEN
, 6, 0, 0),
384 F(100000000, P_CAMCC_PLL0_OUT_EVEN
, 3, 0, 0),
388 static struct clk_rcg2 camcc_cci_0_clk_src
= {
392 .parent_map
= camcc_parent_map_0
,
393 .freq_tbl
= ftbl_camcc_cci_0_clk_src
,
394 .clkr
.hw
.init
= &(struct clk_init_data
){
395 .name
= "camcc_cci_0_clk_src",
396 .parent_data
= camcc_parent_data_0
,
397 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
398 .ops
= &clk_rcg2_ops
,
402 static struct clk_rcg2 camcc_cci_1_clk_src
= {
406 .parent_map
= camcc_parent_map_0
,
407 .freq_tbl
= ftbl_camcc_cci_0_clk_src
,
408 .clkr
.hw
.init
= &(struct clk_init_data
){
409 .name
= "camcc_cci_1_clk_src",
410 .parent_data
= camcc_parent_data_0
,
411 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
412 .ops
= &clk_rcg2_ops
,
416 static const struct freq_tbl ftbl_camcc_cphy_rx_clk_src
[] = {
417 F(150000000, P_CAMCC_PLL0_OUT_MAIN
, 4, 0, 0),
418 F(300000000, P_CAMCC_PLL0_OUT_MAIN
, 2, 0, 0),
419 F(384000000, P_CAMCC_PLL3_OUT_MAIN
, 1, 0, 0),
420 F(400000000, P_CAMCC_PLL0_OUT_MAIN
, 1.5, 0, 0),
424 static struct clk_rcg2 camcc_cphy_rx_clk_src
= {
428 .parent_map
= camcc_parent_map_2
,
429 .freq_tbl
= ftbl_camcc_cphy_rx_clk_src
,
430 .clkr
.hw
.init
= &(struct clk_init_data
){
431 .name
= "camcc_cphy_rx_clk_src",
432 .parent_data
= camcc_parent_data_2
,
433 .num_parents
= ARRAY_SIZE(camcc_parent_data_2
),
434 .ops
= &clk_rcg2_ops
,
438 static const struct freq_tbl ftbl_camcc_csi0phytimer_clk_src
[] = {
439 F(300000000, P_CAMCC_PLL0_OUT_EVEN
, 1, 0, 0),
443 static struct clk_rcg2 camcc_csi0phytimer_clk_src
= {
447 .parent_map
= camcc_parent_map_0
,
448 .freq_tbl
= ftbl_camcc_csi0phytimer_clk_src
,
449 .clkr
.hw
.init
= &(struct clk_init_data
){
450 .name
= "camcc_csi0phytimer_clk_src",
451 .parent_data
= camcc_parent_data_0
,
452 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
453 .ops
= &clk_rcg2_ops
,
457 static struct clk_rcg2 camcc_csi1phytimer_clk_src
= {
461 .parent_map
= camcc_parent_map_0
,
462 .freq_tbl
= ftbl_camcc_csi0phytimer_clk_src
,
463 .clkr
.hw
.init
= &(struct clk_init_data
){
464 .name
= "camcc_csi1phytimer_clk_src",
465 .parent_data
= camcc_parent_data_0
,
466 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
467 .ops
= &clk_rcg2_ops
,
471 static struct clk_rcg2 camcc_csi2phytimer_clk_src
= {
475 .parent_map
= camcc_parent_map_0
,
476 .freq_tbl
= ftbl_camcc_csi0phytimer_clk_src
,
477 .clkr
.hw
.init
= &(struct clk_init_data
){
478 .name
= "camcc_csi2phytimer_clk_src",
479 .parent_data
= camcc_parent_data_0
,
480 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
481 .ops
= &clk_rcg2_ops
,
485 static struct clk_rcg2 camcc_csi3phytimer_clk_src
= {
489 .parent_map
= camcc_parent_map_0
,
490 .freq_tbl
= ftbl_camcc_csi0phytimer_clk_src
,
491 .clkr
.hw
.init
= &(struct clk_init_data
){
492 .name
= "camcc_csi3phytimer_clk_src",
493 .parent_data
= camcc_parent_data_0
,
494 .num_parents
= ARRAY_SIZE(camcc_parent_data_0
),
495 .ops
= &clk_rcg2_ops
,
499 static const struct freq_tbl ftbl_camcc_fast_ahb_clk_src
[] = {
500 F(100000000, P_CAMCC_PLL0_OUT_MAIN
, 6, 0, 0),
501 F(200000000, P_CAMCC_PLL0_OUT_MAIN
, 3, 0, 0),
502 F(300000000, P_CAMCC_PLL0_OUT_MAIN
, 2, 0, 0),
503 F(404000000, P_CAMCC_PLL1_OUT_EVEN
, 1, 0, 0),
507 static struct clk_rcg2 camcc_fast_ahb_clk_src
= {
511 .parent_map
= camcc_parent_map_4
,
512 .freq_tbl
= ftbl_camcc_fast_ahb_clk_src
,
513 .clkr
.hw
.init
= &(struct clk_init_data
){
514 .name
= "camcc_fast_ahb_clk_src",
515 .parent_data
= camcc_parent_data_4
,
516 .num_parents
= ARRAY_SIZE(camcc_parent_data_4
),
517 .ops
= &clk_rcg2_ops
,
521 static const struct freq_tbl ftbl_camcc_icp_clk_src
[] = {
522 F(240000000, P_CAMCC_PLL0_OUT_MAIN
, 2.5, 0, 0),
523 F(384000000, P_CAMCC_PLL3_OUT_MAIN
, 1, 0, 0),
524 F(404000000, P_CAMCC_PLL1_OUT_EVEN
, 1, 0, 0),
525 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
529 static struct clk_rcg2 camcc_icp_clk_src
= {
533 .parent_map
= camcc_parent_map_5
,
534 .freq_tbl
= ftbl_camcc_icp_clk_src
,
535 .clkr
.hw
.init
= &(struct clk_init_data
){
536 .name
= "camcc_icp_clk_src",
537 .parent_data
= camcc_parent_data_5
,
538 .num_parents
= ARRAY_SIZE(camcc_parent_data_5
),
539 .ops
= &clk_rcg2_ops
,
543 static const struct freq_tbl ftbl_camcc_ife_0_clk_src
[] = {
544 F(240000000, P_CAMCC_PLL0_OUT_MAIN
, 2.5, 0, 0),
545 F(320000000, P_CAMCC_PLL2_OUT_MAIN
, 1.5, 0, 0),
546 F(404000000, P_CAMCC_PLL1_OUT_EVEN
, 1, 0, 0),
547 F(480000000, P_CAMCC_PLL2_OUT_MAIN
, 1, 0, 0),
548 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
552 static struct clk_rcg2 camcc_ife_0_clk_src
= {
556 .parent_map
= camcc_parent_map_1
,
557 .freq_tbl
= ftbl_camcc_ife_0_clk_src
,
558 .clkr
.hw
.init
= &(struct clk_init_data
){
559 .name
= "camcc_ife_0_clk_src",
560 .parent_data
= camcc_parent_data_1
,
561 .num_parents
= ARRAY_SIZE(camcc_parent_data_1
),
562 .flags
= CLK_SET_RATE_PARENT
,
563 .ops
= &clk_rcg2_ops
,
567 static struct clk_rcg2 camcc_ife_0_csid_clk_src
= {
571 .parent_map
= camcc_parent_map_2
,
572 .freq_tbl
= ftbl_camcc_cphy_rx_clk_src
,
573 .clkr
.hw
.init
= &(struct clk_init_data
){
574 .name
= "camcc_ife_0_csid_clk_src",
575 .parent_data
= camcc_parent_data_2
,
576 .num_parents
= ARRAY_SIZE(camcc_parent_data_2
),
577 .ops
= &clk_rcg2_ops
,
581 static struct clk_rcg2 camcc_ife_1_clk_src
= {
585 .parent_map
= camcc_parent_map_1
,
586 .freq_tbl
= ftbl_camcc_ife_0_clk_src
,
587 .clkr
.hw
.init
= &(struct clk_init_data
){
588 .name
= "camcc_ife_1_clk_src",
589 .parent_data
= camcc_parent_data_1
,
590 .num_parents
= ARRAY_SIZE(camcc_parent_data_1
),
591 .flags
= CLK_SET_RATE_PARENT
,
592 .ops
= &clk_rcg2_ops
,
596 static struct clk_rcg2 camcc_ife_1_csid_clk_src
= {
600 .parent_map
= camcc_parent_map_2
,
601 .freq_tbl
= ftbl_camcc_cphy_rx_clk_src
,
602 .clkr
.hw
.init
= &(struct clk_init_data
){
603 .name
= "camcc_ife_1_csid_clk_src",
604 .parent_data
= camcc_parent_data_2
,
605 .num_parents
= ARRAY_SIZE(camcc_parent_data_2
),
606 .ops
= &clk_rcg2_ops
,
610 static struct clk_rcg2 camcc_ife_2_clk_src
= {
614 .parent_map
= camcc_parent_map_1
,
615 .freq_tbl
= ftbl_camcc_ife_0_clk_src
,
616 .clkr
.hw
.init
= &(struct clk_init_data
){
617 .name
= "camcc_ife_2_clk_src",
618 .parent_data
= camcc_parent_data_1
,
619 .num_parents
= ARRAY_SIZE(camcc_parent_data_1
),
620 .ops
= &clk_rcg2_ops
,
624 static struct clk_rcg2 camcc_ife_2_csid_clk_src
= {
628 .parent_map
= camcc_parent_map_2
,
629 .freq_tbl
= ftbl_camcc_cphy_rx_clk_src
,
630 .clkr
.hw
.init
= &(struct clk_init_data
){
631 .name
= "camcc_ife_2_csid_clk_src",
632 .parent_data
= camcc_parent_data_2
,
633 .num_parents
= ARRAY_SIZE(camcc_parent_data_2
),
634 .ops
= &clk_rcg2_ops
,
638 static const struct freq_tbl ftbl_camcc_ife_lite_clk_src
[] = {
639 F(320000000, P_CAMCC_PLL2_OUT_MAIN
, 1.5, 0, 0),
640 F(400000000, P_CAMCC_PLL0_OUT_MAIN
, 1.5, 0, 0),
641 F(480000000, P_CAMCC_PLL2_OUT_MAIN
, 1, 0, 0),
642 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
646 static struct clk_rcg2 camcc_ife_lite_clk_src
= {
650 .parent_map
= camcc_parent_map_6
,
651 .freq_tbl
= ftbl_camcc_ife_lite_clk_src
,
652 .clkr
.hw
.init
= &(struct clk_init_data
){
653 .name
= "camcc_ife_lite_clk_src",
654 .parent_data
= camcc_parent_data_6
,
655 .num_parents
= ARRAY_SIZE(camcc_parent_data_6
),
656 .ops
= &clk_rcg2_ops
,
660 static struct clk_rcg2 camcc_ife_lite_csid_clk_src
= {
664 .parent_map
= camcc_parent_map_2
,
665 .freq_tbl
= ftbl_camcc_cphy_rx_clk_src
,
666 .clkr
.hw
.init
= &(struct clk_init_data
){
667 .name
= "camcc_ife_lite_csid_clk_src",
668 .parent_data
= camcc_parent_data_2
,
669 .num_parents
= ARRAY_SIZE(camcc_parent_data_2
),
670 .ops
= &clk_rcg2_ops
,
674 static const struct freq_tbl ftbl_camcc_ipe_0_clk_src
[] = {
675 F(240000000, P_CAMCC_PLL2_OUT_MAIN
, 2, 0, 0),
676 F(320000000, P_CAMCC_PLL2_OUT_MAIN
, 1.5, 0, 0),
677 F(404000000, P_CAMCC_PLL1_OUT_MAIN
, 2, 0, 0),
678 F(538666667, P_CAMCC_PLL1_OUT_MAIN
, 1.5, 0, 0),
679 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
683 static struct clk_rcg2 camcc_ipe_0_clk_src
= {
687 .parent_map
= camcc_parent_map_7
,
688 .freq_tbl
= ftbl_camcc_ipe_0_clk_src
,
689 .clkr
.hw
.init
= &(struct clk_init_data
){
690 .name
= "camcc_ipe_0_clk_src",
691 .parent_data
= camcc_parent_data_7
,
692 .num_parents
= ARRAY_SIZE(camcc_parent_data_7
),
693 .flags
= CLK_SET_RATE_PARENT
,
694 .ops
= &clk_rcg2_ops
,
698 static const struct freq_tbl ftbl_camcc_jpeg_clk_src
[] = {
699 F(66666667, P_CAMCC_PLL0_OUT_MAIN
, 9, 0, 0),
700 F(133333333, P_CAMCC_PLL0_OUT_MAIN
, 4.5, 0, 0),
701 F(200000000, P_CAMCC_PLL0_OUT_MAIN
, 3, 0, 0),
702 F(404000000, P_CAMCC_PLL1_OUT_EVEN
, 1, 0, 0),
703 F(480000000, P_CAMCC_PLL2_OUT_MAIN
, 1, 0, 0),
704 F(600000000, P_CAMCC_PLL0_OUT_MAIN
, 1, 0, 0),
708 static struct clk_rcg2 camcc_jpeg_clk_src
= {
712 .parent_map
= camcc_parent_map_1
,
713 .freq_tbl
= ftbl_camcc_jpeg_clk_src
,
714 .clkr
.hw
.init
= &(struct clk_init_data
){
715 .name
= "camcc_jpeg_clk_src",
716 .parent_data
= camcc_parent_data_1
,
717 .num_parents
= ARRAY_SIZE(camcc_parent_data_1
),
718 .ops
= &clk_rcg2_ops
,
722 static const struct freq_tbl ftbl_camcc_lrme_clk_src
[] = {
723 F(200000000, P_CAMCC_PLL0_OUT_MAIN
, 3, 0, 0),
724 F(269333333, P_CAMCC_PLL1_OUT_MAIN
, 3, 0, 0),
725 F(323200000, P_CAMCC_PLL1_OUT_MAIN
, 2.5, 0, 0),
726 F(404000000, P_CAMCC_PLL1_OUT_MAIN
, 2, 0, 0),
730 static struct clk_rcg2 camcc_lrme_clk_src
= {
734 .parent_map
= camcc_parent_map_8
,
735 .freq_tbl
= ftbl_camcc_lrme_clk_src
,
736 .clkr
.hw
.init
= &(struct clk_init_data
){
737 .name
= "camcc_lrme_clk_src",
738 .parent_data
= camcc_parent_data_8
,
739 .num_parents
= ARRAY_SIZE(camcc_parent_data_8
),
740 .ops
= &clk_rcg2_ops
,
744 static const struct freq_tbl ftbl_camcc_mclk0_clk_src
[] = {
745 F(19200000, P_CAMCC_PLL2_OUT_EARLY
, 1, 1, 50),
746 F(24000000, P_CAMCC_PLL2_OUT_EARLY
, 10, 1, 4),
747 F(64000000, P_CAMCC_PLL2_OUT_EARLY
, 15, 0, 0),
751 static struct clk_rcg2 camcc_mclk0_clk_src
= {
755 .parent_map
= camcc_parent_map_3
,
756 .freq_tbl
= ftbl_camcc_mclk0_clk_src
,
757 .clkr
.hw
.init
= &(struct clk_init_data
){
758 .name
= "camcc_mclk0_clk_src",
759 .parent_data
= camcc_parent_data_3
,
760 .num_parents
= ARRAY_SIZE(camcc_parent_data_3
),
761 .ops
= &clk_rcg2_ops
,
765 static struct clk_rcg2 camcc_mclk1_clk_src
= {
769 .parent_map
= camcc_parent_map_3
,
770 .freq_tbl
= ftbl_camcc_mclk0_clk_src
,
771 .clkr
.hw
.init
= &(struct clk_init_data
){
772 .name
= "camcc_mclk1_clk_src",
773 .parent_data
= camcc_parent_data_3
,
774 .num_parents
= ARRAY_SIZE(camcc_parent_data_3
),
775 .ops
= &clk_rcg2_ops
,
779 static struct clk_rcg2 camcc_mclk2_clk_src
= {
783 .parent_map
= camcc_parent_map_3
,
784 .freq_tbl
= ftbl_camcc_mclk0_clk_src
,
785 .clkr
.hw
.init
= &(struct clk_init_data
){
786 .name
= "camcc_mclk2_clk_src",
787 .parent_data
= camcc_parent_data_3
,
788 .num_parents
= ARRAY_SIZE(camcc_parent_data_3
),
789 .ops
= &clk_rcg2_ops
,
793 static struct clk_rcg2 camcc_mclk3_clk_src
= {
797 .parent_map
= camcc_parent_map_3
,
798 .freq_tbl
= ftbl_camcc_mclk0_clk_src
,
799 .clkr
.hw
.init
= &(struct clk_init_data
){
800 .name
= "camcc_mclk3_clk_src",
801 .parent_data
= camcc_parent_data_3
,
802 .num_parents
= ARRAY_SIZE(camcc_parent_data_3
),
803 .ops
= &clk_rcg2_ops
,
807 static struct clk_rcg2 camcc_mclk4_clk_src
= {
811 .parent_map
= camcc_parent_map_3
,
812 .freq_tbl
= ftbl_camcc_mclk0_clk_src
,
813 .clkr
.hw
.init
= &(struct clk_init_data
){
814 .name
= "camcc_mclk4_clk_src",
815 .parent_data
= camcc_parent_data_3
,
816 .num_parents
= ARRAY_SIZE(camcc_parent_data_3
),
817 .ops
= &clk_rcg2_ops
,
821 static const struct freq_tbl ftbl_camcc_slow_ahb_clk_src
[] = {
822 F(80000000, P_CAMCC_PLL2_OUT_MAIN
, 6, 0, 0),
826 static struct clk_rcg2 camcc_slow_ahb_clk_src
= {
830 .parent_map
= camcc_parent_map_9
,
831 .freq_tbl
= ftbl_camcc_slow_ahb_clk_src
,
832 .clkr
.hw
.init
= &(struct clk_init_data
){
833 .name
= "camcc_slow_ahb_clk_src",
834 .parent_data
= camcc_parent_data_9
,
835 .num_parents
= ARRAY_SIZE(camcc_parent_data_9
),
836 .ops
= &clk_rcg2_ops
,
840 static struct clk_branch camcc_bps_ahb_clk
= {
842 .halt_check
= BRANCH_HALT
,
844 .enable_reg
= 0x6070,
845 .enable_mask
= BIT(0),
846 .hw
.init
= &(struct clk_init_data
){
847 .name
= "camcc_bps_ahb_clk",
848 .parent_hws
= (const struct clk_hw
*[]){
849 &camcc_slow_ahb_clk_src
.clkr
.hw
852 .flags
= CLK_SET_RATE_PARENT
,
853 .ops
= &clk_branch2_ops
,
858 static struct clk_branch camcc_bps_areg_clk
= {
860 .halt_check
= BRANCH_HALT
,
862 .enable_reg
= 0x6054,
863 .enable_mask
= BIT(0),
864 .hw
.init
= &(struct clk_init_data
){
865 .name
= "camcc_bps_areg_clk",
866 .parent_hws
= (const struct clk_hw
*[]){
867 &camcc_fast_ahb_clk_src
.clkr
.hw
870 .flags
= CLK_SET_RATE_PARENT
,
871 .ops
= &clk_branch2_ops
,
876 static struct clk_branch camcc_bps_axi_clk
= {
878 .halt_check
= BRANCH_HALT
,
880 .enable_reg
= 0x6038,
881 .enable_mask
= BIT(0),
882 .hw
.init
= &(struct clk_init_data
){
883 .name
= "camcc_bps_axi_clk",
884 .ops
= &clk_branch2_ops
,
889 static struct clk_branch camcc_bps_clk
= {
891 .halt_check
= BRANCH_HALT
,
893 .enable_reg
= 0x6028,
894 .enable_mask
= BIT(0),
895 .hw
.init
= &(struct clk_init_data
){
896 .name
= "camcc_bps_clk",
897 .parent_hws
= (const struct clk_hw
*[]){
898 &camcc_bps_clk_src
.clkr
.hw
901 .flags
= CLK_SET_RATE_PARENT
,
902 .ops
= &clk_branch2_ops
,
907 static struct clk_branch camcc_camnoc_axi_clk
= {
909 .halt_check
= BRANCH_HALT
,
911 .enable_reg
= 0x13004,
912 .enable_mask
= BIT(0),
913 .hw
.init
= &(struct clk_init_data
){
914 .name
= "camcc_camnoc_axi_clk",
915 .ops
= &clk_branch2_ops
,
920 static struct clk_branch camcc_cci_0_clk
= {
922 .halt_check
= BRANCH_HALT
,
924 .enable_reg
= 0xf01c,
925 .enable_mask
= BIT(0),
926 .hw
.init
= &(struct clk_init_data
){
927 .name
= "camcc_cci_0_clk",
928 .parent_hws
= (const struct clk_hw
*[]){
929 &camcc_cci_0_clk_src
.clkr
.hw
932 .flags
= CLK_SET_RATE_PARENT
,
933 .ops
= &clk_branch2_ops
,
938 static struct clk_branch camcc_cci_1_clk
= {
940 .halt_check
= BRANCH_HALT
,
942 .enable_reg
= 0x1001c,
943 .enable_mask
= BIT(0),
944 .hw
.init
= &(struct clk_init_data
){
945 .name
= "camcc_cci_1_clk",
946 .parent_hws
= (const struct clk_hw
*[]){
947 &camcc_cci_1_clk_src
.clkr
.hw
950 .flags
= CLK_SET_RATE_PARENT
,
951 .ops
= &clk_branch2_ops
,
956 static struct clk_branch camcc_core_ahb_clk
= {
958 .halt_check
= BRANCH_HALT_VOTED
,
960 .enable_reg
= 0x14010,
961 .enable_mask
= BIT(0),
962 .hw
.init
= &(struct clk_init_data
){
963 .name
= "camcc_core_ahb_clk",
964 .parent_hws
= (const struct clk_hw
*[]){
965 &camcc_slow_ahb_clk_src
.clkr
.hw
968 .flags
= CLK_SET_RATE_PARENT
,
969 .ops
= &clk_branch2_ops
,
974 static struct clk_branch camcc_cpas_ahb_clk
= {
976 .halt_check
= BRANCH_HALT
,
978 .enable_reg
= 0x12004,
979 .enable_mask
= BIT(0),
980 .hw
.init
= &(struct clk_init_data
){
981 .name
= "camcc_cpas_ahb_clk",
982 .parent_hws
= (const struct clk_hw
*[]){
983 &camcc_slow_ahb_clk_src
.clkr
.hw
986 .flags
= CLK_SET_RATE_PARENT
,
987 .ops
= &clk_branch2_ops
,
992 static struct clk_branch camcc_csi0phytimer_clk
= {
994 .halt_check
= BRANCH_HALT
,
996 .enable_reg
= 0x501c,
997 .enable_mask
= BIT(0),
998 .hw
.init
= &(struct clk_init_data
){
999 .name
= "camcc_csi0phytimer_clk",
1000 .parent_hws
= (const struct clk_hw
*[]){
1001 &camcc_csi0phytimer_clk_src
.clkr
.hw
1004 .flags
= CLK_SET_RATE_PARENT
,
1005 .ops
= &clk_branch2_ops
,
1010 static struct clk_branch camcc_csi1phytimer_clk
= {
1012 .halt_check
= BRANCH_HALT
,
1014 .enable_reg
= 0x5040,
1015 .enable_mask
= BIT(0),
1016 .hw
.init
= &(struct clk_init_data
){
1017 .name
= "camcc_csi1phytimer_clk",
1018 .parent_hws
= (const struct clk_hw
*[]){
1019 &camcc_csi1phytimer_clk_src
.clkr
.hw
1022 .flags
= CLK_SET_RATE_PARENT
,
1023 .ops
= &clk_branch2_ops
,
1028 static struct clk_branch camcc_csi2phytimer_clk
= {
1030 .halt_check
= BRANCH_HALT
,
1032 .enable_reg
= 0x5064,
1033 .enable_mask
= BIT(0),
1034 .hw
.init
= &(struct clk_init_data
){
1035 .name
= "camcc_csi2phytimer_clk",
1036 .parent_hws
= (const struct clk_hw
*[]){
1037 &camcc_csi2phytimer_clk_src
.clkr
.hw
1040 .flags
= CLK_SET_RATE_PARENT
,
1041 .ops
= &clk_branch2_ops
,
1046 static struct clk_branch camcc_csi3phytimer_clk
= {
1048 .halt_check
= BRANCH_HALT
,
1050 .enable_reg
= 0x5088,
1051 .enable_mask
= BIT(0),
1052 .hw
.init
= &(struct clk_init_data
){
1053 .name
= "camcc_csi3phytimer_clk",
1054 .parent_hws
= (const struct clk_hw
*[]){
1055 &camcc_csi3phytimer_clk_src
.clkr
.hw
1058 .flags
= CLK_SET_RATE_PARENT
,
1059 .ops
= &clk_branch2_ops
,
1064 static struct clk_branch camcc_csiphy0_clk
= {
1066 .halt_check
= BRANCH_HALT
,
1068 .enable_reg
= 0x5020,
1069 .enable_mask
= BIT(0),
1070 .hw
.init
= &(struct clk_init_data
){
1071 .name
= "camcc_csiphy0_clk",
1072 .parent_hws
= (const struct clk_hw
*[]){
1073 &camcc_cphy_rx_clk_src
.clkr
.hw
1076 .flags
= CLK_SET_RATE_PARENT
,
1077 .ops
= &clk_branch2_ops
,
1082 static struct clk_branch camcc_csiphy1_clk
= {
1084 .halt_check
= BRANCH_HALT
,
1086 .enable_reg
= 0x5044,
1087 .enable_mask
= BIT(0),
1088 .hw
.init
= &(struct clk_init_data
){
1089 .name
= "camcc_csiphy1_clk",
1090 .parent_hws
= (const struct clk_hw
*[]){
1091 &camcc_cphy_rx_clk_src
.clkr
.hw
1094 .flags
= CLK_SET_RATE_PARENT
,
1095 .ops
= &clk_branch2_ops
,
1100 static struct clk_branch camcc_csiphy2_clk
= {
1102 .halt_check
= BRANCH_HALT
,
1104 .enable_reg
= 0x5068,
1105 .enable_mask
= BIT(0),
1106 .hw
.init
= &(struct clk_init_data
){
1107 .name
= "camcc_csiphy2_clk",
1108 .parent_hws
= (const struct clk_hw
*[]){
1109 &camcc_cphy_rx_clk_src
.clkr
.hw
1112 .flags
= CLK_SET_RATE_PARENT
,
1113 .ops
= &clk_branch2_ops
,
1118 static struct clk_branch camcc_csiphy3_clk
= {
1120 .halt_check
= BRANCH_HALT
,
1122 .enable_reg
= 0x508c,
1123 .enable_mask
= BIT(0),
1124 .hw
.init
= &(struct clk_init_data
){
1125 .name
= "camcc_csiphy3_clk",
1126 .parent_hws
= (const struct clk_hw
*[]){
1127 &camcc_cphy_rx_clk_src
.clkr
.hw
1130 .flags
= CLK_SET_RATE_PARENT
,
1131 .ops
= &clk_branch2_ops
,
1136 static struct clk_branch camcc_icp_clk
= {
1138 .halt_check
= BRANCH_HALT
,
1140 .enable_reg
= 0xe02c,
1141 .enable_mask
= BIT(0),
1142 .hw
.init
= &(struct clk_init_data
){
1143 .name
= "camcc_icp_clk",
1144 .parent_hws
= (const struct clk_hw
*[]){
1145 &camcc_icp_clk_src
.clkr
.hw
1148 .flags
= CLK_SET_RATE_PARENT
,
1149 .ops
= &clk_branch2_ops
,
1154 static struct clk_branch camcc_icp_ts_clk
= {
1156 .halt_check
= BRANCH_HALT
,
1158 .enable_reg
= 0xe00c,
1159 .enable_mask
= BIT(0),
1160 .hw
.init
= &(struct clk_init_data
){
1161 .name
= "camcc_icp_ts_clk",
1162 .ops
= &clk_branch2_ops
,
1167 static struct clk_branch camcc_ife_0_axi_clk
= {
1169 .halt_check
= BRANCH_HALT
,
1171 .enable_reg
= 0x9080,
1172 .enable_mask
= BIT(0),
1173 .hw
.init
= &(struct clk_init_data
){
1174 .name
= "camcc_ife_0_axi_clk",
1175 .ops
= &clk_branch2_ops
,
1180 static struct clk_branch camcc_ife_0_clk
= {
1182 .halt_check
= BRANCH_HALT
,
1184 .enable_reg
= 0x9028,
1185 .enable_mask
= BIT(0),
1186 .hw
.init
= &(struct clk_init_data
){
1187 .name
= "camcc_ife_0_clk",
1188 .parent_hws
= (const struct clk_hw
*[]){
1189 &camcc_ife_0_clk_src
.clkr
.hw
1192 .flags
= CLK_SET_RATE_PARENT
,
1193 .ops
= &clk_branch2_ops
,
1198 static struct clk_branch camcc_ife_0_cphy_rx_clk
= {
1200 .halt_check
= BRANCH_HALT
,
1202 .enable_reg
= 0x907c,
1203 .enable_mask
= BIT(0),
1204 .hw
.init
= &(struct clk_init_data
){
1205 .name
= "camcc_ife_0_cphy_rx_clk",
1206 .parent_hws
= (const struct clk_hw
*[]){
1207 &camcc_cphy_rx_clk_src
.clkr
.hw
1210 .flags
= CLK_SET_RATE_PARENT
,
1211 .ops
= &clk_branch2_ops
,
1216 static struct clk_branch camcc_ife_0_csid_clk
= {
1218 .halt_check
= BRANCH_HALT
,
1220 .enable_reg
= 0x9054,
1221 .enable_mask
= BIT(0),
1222 .hw
.init
= &(struct clk_init_data
){
1223 .name
= "camcc_ife_0_csid_clk",
1224 .parent_hws
= (const struct clk_hw
*[]){
1225 &camcc_ife_0_csid_clk_src
.clkr
.hw
1228 .flags
= CLK_SET_RATE_PARENT
,
1229 .ops
= &clk_branch2_ops
,
1234 static struct clk_branch camcc_ife_0_dsp_clk
= {
1236 .halt_check
= BRANCH_HALT
,
1238 .enable_reg
= 0x9038,
1239 .enable_mask
= BIT(0),
1240 .hw
.init
= &(struct clk_init_data
){
1241 .name
= "camcc_ife_0_dsp_clk",
1242 .parent_hws
= (const struct clk_hw
*[]){
1243 &camcc_ife_0_clk_src
.clkr
.hw
1246 .flags
= CLK_SET_RATE_PARENT
,
1247 .ops
= &clk_branch2_ops
,
1252 static struct clk_branch camcc_ife_1_axi_clk
= {
1254 .halt_check
= BRANCH_HALT
,
1256 .enable_reg
= 0xa058,
1257 .enable_mask
= BIT(0),
1258 .hw
.init
= &(struct clk_init_data
){
1259 .name
= "camcc_ife_1_axi_clk",
1260 .ops
= &clk_branch2_ops
,
1265 static struct clk_branch camcc_ife_1_clk
= {
1267 .halt_check
= BRANCH_HALT
,
1269 .enable_reg
= 0xa028,
1270 .enable_mask
= BIT(0),
1271 .hw
.init
= &(struct clk_init_data
){
1272 .name
= "camcc_ife_1_clk",
1273 .parent_hws
= (const struct clk_hw
*[]){
1274 &camcc_ife_1_clk_src
.clkr
.hw
1277 .flags
= CLK_SET_RATE_PARENT
,
1278 .ops
= &clk_branch2_ops
,
1283 static struct clk_branch camcc_ife_1_cphy_rx_clk
= {
1285 .halt_check
= BRANCH_HALT
,
1287 .enable_reg
= 0xa054,
1288 .enable_mask
= BIT(0),
1289 .hw
.init
= &(struct clk_init_data
){
1290 .name
= "camcc_ife_1_cphy_rx_clk",
1291 .parent_hws
= (const struct clk_hw
*[]){
1292 &camcc_cphy_rx_clk_src
.clkr
.hw
1295 .flags
= CLK_SET_RATE_PARENT
,
1296 .ops
= &clk_branch2_ops
,
1301 static struct clk_branch camcc_ife_1_csid_clk
= {
1303 .halt_check
= BRANCH_HALT
,
1305 .enable_reg
= 0xa04c,
1306 .enable_mask
= BIT(0),
1307 .hw
.init
= &(struct clk_init_data
){
1308 .name
= "camcc_ife_1_csid_clk",
1309 .parent_hws
= (const struct clk_hw
*[]){
1310 &camcc_ife_1_csid_clk_src
.clkr
.hw
1313 .flags
= CLK_SET_RATE_PARENT
,
1314 .ops
= &clk_branch2_ops
,
1319 static struct clk_branch camcc_ife_1_dsp_clk
= {
1321 .halt_check
= BRANCH_HALT
,
1323 .enable_reg
= 0xa030,
1324 .enable_mask
= BIT(0),
1325 .hw
.init
= &(struct clk_init_data
){
1326 .name
= "camcc_ife_1_dsp_clk",
1327 .parent_hws
= (const struct clk_hw
*[]){
1328 &camcc_ife_1_clk_src
.clkr
.hw
1331 .flags
= CLK_SET_RATE_PARENT
,
1332 .ops
= &clk_branch2_ops
,
1337 static struct clk_branch camcc_ife_2_axi_clk
= {
1339 .halt_check
= BRANCH_HALT
,
1341 .enable_reg
= 0xb054,
1342 .enable_mask
= BIT(0),
1343 .hw
.init
= &(struct clk_init_data
){
1344 .name
= "camcc_ife_2_axi_clk",
1345 .ops
= &clk_branch2_ops
,
1350 static struct clk_branch camcc_ife_2_clk
= {
1352 .halt_check
= BRANCH_HALT
,
1354 .enable_reg
= 0xb024,
1355 .enable_mask
= BIT(0),
1356 .hw
.init
= &(struct clk_init_data
){
1357 .name
= "camcc_ife_2_clk",
1358 .parent_hws
= (const struct clk_hw
*[]){
1359 &camcc_ife_2_clk_src
.clkr
.hw
1362 .flags
= CLK_SET_RATE_PARENT
,
1363 .ops
= &clk_branch2_ops
,
1368 static struct clk_branch camcc_ife_2_cphy_rx_clk
= {
1370 .halt_check
= BRANCH_HALT
,
1372 .enable_reg
= 0xb050,
1373 .enable_mask
= BIT(0),
1374 .hw
.init
= &(struct clk_init_data
){
1375 .name
= "camcc_ife_2_cphy_rx_clk",
1376 .parent_hws
= (const struct clk_hw
*[]){
1377 &camcc_cphy_rx_clk_src
.clkr
.hw
1380 .flags
= CLK_SET_RATE_PARENT
,
1381 .ops
= &clk_branch2_ops
,
1386 static struct clk_branch camcc_ife_2_csid_clk
= {
1388 .halt_check
= BRANCH_HALT
,
1390 .enable_reg
= 0xb048,
1391 .enable_mask
= BIT(0),
1392 .hw
.init
= &(struct clk_init_data
){
1393 .name
= "camcc_ife_2_csid_clk",
1394 .parent_hws
= (const struct clk_hw
*[]){
1395 &camcc_ife_2_csid_clk_src
.clkr
.hw
1398 .flags
= CLK_SET_RATE_PARENT
,
1399 .ops
= &clk_branch2_ops
,
1404 static struct clk_branch camcc_ife_2_dsp_clk
= {
1406 .halt_check
= BRANCH_HALT
,
1408 .enable_reg
= 0xb02c,
1409 .enable_mask
= BIT(0),
1410 .hw
.init
= &(struct clk_init_data
){
1411 .name
= "camcc_ife_2_dsp_clk",
1412 .parent_hws
= (const struct clk_hw
*[]){
1413 &camcc_ife_2_clk_src
.clkr
.hw
1416 .flags
= CLK_SET_RATE_PARENT
,
1417 .ops
= &clk_branch2_ops
,
1422 static struct clk_branch camcc_ife_lite_clk
= {
1424 .halt_check
= BRANCH_HALT
,
1426 .enable_reg
= 0xc01c,
1427 .enable_mask
= BIT(0),
1428 .hw
.init
= &(struct clk_init_data
){
1429 .name
= "camcc_ife_lite_clk",
1430 .parent_hws
= (const struct clk_hw
*[]){
1431 &camcc_ife_lite_clk_src
.clkr
.hw
1434 .flags
= CLK_SET_RATE_PARENT
,
1435 .ops
= &clk_branch2_ops
,
1440 static struct clk_branch camcc_ife_lite_cphy_rx_clk
= {
1442 .halt_check
= BRANCH_HALT
,
1444 .enable_reg
= 0xc044,
1445 .enable_mask
= BIT(0),
1446 .hw
.init
= &(struct clk_init_data
){
1447 .name
= "camcc_ife_lite_cphy_rx_clk",
1448 .parent_hws
= (const struct clk_hw
*[]){
1449 &camcc_cphy_rx_clk_src
.clkr
.hw
1452 .flags
= CLK_SET_RATE_PARENT
,
1453 .ops
= &clk_branch2_ops
,
1458 static struct clk_branch camcc_ife_lite_csid_clk
= {
1460 .halt_check
= BRANCH_HALT
,
1462 .enable_reg
= 0xc03c,
1463 .enable_mask
= BIT(0),
1464 .hw
.init
= &(struct clk_init_data
){
1465 .name
= "camcc_ife_lite_csid_clk",
1466 .parent_hws
= (const struct clk_hw
*[]){
1467 &camcc_ife_lite_csid_clk_src
.clkr
.hw
1470 .flags
= CLK_SET_RATE_PARENT
,
1471 .ops
= &clk_branch2_ops
,
1476 static struct clk_branch camcc_ipe_0_ahb_clk
= {
1478 .halt_check
= BRANCH_HALT
,
1480 .enable_reg
= 0x7040,
1481 .enable_mask
= BIT(0),
1482 .hw
.init
= &(struct clk_init_data
){
1483 .name
= "camcc_ipe_0_ahb_clk",
1484 .parent_hws
= (const struct clk_hw
*[]){
1485 &camcc_slow_ahb_clk_src
.clkr
.hw
1488 .flags
= CLK_SET_RATE_PARENT
,
1489 .ops
= &clk_branch2_ops
,
1494 static struct clk_branch camcc_ipe_0_areg_clk
= {
1496 .halt_check
= BRANCH_HALT
,
1498 .enable_reg
= 0x703c,
1499 .enable_mask
= BIT(0),
1500 .hw
.init
= &(struct clk_init_data
){
1501 .name
= "camcc_ipe_0_areg_clk",
1502 .parent_hws
= (const struct clk_hw
*[]){
1503 &camcc_fast_ahb_clk_src
.clkr
.hw
1506 .flags
= CLK_SET_RATE_PARENT
,
1507 .ops
= &clk_branch2_ops
,
1512 static struct clk_branch camcc_ipe_0_axi_clk
= {
1514 .halt_check
= BRANCH_HALT
,
1516 .enable_reg
= 0x7038,
1517 .enable_mask
= BIT(0),
1518 .hw
.init
= &(struct clk_init_data
){
1519 .name
= "camcc_ipe_0_axi_clk",
1520 .ops
= &clk_branch2_ops
,
1525 static struct clk_branch camcc_ipe_0_clk
= {
1527 .halt_check
= BRANCH_HALT
,
1529 .enable_reg
= 0x7028,
1530 .enable_mask
= BIT(0),
1531 .hw
.init
= &(struct clk_init_data
){
1532 .name
= "camcc_ipe_0_clk",
1533 .parent_hws
= (const struct clk_hw
*[]){
1534 &camcc_ipe_0_clk_src
.clkr
.hw
1537 .flags
= CLK_SET_RATE_PARENT
,
1538 .ops
= &clk_branch2_ops
,
1543 static struct clk_branch camcc_jpeg_clk
= {
1545 .halt_check
= BRANCH_HALT
,
1547 .enable_reg
= 0xd01c,
1548 .enable_mask
= BIT(0),
1549 .hw
.init
= &(struct clk_init_data
){
1550 .name
= "camcc_jpeg_clk",
1551 .parent_hws
= (const struct clk_hw
*[]){
1552 &camcc_jpeg_clk_src
.clkr
.hw
1555 .flags
= CLK_SET_RATE_PARENT
,
1556 .ops
= &clk_branch2_ops
,
1561 static struct clk_branch camcc_lrme_clk
= {
1562 .halt_reg
= 0x1101c,
1563 .halt_check
= BRANCH_HALT
,
1565 .enable_reg
= 0x1101c,
1566 .enable_mask
= BIT(0),
1567 .hw
.init
= &(struct clk_init_data
){
1568 .name
= "camcc_lrme_clk",
1569 .parent_hws
= (const struct clk_hw
*[]){
1570 &camcc_lrme_clk_src
.clkr
.hw
1573 .flags
= CLK_SET_RATE_PARENT
,
1574 .ops
= &clk_branch2_ops
,
1579 static struct clk_branch camcc_mclk0_clk
= {
1581 .halt_check
= BRANCH_HALT
,
1583 .enable_reg
= 0x401c,
1584 .enable_mask
= BIT(0),
1585 .hw
.init
= &(struct clk_init_data
){
1586 .name
= "camcc_mclk0_clk",
1587 .parent_hws
= (const struct clk_hw
*[]){
1588 &camcc_mclk0_clk_src
.clkr
.hw
1591 .flags
= CLK_SET_RATE_PARENT
,
1592 .ops
= &clk_branch2_ops
,
1597 static struct clk_branch camcc_mclk1_clk
= {
1599 .halt_check
= BRANCH_HALT
,
1601 .enable_reg
= 0x403c,
1602 .enable_mask
= BIT(0),
1603 .hw
.init
= &(struct clk_init_data
){
1604 .name
= "camcc_mclk1_clk",
1605 .parent_hws
= (const struct clk_hw
*[]){
1606 &camcc_mclk1_clk_src
.clkr
.hw
1609 .flags
= CLK_SET_RATE_PARENT
,
1610 .ops
= &clk_branch2_ops
,
1615 static struct clk_branch camcc_mclk2_clk
= {
1617 .halt_check
= BRANCH_HALT
,
1619 .enable_reg
= 0x405c,
1620 .enable_mask
= BIT(0),
1621 .hw
.init
= &(struct clk_init_data
){
1622 .name
= "camcc_mclk2_clk",
1623 .parent_hws
= (const struct clk_hw
*[]){
1624 &camcc_mclk2_clk_src
.clkr
.hw
1627 .flags
= CLK_SET_RATE_PARENT
,
1628 .ops
= &clk_branch2_ops
,
1633 static struct clk_branch camcc_mclk3_clk
= {
1635 .halt_check
= BRANCH_HALT
,
1637 .enable_reg
= 0x407c,
1638 .enable_mask
= BIT(0),
1639 .hw
.init
= &(struct clk_init_data
){
1640 .name
= "camcc_mclk3_clk",
1641 .parent_hws
= (const struct clk_hw
*[]){
1642 &camcc_mclk3_clk_src
.clkr
.hw
1645 .flags
= CLK_SET_RATE_PARENT
,
1646 .ops
= &clk_branch2_ops
,
1651 static struct clk_branch camcc_mclk4_clk
= {
1653 .halt_check
= BRANCH_HALT
,
1655 .enable_reg
= 0x409c,
1656 .enable_mask
= BIT(0),
1657 .hw
.init
= &(struct clk_init_data
){
1658 .name
= "camcc_mclk4_clk",
1659 .parent_hws
= (const struct clk_hw
*[]){
1660 &camcc_mclk4_clk_src
.clkr
.hw
1663 .flags
= CLK_SET_RATE_PARENT
,
1664 .ops
= &clk_branch2_ops
,
1669 static struct clk_branch camcc_soc_ahb_clk
= {
1670 .halt_reg
= 0x1400c,
1671 .halt_check
= BRANCH_HALT
,
1673 .enable_reg
= 0x1400c,
1674 .enable_mask
= BIT(0),
1675 .hw
.init
= &(struct clk_init_data
){
1676 .name
= "camcc_soc_ahb_clk",
1677 .ops
= &clk_branch2_ops
,
1682 static struct clk_branch camcc_sys_tmr_clk
= {
1684 .halt_check
= BRANCH_HALT
,
1686 .enable_reg
= 0xe034,
1687 .enable_mask
= BIT(0),
1688 .hw
.init
= &(struct clk_init_data
){
1689 .name
= "camcc_sys_tmr_clk",
1690 .ops
= &clk_branch2_ops
,
1695 static struct gdsc bps_gdsc
= {
1700 .pwrsts
= PWRSTS_OFF_ON
,
1704 static struct gdsc ipe_0_gdsc
= {
1707 .name
= "ipe_0_gdsc",
1709 .pwrsts
= PWRSTS_OFF_ON
,
1713 static struct gdsc ife_0_gdsc
= {
1716 .name
= "ife_0_gdsc",
1718 .pwrsts
= PWRSTS_OFF_ON
,
1721 static struct gdsc ife_1_gdsc
= {
1724 .name
= "ife_1_gdsc",
1726 .pwrsts
= PWRSTS_OFF_ON
,
1729 static struct gdsc ife_2_gdsc
= {
1732 .name
= "ife_2_gdsc",
1734 .pwrsts
= PWRSTS_OFF_ON
,
1737 static struct gdsc titan_top_gdsc
= {
1740 .name
= "titan_top_gdsc",
1742 .pwrsts
= PWRSTS_OFF_ON
,
1745 static struct clk_hw
*camcc_sm6350_hws
[] = {
1746 [CAMCC_PLL2_OUT_EARLY
] = &camcc_pll2_out_early
.hw
,
1749 static struct clk_regmap
*camcc_sm6350_clocks
[] = {
1750 [CAMCC_BPS_AHB_CLK
] = &camcc_bps_ahb_clk
.clkr
,
1751 [CAMCC_BPS_AREG_CLK
] = &camcc_bps_areg_clk
.clkr
,
1752 [CAMCC_BPS_AXI_CLK
] = &camcc_bps_axi_clk
.clkr
,
1753 [CAMCC_BPS_CLK
] = &camcc_bps_clk
.clkr
,
1754 [CAMCC_BPS_CLK_SRC
] = &camcc_bps_clk_src
.clkr
,
1755 [CAMCC_CAMNOC_AXI_CLK
] = &camcc_camnoc_axi_clk
.clkr
,
1756 [CAMCC_CCI_0_CLK
] = &camcc_cci_0_clk
.clkr
,
1757 [CAMCC_CCI_0_CLK_SRC
] = &camcc_cci_0_clk_src
.clkr
,
1758 [CAMCC_CCI_1_CLK
] = &camcc_cci_1_clk
.clkr
,
1759 [CAMCC_CCI_1_CLK_SRC
] = &camcc_cci_1_clk_src
.clkr
,
1760 [CAMCC_CORE_AHB_CLK
] = &camcc_core_ahb_clk
.clkr
,
1761 [CAMCC_CPAS_AHB_CLK
] = &camcc_cpas_ahb_clk
.clkr
,
1762 [CAMCC_CPHY_RX_CLK_SRC
] = &camcc_cphy_rx_clk_src
.clkr
,
1763 [CAMCC_CSI0PHYTIMER_CLK
] = &camcc_csi0phytimer_clk
.clkr
,
1764 [CAMCC_CSI0PHYTIMER_CLK_SRC
] = &camcc_csi0phytimer_clk_src
.clkr
,
1765 [CAMCC_CSI1PHYTIMER_CLK
] = &camcc_csi1phytimer_clk
.clkr
,
1766 [CAMCC_CSI1PHYTIMER_CLK_SRC
] = &camcc_csi1phytimer_clk_src
.clkr
,
1767 [CAMCC_CSI2PHYTIMER_CLK
] = &camcc_csi2phytimer_clk
.clkr
,
1768 [CAMCC_CSI2PHYTIMER_CLK_SRC
] = &camcc_csi2phytimer_clk_src
.clkr
,
1769 [CAMCC_CSI3PHYTIMER_CLK
] = &camcc_csi3phytimer_clk
.clkr
,
1770 [CAMCC_CSI3PHYTIMER_CLK_SRC
] = &camcc_csi3phytimer_clk_src
.clkr
,
1771 [CAMCC_CSIPHY0_CLK
] = &camcc_csiphy0_clk
.clkr
,
1772 [CAMCC_CSIPHY1_CLK
] = &camcc_csiphy1_clk
.clkr
,
1773 [CAMCC_CSIPHY2_CLK
] = &camcc_csiphy2_clk
.clkr
,
1774 [CAMCC_CSIPHY3_CLK
] = &camcc_csiphy3_clk
.clkr
,
1775 [CAMCC_FAST_AHB_CLK_SRC
] = &camcc_fast_ahb_clk_src
.clkr
,
1776 [CAMCC_ICP_CLK
] = &camcc_icp_clk
.clkr
,
1777 [CAMCC_ICP_CLK_SRC
] = &camcc_icp_clk_src
.clkr
,
1778 [CAMCC_ICP_TS_CLK
] = &camcc_icp_ts_clk
.clkr
,
1779 [CAMCC_IFE_0_AXI_CLK
] = &camcc_ife_0_axi_clk
.clkr
,
1780 [CAMCC_IFE_0_CLK
] = &camcc_ife_0_clk
.clkr
,
1781 [CAMCC_IFE_0_CLK_SRC
] = &camcc_ife_0_clk_src
.clkr
,
1782 [CAMCC_IFE_0_CPHY_RX_CLK
] = &camcc_ife_0_cphy_rx_clk
.clkr
,
1783 [CAMCC_IFE_0_CSID_CLK
] = &camcc_ife_0_csid_clk
.clkr
,
1784 [CAMCC_IFE_0_CSID_CLK_SRC
] = &camcc_ife_0_csid_clk_src
.clkr
,
1785 [CAMCC_IFE_0_DSP_CLK
] = &camcc_ife_0_dsp_clk
.clkr
,
1786 [CAMCC_IFE_1_AXI_CLK
] = &camcc_ife_1_axi_clk
.clkr
,
1787 [CAMCC_IFE_1_CLK
] = &camcc_ife_1_clk
.clkr
,
1788 [CAMCC_IFE_1_CLK_SRC
] = &camcc_ife_1_clk_src
.clkr
,
1789 [CAMCC_IFE_1_CPHY_RX_CLK
] = &camcc_ife_1_cphy_rx_clk
.clkr
,
1790 [CAMCC_IFE_1_CSID_CLK
] = &camcc_ife_1_csid_clk
.clkr
,
1791 [CAMCC_IFE_1_CSID_CLK_SRC
] = &camcc_ife_1_csid_clk_src
.clkr
,
1792 [CAMCC_IFE_1_DSP_CLK
] = &camcc_ife_1_dsp_clk
.clkr
,
1793 [CAMCC_IFE_2_AXI_CLK
] = &camcc_ife_2_axi_clk
.clkr
,
1794 [CAMCC_IFE_2_CLK
] = &camcc_ife_2_clk
.clkr
,
1795 [CAMCC_IFE_2_CLK_SRC
] = &camcc_ife_2_clk_src
.clkr
,
1796 [CAMCC_IFE_2_CPHY_RX_CLK
] = &camcc_ife_2_cphy_rx_clk
.clkr
,
1797 [CAMCC_IFE_2_CSID_CLK
] = &camcc_ife_2_csid_clk
.clkr
,
1798 [CAMCC_IFE_2_CSID_CLK_SRC
] = &camcc_ife_2_csid_clk_src
.clkr
,
1799 [CAMCC_IFE_2_DSP_CLK
] = &camcc_ife_2_dsp_clk
.clkr
,
1800 [CAMCC_IFE_LITE_CLK
] = &camcc_ife_lite_clk
.clkr
,
1801 [CAMCC_IFE_LITE_CLK_SRC
] = &camcc_ife_lite_clk_src
.clkr
,
1802 [CAMCC_IFE_LITE_CPHY_RX_CLK
] = &camcc_ife_lite_cphy_rx_clk
.clkr
,
1803 [CAMCC_IFE_LITE_CSID_CLK
] = &camcc_ife_lite_csid_clk
.clkr
,
1804 [CAMCC_IFE_LITE_CSID_CLK_SRC
] = &camcc_ife_lite_csid_clk_src
.clkr
,
1805 [CAMCC_IPE_0_AHB_CLK
] = &camcc_ipe_0_ahb_clk
.clkr
,
1806 [CAMCC_IPE_0_AREG_CLK
] = &camcc_ipe_0_areg_clk
.clkr
,
1807 [CAMCC_IPE_0_AXI_CLK
] = &camcc_ipe_0_axi_clk
.clkr
,
1808 [CAMCC_IPE_0_CLK
] = &camcc_ipe_0_clk
.clkr
,
1809 [CAMCC_IPE_0_CLK_SRC
] = &camcc_ipe_0_clk_src
.clkr
,
1810 [CAMCC_JPEG_CLK
] = &camcc_jpeg_clk
.clkr
,
1811 [CAMCC_JPEG_CLK_SRC
] = &camcc_jpeg_clk_src
.clkr
,
1812 [CAMCC_LRME_CLK
] = &camcc_lrme_clk
.clkr
,
1813 [CAMCC_LRME_CLK_SRC
] = &camcc_lrme_clk_src
.clkr
,
1814 [CAMCC_MCLK0_CLK
] = &camcc_mclk0_clk
.clkr
,
1815 [CAMCC_MCLK0_CLK_SRC
] = &camcc_mclk0_clk_src
.clkr
,
1816 [CAMCC_MCLK1_CLK
] = &camcc_mclk1_clk
.clkr
,
1817 [CAMCC_MCLK1_CLK_SRC
] = &camcc_mclk1_clk_src
.clkr
,
1818 [CAMCC_MCLK2_CLK
] = &camcc_mclk2_clk
.clkr
,
1819 [CAMCC_MCLK2_CLK_SRC
] = &camcc_mclk2_clk_src
.clkr
,
1820 [CAMCC_MCLK3_CLK
] = &camcc_mclk3_clk
.clkr
,
1821 [CAMCC_MCLK3_CLK_SRC
] = &camcc_mclk3_clk_src
.clkr
,
1822 [CAMCC_MCLK4_CLK
] = &camcc_mclk4_clk
.clkr
,
1823 [CAMCC_MCLK4_CLK_SRC
] = &camcc_mclk4_clk_src
.clkr
,
1824 [CAMCC_PLL0
] = &camcc_pll0
.clkr
,
1825 [CAMCC_PLL0_OUT_EVEN
] = &camcc_pll0_out_even
.clkr
,
1826 [CAMCC_PLL1
] = &camcc_pll1
.clkr
,
1827 [CAMCC_PLL1_OUT_EVEN
] = &camcc_pll1_out_even
.clkr
,
1828 [CAMCC_PLL2
] = &camcc_pll2
.clkr
,
1829 [CAMCC_PLL2_OUT_MAIN
] = &camcc_pll2_out_main
.clkr
,
1830 [CAMCC_PLL3
] = &camcc_pll3
.clkr
,
1831 [CAMCC_SLOW_AHB_CLK_SRC
] = &camcc_slow_ahb_clk_src
.clkr
,
1832 [CAMCC_SOC_AHB_CLK
] = &camcc_soc_ahb_clk
.clkr
,
1833 [CAMCC_SYS_TMR_CLK
] = &camcc_sys_tmr_clk
.clkr
,
1836 static struct gdsc
*camcc_sm6350_gdscs
[] = {
1837 [BPS_GDSC
] = &bps_gdsc
,
1838 [IPE_0_GDSC
] = &ipe_0_gdsc
,
1839 [IFE_0_GDSC
] = &ife_0_gdsc
,
1840 [IFE_1_GDSC
] = &ife_1_gdsc
,
1841 [IFE_2_GDSC
] = &ife_2_gdsc
,
1842 [TITAN_TOP_GDSC
] = &titan_top_gdsc
,
1845 static const struct regmap_config camcc_sm6350_regmap_config
= {
1849 .max_register
= 0x16000,
1853 static const struct qcom_cc_desc camcc_sm6350_desc
= {
1854 .config
= &camcc_sm6350_regmap_config
,
1855 .clk_hws
= camcc_sm6350_hws
,
1856 .num_clk_hws
= ARRAY_SIZE(camcc_sm6350_hws
),
1857 .clks
= camcc_sm6350_clocks
,
1858 .num_clks
= ARRAY_SIZE(camcc_sm6350_clocks
),
1859 .gdscs
= camcc_sm6350_gdscs
,
1860 .num_gdscs
= ARRAY_SIZE(camcc_sm6350_gdscs
),
1863 static const struct of_device_id camcc_sm6350_match_table
[] = {
1864 { .compatible
= "qcom,sm6350-camcc" },
1867 MODULE_DEVICE_TABLE(of
, camcc_sm6350_match_table
);
1869 static int camcc_sm6350_probe(struct platform_device
*pdev
)
1871 struct regmap
*regmap
;
1873 regmap
= qcom_cc_map(pdev
, &camcc_sm6350_desc
);
1875 return PTR_ERR(regmap
);
1877 clk_fabia_pll_configure(&camcc_pll0
, regmap
, &camcc_pll0_config
);
1878 clk_fabia_pll_configure(&camcc_pll1
, regmap
, &camcc_pll1_config
);
1879 clk_agera_pll_configure(&camcc_pll2
, regmap
, &camcc_pll2_config
);
1880 clk_fabia_pll_configure(&camcc_pll3
, regmap
, &camcc_pll3_config
);
1882 return qcom_cc_really_probe(&pdev
->dev
, &camcc_sm6350_desc
, regmap
);
1885 static struct platform_driver camcc_sm6350_driver
= {
1886 .probe
= camcc_sm6350_probe
,
1888 .name
= "sm6350-camcc",
1889 .of_match_table
= camcc_sm6350_match_table
,
1893 module_platform_driver(camcc_sm6350_driver
);
1895 MODULE_DESCRIPTION("QTI CAMCC SM6350 Driver");
1896 MODULE_LICENSE("GPL");