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/pm_runtime.h>
12 #include <linux/regmap.h>
14 #include <dt-bindings/clock/qcom,sa8775p-camcc.h>
16 #include "clk-alpha-pll.h"
17 #include "clk-branch.h"
20 #include "clk-regmap.h"
21 #include "clk-regmap-divider.h"
22 #include "clk-regmap-mux.h"
37 P_CAM_CC_PLL0_OUT_EVEN
,
38 P_CAM_CC_PLL0_OUT_MAIN
,
39 P_CAM_CC_PLL0_OUT_ODD
,
40 P_CAM_CC_PLL2_OUT_EVEN
,
41 P_CAM_CC_PLL2_OUT_MAIN
,
42 P_CAM_CC_PLL3_OUT_EVEN
,
43 P_CAM_CC_PLL4_OUT_EVEN
,
44 P_CAM_CC_PLL5_OUT_EVEN
,
48 static const struct pll_vco lucid_evo_vco
[] = {
49 { 249600000, 2020000000, 0 },
52 static const struct pll_vco rivian_evo_vco
[] = {
53 { 864000000, 1056000000, 0 },
56 static const struct alpha_pll_config cam_cc_pll0_config
= {
59 .config_ctl_val
= 0x20485699,
60 .config_ctl_hi_val
= 0x00182261,
61 .config_ctl_hi1_val
= 0x32aa299c,
62 .user_ctl_val
= 0x00008400,
63 .user_ctl_hi_val
= 0x00400805,
66 static struct clk_alpha_pll cam_cc_pll0
= {
68 .vco_table
= lucid_evo_vco
,
69 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
70 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
72 .hw
.init
= &(const struct clk_init_data
) {
73 .name
= "cam_cc_pll0",
74 .parent_data
= &(const struct clk_parent_data
) {
78 .ops
= &clk_alpha_pll_lucid_evo_ops
,
83 static const struct clk_div_table post_div_table_cam_cc_pll0_out_even
[] = {
88 static struct clk_alpha_pll_postdiv cam_cc_pll0_out_even
= {
91 .post_div_table
= post_div_table_cam_cc_pll0_out_even
,
92 .num_post_div
= ARRAY_SIZE(post_div_table_cam_cc_pll0_out_even
),
94 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
95 .clkr
.hw
.init
= &(const struct clk_init_data
) {
96 .name
= "cam_cc_pll0_out_even",
97 .parent_hws
= (const struct clk_hw
*[]) {
101 .flags
= CLK_SET_RATE_PARENT
,
102 .ops
= &clk_alpha_pll_postdiv_lucid_evo_ops
,
106 static const struct clk_div_table post_div_table_cam_cc_pll0_out_odd
[] = {
111 static struct clk_alpha_pll_postdiv cam_cc_pll0_out_odd
= {
113 .post_div_shift
= 14,
114 .post_div_table
= post_div_table_cam_cc_pll0_out_odd
,
115 .num_post_div
= ARRAY_SIZE(post_div_table_cam_cc_pll0_out_odd
),
117 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
118 .clkr
.hw
.init
= &(const struct clk_init_data
) {
119 .name
= "cam_cc_pll0_out_odd",
120 .parent_hws
= (const struct clk_hw
*[]) {
121 &cam_cc_pll0
.clkr
.hw
,
124 .flags
= CLK_SET_RATE_PARENT
,
125 .ops
= &clk_alpha_pll_postdiv_lucid_evo_ops
,
129 static const struct alpha_pll_config cam_cc_pll2_config
= {
132 .config_ctl_val
= 0x90008820,
133 .config_ctl_hi_val
= 0x00890263,
134 .config_ctl_hi1_val
= 0x00000247,
135 .user_ctl_val
= 0x00000000,
136 .user_ctl_hi_val
= 0x00400000,
139 static struct clk_alpha_pll cam_cc_pll2
= {
141 .vco_table
= rivian_evo_vco
,
142 .num_vco
= ARRAY_SIZE(rivian_evo_vco
),
143 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO
],
145 .hw
.init
= &(const struct clk_init_data
) {
146 .name
= "cam_cc_pll2",
147 .parent_data
= &(const struct clk_parent_data
) {
151 .ops
= &clk_alpha_pll_rivian_evo_ops
,
156 static const struct alpha_pll_config cam_cc_pll3_config
= {
159 .config_ctl_val
= 0x20485699,
160 .config_ctl_hi_val
= 0x00182261,
161 .config_ctl_hi1_val
= 0x32aa299c,
162 .user_ctl_val
= 0x00000400,
163 .user_ctl_hi_val
= 0x00400805,
166 static struct clk_alpha_pll cam_cc_pll3
= {
168 .vco_table
= lucid_evo_vco
,
169 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
170 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
172 .hw
.init
= &(const struct clk_init_data
) {
173 .name
= "cam_cc_pll3",
174 .parent_data
= &(const struct clk_parent_data
) {
178 .ops
= &clk_alpha_pll_lucid_evo_ops
,
183 static const struct clk_div_table post_div_table_cam_cc_pll3_out_even
[] = {
188 static struct clk_alpha_pll_postdiv cam_cc_pll3_out_even
= {
190 .post_div_shift
= 10,
191 .post_div_table
= post_div_table_cam_cc_pll3_out_even
,
192 .num_post_div
= ARRAY_SIZE(post_div_table_cam_cc_pll3_out_even
),
194 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
195 .clkr
.hw
.init
= &(const struct clk_init_data
) {
196 .name
= "cam_cc_pll3_out_even",
197 .parent_hws
= (const struct clk_hw
*[]) {
198 &cam_cc_pll3
.clkr
.hw
,
201 .flags
= CLK_SET_RATE_PARENT
,
202 .ops
= &clk_alpha_pll_postdiv_lucid_evo_ops
,
206 static const struct alpha_pll_config cam_cc_pll4_config
= {
209 .config_ctl_val
= 0x20485699,
210 .config_ctl_hi_val
= 0x00182261,
211 .config_ctl_hi1_val
= 0x32aa299c,
212 .user_ctl_val
= 0x00000400,
213 .user_ctl_hi_val
= 0x00400805,
216 static struct clk_alpha_pll cam_cc_pll4
= {
218 .vco_table
= lucid_evo_vco
,
219 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
220 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
222 .hw
.init
= &(const struct clk_init_data
) {
223 .name
= "cam_cc_pll4",
224 .parent_data
= &(const struct clk_parent_data
) {
228 .ops
= &clk_alpha_pll_lucid_evo_ops
,
233 static const struct clk_div_table post_div_table_cam_cc_pll4_out_even
[] = {
238 static struct clk_alpha_pll_postdiv cam_cc_pll4_out_even
= {
240 .post_div_shift
= 10,
241 .post_div_table
= post_div_table_cam_cc_pll4_out_even
,
242 .num_post_div
= ARRAY_SIZE(post_div_table_cam_cc_pll4_out_even
),
244 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
245 .clkr
.hw
.init
= &(const struct clk_init_data
) {
246 .name
= "cam_cc_pll4_out_even",
247 .parent_hws
= (const struct clk_hw
*[]) {
248 &cam_cc_pll4
.clkr
.hw
,
251 .flags
= CLK_SET_RATE_PARENT
,
252 .ops
= &clk_alpha_pll_postdiv_lucid_evo_ops
,
256 static const struct alpha_pll_config cam_cc_pll5_config
= {
259 .config_ctl_val
= 0x20485699,
260 .config_ctl_hi_val
= 0x00182261,
261 .config_ctl_hi1_val
= 0x32aa299c,
262 .user_ctl_val
= 0x00000400,
263 .user_ctl_hi_val
= 0x00400805,
266 static struct clk_alpha_pll cam_cc_pll5
= {
268 .vco_table
= lucid_evo_vco
,
269 .num_vco
= ARRAY_SIZE(lucid_evo_vco
),
270 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
272 .hw
.init
= &(const struct clk_init_data
) {
273 .name
= "cam_cc_pll5",
274 .parent_data
= &(const struct clk_parent_data
) {
278 .ops
= &clk_alpha_pll_lucid_evo_ops
,
283 static const struct clk_div_table post_div_table_cam_cc_pll5_out_even
[] = {
288 static struct clk_alpha_pll_postdiv cam_cc_pll5_out_even
= {
290 .post_div_shift
= 10,
291 .post_div_table
= post_div_table_cam_cc_pll5_out_even
,
292 .num_post_div
= ARRAY_SIZE(post_div_table_cam_cc_pll5_out_even
),
294 .regs
= clk_alpha_pll_regs
[CLK_ALPHA_PLL_TYPE_LUCID_EVO
],
295 .clkr
.hw
.init
= &(const struct clk_init_data
) {
296 .name
= "cam_cc_pll5_out_even",
297 .parent_hws
= (const struct clk_hw
*[]) {
298 &cam_cc_pll5
.clkr
.hw
,
301 .flags
= CLK_SET_RATE_PARENT
,
302 .ops
= &clk_alpha_pll_postdiv_lucid_evo_ops
,
306 static const struct parent_map cam_cc_parent_map_0
[] = {
308 { P_CAM_CC_PLL0_OUT_MAIN
, 1 },
309 { P_CAM_CC_PLL0_OUT_EVEN
, 2 },
310 { P_CAM_CC_PLL0_OUT_ODD
, 3 },
313 static const struct clk_parent_data cam_cc_parent_data_0
[] = {
314 { .index
= DT_BI_TCXO
},
315 { .hw
= &cam_cc_pll0
.clkr
.hw
},
316 { .hw
= &cam_cc_pll0_out_even
.clkr
.hw
},
317 { .hw
= &cam_cc_pll0_out_odd
.clkr
.hw
},
320 static const struct parent_map cam_cc_parent_map_1
[] = {
322 { P_CAM_CC_PLL2_OUT_EVEN
, 3 },
323 { P_CAM_CC_PLL2_OUT_MAIN
, 5 },
326 static const struct clk_parent_data cam_cc_parent_data_1
[] = {
327 { .index
= DT_BI_TCXO
},
328 { .hw
= &cam_cc_pll2
.clkr
.hw
},
329 { .hw
= &cam_cc_pll2
.clkr
.hw
},
332 static const struct parent_map cam_cc_parent_map_2
[] = {
334 { P_CAM_CC_PLL4_OUT_EVEN
, 6 },
337 static const struct clk_parent_data cam_cc_parent_data_2
[] = {
338 { .index
= DT_BI_TCXO
},
339 { .hw
= &cam_cc_pll4_out_even
.clkr
.hw
},
342 static const struct parent_map cam_cc_parent_map_3
[] = {
344 { P_CAM_CC_PLL5_OUT_EVEN
, 6 },
347 static const struct clk_parent_data cam_cc_parent_data_3
[] = {
348 { .index
= DT_BI_TCXO
},
349 { .hw
= &cam_cc_pll5_out_even
.clkr
.hw
},
352 static const struct parent_map cam_cc_parent_map_4
[] = {
354 { P_CAM_CC_PLL3_OUT_EVEN
, 6 },
357 static const struct clk_parent_data cam_cc_parent_data_4
[] = {
358 { .index
= DT_BI_TCXO
},
359 { .hw
= &cam_cc_pll3_out_even
.clkr
.hw
},
362 static const struct parent_map cam_cc_parent_map_5
[] = {
366 static const struct clk_parent_data cam_cc_parent_data_5
[] = {
367 { .index
= DT_SLEEP_CLK
},
370 static const struct parent_map cam_cc_parent_map_6_ao
[] = {
374 static const struct clk_parent_data cam_cc_parent_data_6_ao
[] = {
375 { .index
= DT_BI_TCXO_AO
},
378 static const struct freq_tbl ftbl_cam_cc_camnoc_axi_clk_src
[] = {
379 F(400000000, P_CAM_CC_PLL0_OUT_MAIN
, 3, 0, 0),
383 static struct clk_rcg2 cam_cc_camnoc_axi_clk_src
= {
387 .parent_map
= cam_cc_parent_map_0
,
388 .freq_tbl
= ftbl_cam_cc_camnoc_axi_clk_src
,
389 .clkr
.hw
.init
= &(const struct clk_init_data
) {
390 .name
= "cam_cc_camnoc_axi_clk_src",
391 .parent_data
= cam_cc_parent_data_0
,
392 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
393 .flags
= CLK_SET_RATE_PARENT
,
394 .ops
= &clk_rcg2_shared_ops
,
398 static const struct freq_tbl ftbl_cam_cc_cci_0_clk_src
[] = {
399 F(37500000, P_CAM_CC_PLL0_OUT_MAIN
, 16, 1, 2),
403 static struct clk_rcg2 cam_cc_cci_0_clk_src
= {
407 .parent_map
= cam_cc_parent_map_0
,
408 .freq_tbl
= ftbl_cam_cc_cci_0_clk_src
,
409 .clkr
.hw
.init
= &(const struct clk_init_data
) {
410 .name
= "cam_cc_cci_0_clk_src",
411 .parent_data
= cam_cc_parent_data_0
,
412 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
413 .flags
= CLK_SET_RATE_PARENT
,
414 .ops
= &clk_rcg2_shared_ops
,
418 static struct clk_rcg2 cam_cc_cci_1_clk_src
= {
422 .parent_map
= cam_cc_parent_map_0
,
423 .freq_tbl
= ftbl_cam_cc_cci_0_clk_src
,
424 .clkr
.hw
.init
= &(const struct clk_init_data
) {
425 .name
= "cam_cc_cci_1_clk_src",
426 .parent_data
= cam_cc_parent_data_0
,
427 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
428 .flags
= CLK_SET_RATE_PARENT
,
429 .ops
= &clk_rcg2_shared_ops
,
433 static struct clk_rcg2 cam_cc_cci_2_clk_src
= {
437 .parent_map
= cam_cc_parent_map_0
,
438 .freq_tbl
= ftbl_cam_cc_cci_0_clk_src
,
439 .clkr
.hw
.init
= &(const struct clk_init_data
) {
440 .name
= "cam_cc_cci_2_clk_src",
441 .parent_data
= cam_cc_parent_data_0
,
442 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
443 .flags
= CLK_SET_RATE_PARENT
,
444 .ops
= &clk_rcg2_shared_ops
,
448 static struct clk_rcg2 cam_cc_cci_3_clk_src
= {
452 .parent_map
= cam_cc_parent_map_0
,
453 .freq_tbl
= ftbl_cam_cc_cci_0_clk_src
,
454 .clkr
.hw
.init
= &(const struct clk_init_data
) {
455 .name
= "cam_cc_cci_3_clk_src",
456 .parent_data
= cam_cc_parent_data_0
,
457 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
458 .flags
= CLK_SET_RATE_PARENT
,
459 .ops
= &clk_rcg2_shared_ops
,
463 static const struct freq_tbl ftbl_cam_cc_cphy_rx_clk_src
[] = {
464 F(400000000, P_CAM_CC_PLL0_OUT_ODD
, 1, 0, 0),
468 static struct clk_rcg2 cam_cc_cphy_rx_clk_src
= {
472 .parent_map
= cam_cc_parent_map_0
,
473 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
474 .clkr
.hw
.init
= &(const struct clk_init_data
) {
475 .name
= "cam_cc_cphy_rx_clk_src",
476 .parent_data
= cam_cc_parent_data_0
,
477 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
478 .flags
= CLK_SET_RATE_PARENT
,
479 .ops
= &clk_rcg2_shared_ops
,
483 static struct clk_rcg2 cam_cc_csi0phytimer_clk_src
= {
487 .parent_map
= cam_cc_parent_map_0
,
488 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
489 .clkr
.hw
.init
= &(const struct clk_init_data
) {
490 .name
= "cam_cc_csi0phytimer_clk_src",
491 .parent_data
= cam_cc_parent_data_0
,
492 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
493 .flags
= CLK_SET_RATE_PARENT
,
494 .ops
= &clk_rcg2_shared_ops
,
498 static struct clk_rcg2 cam_cc_csi1phytimer_clk_src
= {
502 .parent_map
= cam_cc_parent_map_0
,
503 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
504 .clkr
.hw
.init
= &(const struct clk_init_data
) {
505 .name
= "cam_cc_csi1phytimer_clk_src",
506 .parent_data
= cam_cc_parent_data_0
,
507 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
508 .flags
= CLK_SET_RATE_PARENT
,
509 .ops
= &clk_rcg2_shared_ops
,
513 static struct clk_rcg2 cam_cc_csi2phytimer_clk_src
= {
517 .parent_map
= cam_cc_parent_map_0
,
518 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
519 .clkr
.hw
.init
= &(const struct clk_init_data
) {
520 .name
= "cam_cc_csi2phytimer_clk_src",
521 .parent_data
= cam_cc_parent_data_0
,
522 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
523 .flags
= CLK_SET_RATE_PARENT
,
524 .ops
= &clk_rcg2_shared_ops
,
528 static struct clk_rcg2 cam_cc_csi3phytimer_clk_src
= {
532 .parent_map
= cam_cc_parent_map_0
,
533 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
534 .clkr
.hw
.init
= &(const struct clk_init_data
) {
535 .name
= "cam_cc_csi3phytimer_clk_src",
536 .parent_data
= cam_cc_parent_data_0
,
537 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
538 .flags
= CLK_SET_RATE_PARENT
,
539 .ops
= &clk_rcg2_shared_ops
,
543 static struct clk_rcg2 cam_cc_csid_clk_src
= {
547 .parent_map
= cam_cc_parent_map_0
,
548 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
549 .clkr
.hw
.init
= &(const struct clk_init_data
) {
550 .name
= "cam_cc_csid_clk_src",
551 .parent_data
= cam_cc_parent_data_0
,
552 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
553 .flags
= CLK_SET_RATE_PARENT
,
554 .ops
= &clk_rcg2_shared_ops
,
558 static const struct freq_tbl ftbl_cam_cc_fast_ahb_clk_src
[] = {
559 F(300000000, P_CAM_CC_PLL0_OUT_MAIN
, 4, 0, 0),
560 F(400000000, P_CAM_CC_PLL0_OUT_MAIN
, 3, 0, 0),
564 static struct clk_rcg2 cam_cc_fast_ahb_clk_src
= {
568 .parent_map
= cam_cc_parent_map_0
,
569 .freq_tbl
= ftbl_cam_cc_fast_ahb_clk_src
,
570 .clkr
.hw
.init
= &(const struct clk_init_data
) {
571 .name
= "cam_cc_fast_ahb_clk_src",
572 .parent_data
= cam_cc_parent_data_0
,
573 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
574 .flags
= CLK_SET_RATE_PARENT
,
575 .ops
= &clk_rcg2_shared_ops
,
579 static const struct freq_tbl ftbl_cam_cc_icp_clk_src
[] = {
580 F(480000000, P_CAM_CC_PLL0_OUT_MAIN
, 2.5, 0, 0),
581 F(600000000, P_CAM_CC_PLL0_OUT_MAIN
, 2, 0, 0),
585 static struct clk_rcg2 cam_cc_icp_clk_src
= {
589 .parent_map
= cam_cc_parent_map_0
,
590 .freq_tbl
= ftbl_cam_cc_icp_clk_src
,
591 .clkr
.hw
.init
= &(const struct clk_init_data
) {
592 .name
= "cam_cc_icp_clk_src",
593 .parent_data
= cam_cc_parent_data_0
,
594 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
595 .flags
= CLK_SET_RATE_PARENT
,
596 .ops
= &clk_rcg2_shared_ops
,
600 static const struct freq_tbl ftbl_cam_cc_ife_0_clk_src
[] = {
601 F(480000000, P_CAM_CC_PLL4_OUT_EVEN
, 1, 0, 0),
602 F(600000000, P_CAM_CC_PLL4_OUT_EVEN
, 1, 0, 0),
606 static struct clk_rcg2 cam_cc_ife_0_clk_src
= {
610 .parent_map
= cam_cc_parent_map_2
,
611 .freq_tbl
= ftbl_cam_cc_ife_0_clk_src
,
612 .clkr
.hw
.init
= &(const struct clk_init_data
) {
613 .name
= "cam_cc_ife_0_clk_src",
614 .parent_data
= cam_cc_parent_data_2
,
615 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_2
),
616 .flags
= CLK_SET_RATE_PARENT
,
617 .ops
= &clk_rcg2_shared_ops
,
621 static const struct freq_tbl ftbl_cam_cc_ife_1_clk_src
[] = {
622 F(480000000, P_CAM_CC_PLL5_OUT_EVEN
, 1, 0, 0),
623 F(600000000, P_CAM_CC_PLL5_OUT_EVEN
, 1, 0, 0),
627 static struct clk_rcg2 cam_cc_ife_1_clk_src
= {
631 .parent_map
= cam_cc_parent_map_3
,
632 .freq_tbl
= ftbl_cam_cc_ife_1_clk_src
,
633 .clkr
.hw
.init
= &(const struct clk_init_data
) {
634 .name
= "cam_cc_ife_1_clk_src",
635 .parent_data
= cam_cc_parent_data_3
,
636 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_3
),
637 .flags
= CLK_SET_RATE_PARENT
,
638 .ops
= &clk_rcg2_shared_ops
,
642 static const struct freq_tbl ftbl_cam_cc_ife_lite_clk_src
[] = {
643 F(400000000, P_CAM_CC_PLL0_OUT_MAIN
, 3, 0, 0),
644 F(480000000, P_CAM_CC_PLL0_OUT_MAIN
, 2.5, 0, 0),
648 static struct clk_rcg2 cam_cc_ife_lite_clk_src
= {
652 .parent_map
= cam_cc_parent_map_0
,
653 .freq_tbl
= ftbl_cam_cc_ife_lite_clk_src
,
654 .clkr
.hw
.init
= &(const struct clk_init_data
) {
655 .name
= "cam_cc_ife_lite_clk_src",
656 .parent_data
= cam_cc_parent_data_0
,
657 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
658 .flags
= CLK_SET_RATE_PARENT
,
659 .ops
= &clk_rcg2_shared_ops
,
663 static struct clk_rcg2 cam_cc_ife_lite_csid_clk_src
= {
667 .parent_map
= cam_cc_parent_map_0
,
668 .freq_tbl
= ftbl_cam_cc_cphy_rx_clk_src
,
669 .clkr
.hw
.init
= &(const struct clk_init_data
) {
670 .name
= "cam_cc_ife_lite_csid_clk_src",
671 .parent_data
= cam_cc_parent_data_0
,
672 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
673 .flags
= CLK_SET_RATE_PARENT
,
674 .ops
= &clk_rcg2_shared_ops
,
678 static const struct freq_tbl ftbl_cam_cc_ipe_clk_src
[] = {
679 F(480000000, P_CAM_CC_PLL3_OUT_EVEN
, 1, 0, 0),
680 F(600000000, P_CAM_CC_PLL3_OUT_EVEN
, 1, 0, 0),
684 static struct clk_rcg2 cam_cc_ipe_clk_src
= {
688 .parent_map
= cam_cc_parent_map_4
,
689 .freq_tbl
= ftbl_cam_cc_ipe_clk_src
,
690 .clkr
.hw
.init
= &(const struct clk_init_data
) {
691 .name
= "cam_cc_ipe_clk_src",
692 .parent_data
= cam_cc_parent_data_4
,
693 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_4
),
694 .flags
= CLK_SET_RATE_PARENT
,
695 .ops
= &clk_rcg2_shared_ops
,
699 static const struct freq_tbl ftbl_cam_cc_mclk0_clk_src
[] = {
700 F(19200000, P_CAM_CC_PLL2_OUT_MAIN
, 1, 1, 50),
701 F(24000000, P_CAM_CC_PLL2_OUT_MAIN
, 10, 1, 4),
702 F(64000000, P_CAM_CC_PLL2_OUT_MAIN
, 15, 0, 0),
706 static struct clk_rcg2 cam_cc_mclk0_clk_src
= {
710 .parent_map
= cam_cc_parent_map_1
,
711 .freq_tbl
= ftbl_cam_cc_mclk0_clk_src
,
712 .clkr
.hw
.init
= &(const struct clk_init_data
) {
713 .name
= "cam_cc_mclk0_clk_src",
714 .parent_data
= cam_cc_parent_data_1
,
715 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_1
),
716 .flags
= CLK_SET_RATE_PARENT
,
717 .ops
= &clk_rcg2_shared_ops
,
721 static struct clk_rcg2 cam_cc_mclk1_clk_src
= {
725 .parent_map
= cam_cc_parent_map_1
,
726 .freq_tbl
= ftbl_cam_cc_mclk0_clk_src
,
727 .clkr
.hw
.init
= &(const struct clk_init_data
) {
728 .name
= "cam_cc_mclk1_clk_src",
729 .parent_data
= cam_cc_parent_data_1
,
730 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_1
),
731 .flags
= CLK_SET_RATE_PARENT
,
732 .ops
= &clk_rcg2_shared_ops
,
736 static struct clk_rcg2 cam_cc_mclk2_clk_src
= {
740 .parent_map
= cam_cc_parent_map_1
,
741 .freq_tbl
= ftbl_cam_cc_mclk0_clk_src
,
742 .clkr
.hw
.init
= &(const struct clk_init_data
) {
743 .name
= "cam_cc_mclk2_clk_src",
744 .parent_data
= cam_cc_parent_data_1
,
745 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_1
),
746 .flags
= CLK_SET_RATE_PARENT
,
747 .ops
= &clk_rcg2_shared_ops
,
751 static struct clk_rcg2 cam_cc_mclk3_clk_src
= {
755 .parent_map
= cam_cc_parent_map_1
,
756 .freq_tbl
= ftbl_cam_cc_mclk0_clk_src
,
757 .clkr
.hw
.init
= &(const struct clk_init_data
) {
758 .name
= "cam_cc_mclk3_clk_src",
759 .parent_data
= cam_cc_parent_data_1
,
760 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_1
),
761 .flags
= CLK_SET_RATE_PARENT
,
762 .ops
= &clk_rcg2_shared_ops
,
766 static const struct freq_tbl ftbl_cam_cc_sleep_clk_src
[] = {
767 F(32000, P_SLEEP_CLK
, 1, 0, 0),
771 static struct clk_rcg2 cam_cc_sleep_clk_src
= {
775 .parent_map
= cam_cc_parent_map_5
,
776 .freq_tbl
= ftbl_cam_cc_sleep_clk_src
,
777 .clkr
.hw
.init
= &(const struct clk_init_data
) {
778 .name
= "cam_cc_sleep_clk_src",
779 .parent_data
= cam_cc_parent_data_5
,
780 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_5
),
781 .flags
= CLK_SET_RATE_PARENT
,
782 .ops
= &clk_rcg2_shared_ops
,
786 static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src
[] = {
787 F(80000000, P_CAM_CC_PLL0_OUT_EVEN
, 7.5, 0, 0),
791 static struct clk_rcg2 cam_cc_slow_ahb_clk_src
= {
795 .parent_map
= cam_cc_parent_map_0
,
796 .freq_tbl
= ftbl_cam_cc_slow_ahb_clk_src
,
797 .clkr
.hw
.init
= &(const struct clk_init_data
) {
798 .name
= "cam_cc_slow_ahb_clk_src",
799 .parent_data
= cam_cc_parent_data_0
,
800 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_0
),
801 .flags
= CLK_SET_RATE_PARENT
,
802 .ops
= &clk_rcg2_shared_ops
,
806 static const struct freq_tbl ftbl_cam_cc_xo_clk_src
[] = {
807 F(19200000, P_BI_TCXO_AO
, 1, 0, 0),
811 static struct clk_rcg2 cam_cc_xo_clk_src
= {
815 .parent_map
= cam_cc_parent_map_6_ao
,
816 .freq_tbl
= ftbl_cam_cc_xo_clk_src
,
817 .clkr
.hw
.init
= &(const struct clk_init_data
) {
818 .name
= "cam_cc_xo_clk_src",
819 .parent_data
= cam_cc_parent_data_6_ao
,
820 .num_parents
= ARRAY_SIZE(cam_cc_parent_data_6_ao
),
821 .flags
= CLK_SET_RATE_PARENT
,
822 .ops
= &clk_rcg2_shared_ops
,
826 static struct clk_branch cam_cc_camnoc_axi_clk
= {
828 .halt_check
= BRANCH_HALT
,
830 .enable_reg
= 0x13188,
831 .enable_mask
= BIT(0),
832 .hw
.init
= &(const struct clk_init_data
) {
833 .name
= "cam_cc_camnoc_axi_clk",
834 .parent_hws
= (const struct clk_hw
*[]) {
835 &cam_cc_camnoc_axi_clk_src
.clkr
.hw
,
838 .flags
= CLK_SET_RATE_PARENT
,
839 .ops
= &clk_branch2_ops
,
844 static struct clk_branch cam_cc_camnoc_dcd_xo_clk
= {
846 .halt_check
= BRANCH_HALT
,
848 .enable_reg
= 0x13190,
849 .enable_mask
= BIT(0),
850 .hw
.init
= &(const struct clk_init_data
) {
851 .name
= "cam_cc_camnoc_dcd_xo_clk",
852 .parent_hws
= (const struct clk_hw
*[]) {
853 &cam_cc_xo_clk_src
.clkr
.hw
,
856 .flags
= CLK_SET_RATE_PARENT
,
857 .ops
= &clk_branch2_ops
,
862 static struct clk_branch cam_cc_qdss_debug_xo_clk
= {
864 .halt_check
= BRANCH_HALT
,
866 .enable_reg
= 0x131b8,
867 .enable_mask
= BIT(0),
868 .hw
.init
= &(const struct clk_init_data
) {
869 .name
= "cam_cc_qdss_debug_xo_clk",
870 .parent_hws
= (const struct clk_hw
*[]) {
871 &cam_cc_xo_clk_src
.clkr
.hw
,
874 .flags
= CLK_SET_RATE_PARENT
,
875 .ops
= &clk_branch2_ops
,
880 static struct clk_branch cam_cc_cci_0_clk
= {
882 .halt_check
= BRANCH_HALT
,
884 .enable_reg
= 0x130b8,
885 .enable_mask
= BIT(0),
886 .hw
.init
= &(const struct clk_init_data
) {
887 .name
= "cam_cc_cci_0_clk",
888 .parent_hws
= (const struct clk_hw
*[]) {
889 &cam_cc_cci_0_clk_src
.clkr
.hw
,
892 .flags
= CLK_SET_RATE_PARENT
,
893 .ops
= &clk_branch2_ops
,
898 static struct clk_branch cam_cc_cci_1_clk
= {
900 .halt_check
= BRANCH_HALT
,
902 .enable_reg
= 0x130d4,
903 .enable_mask
= BIT(0),
904 .hw
.init
= &(const struct clk_init_data
) {
905 .name
= "cam_cc_cci_1_clk",
906 .parent_hws
= (const struct clk_hw
*[]) {
907 &cam_cc_cci_1_clk_src
.clkr
.hw
,
910 .flags
= CLK_SET_RATE_PARENT
,
911 .ops
= &clk_branch2_ops
,
916 static struct clk_branch cam_cc_cci_2_clk
= {
918 .halt_check
= BRANCH_HALT
,
920 .enable_reg
= 0x130f0,
921 .enable_mask
= BIT(0),
922 .hw
.init
= &(const struct clk_init_data
) {
923 .name
= "cam_cc_cci_2_clk",
924 .parent_hws
= (const struct clk_hw
*[]) {
925 &cam_cc_cci_2_clk_src
.clkr
.hw
,
928 .flags
= CLK_SET_RATE_PARENT
,
929 .ops
= &clk_branch2_ops
,
934 static struct clk_branch cam_cc_cci_3_clk
= {
936 .halt_check
= BRANCH_HALT
,
938 .enable_reg
= 0x1310c,
939 .enable_mask
= BIT(0),
940 .hw
.init
= &(const struct clk_init_data
) {
941 .name
= "cam_cc_cci_3_clk",
942 .parent_hws
= (const struct clk_hw
*[]) {
943 &cam_cc_cci_3_clk_src
.clkr
.hw
,
946 .flags
= CLK_SET_RATE_PARENT
,
947 .ops
= &clk_branch2_ops
,
952 static struct clk_branch cam_cc_core_ahb_clk
= {
954 .halt_check
= BRANCH_HALT_DELAY
,
956 .enable_reg
= 0x131d0,
957 .enable_mask
= BIT(0),
958 .hw
.init
= &(const struct clk_init_data
) {
959 .name
= "cam_cc_core_ahb_clk",
960 .parent_hws
= (const struct clk_hw
*[]) {
961 &cam_cc_slow_ahb_clk_src
.clkr
.hw
,
964 .flags
= CLK_SET_RATE_PARENT
,
965 .ops
= &clk_branch2_ops
,
970 static struct clk_branch cam_cc_cpas_ahb_clk
= {
972 .halt_check
= BRANCH_HALT
,
974 .enable_reg
= 0x13110,
975 .enable_mask
= BIT(0),
976 .hw
.init
= &(const struct clk_init_data
) {
977 .name
= "cam_cc_cpas_ahb_clk",
978 .parent_hws
= (const struct clk_hw
*[]) {
979 &cam_cc_slow_ahb_clk_src
.clkr
.hw
,
982 .flags
= CLK_SET_RATE_PARENT
,
983 .ops
= &clk_branch2_ops
,
988 static struct clk_branch cam_cc_cpas_fast_ahb_clk
= {
990 .halt_check
= BRANCH_HALT
,
992 .enable_reg
= 0x13118,
993 .enable_mask
= BIT(0),
994 .hw
.init
= &(const struct clk_init_data
) {
995 .name
= "cam_cc_cpas_fast_ahb_clk",
996 .parent_hws
= (const struct clk_hw
*[]) {
997 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1000 .flags
= CLK_SET_RATE_PARENT
,
1001 .ops
= &clk_branch2_ops
,
1006 static struct clk_branch cam_cc_cpas_ife_0_clk
= {
1007 .halt_reg
= 0x11024,
1008 .halt_check
= BRANCH_HALT
,
1010 .enable_reg
= 0x11024,
1011 .enable_mask
= BIT(0),
1012 .hw
.init
= &(const struct clk_init_data
) {
1013 .name
= "cam_cc_cpas_ife_0_clk",
1014 .parent_hws
= (const struct clk_hw
*[]) {
1015 &cam_cc_ife_0_clk_src
.clkr
.hw
,
1018 .flags
= CLK_SET_RATE_PARENT
,
1019 .ops
= &clk_branch2_ops
,
1024 static struct clk_branch cam_cc_cpas_ife_1_clk
= {
1025 .halt_reg
= 0x12024,
1026 .halt_check
= BRANCH_HALT
,
1028 .enable_reg
= 0x12024,
1029 .enable_mask
= BIT(0),
1030 .hw
.init
= &(const struct clk_init_data
) {
1031 .name
= "cam_cc_cpas_ife_1_clk",
1032 .parent_hws
= (const struct clk_hw
*[]) {
1033 &cam_cc_ife_1_clk_src
.clkr
.hw
,
1036 .flags
= CLK_SET_RATE_PARENT
,
1037 .ops
= &clk_branch2_ops
,
1042 static struct clk_branch cam_cc_cpas_ife_lite_clk
= {
1043 .halt_reg
= 0x1301c,
1044 .halt_check
= BRANCH_HALT
,
1046 .enable_reg
= 0x1301c,
1047 .enable_mask
= BIT(0),
1048 .hw
.init
= &(const struct clk_init_data
) {
1049 .name
= "cam_cc_cpas_ife_lite_clk",
1050 .parent_hws
= (const struct clk_hw
*[]) {
1051 &cam_cc_ife_lite_clk_src
.clkr
.hw
,
1054 .flags
= CLK_SET_RATE_PARENT
,
1055 .ops
= &clk_branch2_ops
,
1060 static struct clk_branch cam_cc_cpas_ipe_clk
= {
1061 .halt_reg
= 0x10024,
1062 .halt_check
= BRANCH_HALT
,
1064 .enable_reg
= 0x10024,
1065 .enable_mask
= BIT(0),
1066 .hw
.init
= &(const struct clk_init_data
) {
1067 .name
= "cam_cc_cpas_ipe_clk",
1068 .parent_hws
= (const struct clk_hw
*[]) {
1069 &cam_cc_ipe_clk_src
.clkr
.hw
,
1072 .flags
= CLK_SET_RATE_PARENT
,
1073 .ops
= &clk_branch2_ops
,
1078 static struct clk_branch cam_cc_cpas_sfe_lite_0_clk
= {
1079 .halt_reg
= 0x13050,
1080 .halt_check
= BRANCH_HALT
,
1082 .enable_reg
= 0x13050,
1083 .enable_mask
= BIT(0),
1084 .hw
.init
= &(const struct clk_init_data
) {
1085 .name
= "cam_cc_cpas_sfe_lite_0_clk",
1086 .parent_hws
= (const struct clk_hw
*[]) {
1087 &cam_cc_ife_0_clk_src
.clkr
.hw
,
1090 .flags
= CLK_SET_RATE_PARENT
,
1091 .ops
= &clk_branch2_ops
,
1096 static struct clk_branch cam_cc_cpas_sfe_lite_1_clk
= {
1097 .halt_reg
= 0x13068,
1098 .halt_check
= BRANCH_HALT
,
1100 .enable_reg
= 0x13068,
1101 .enable_mask
= BIT(0),
1102 .hw
.init
= &(const struct clk_init_data
) {
1103 .name
= "cam_cc_cpas_sfe_lite_1_clk",
1104 .parent_hws
= (const struct clk_hw
*[]) {
1105 &cam_cc_ife_1_clk_src
.clkr
.hw
,
1108 .flags
= CLK_SET_RATE_PARENT
,
1109 .ops
= &clk_branch2_ops
,
1114 static struct clk_branch cam_cc_csi0phytimer_clk
= {
1115 .halt_reg
= 0x1508c,
1116 .halt_check
= BRANCH_HALT
,
1118 .enable_reg
= 0x1508c,
1119 .enable_mask
= BIT(0),
1120 .hw
.init
= &(const struct clk_init_data
) {
1121 .name
= "cam_cc_csi0phytimer_clk",
1122 .parent_hws
= (const struct clk_hw
*[]) {
1123 &cam_cc_csi0phytimer_clk_src
.clkr
.hw
,
1126 .flags
= CLK_SET_RATE_PARENT
,
1127 .ops
= &clk_branch2_ops
,
1132 static struct clk_branch cam_cc_csi1phytimer_clk
= {
1133 .halt_reg
= 0x150b0,
1134 .halt_check
= BRANCH_HALT
,
1136 .enable_reg
= 0x150b0,
1137 .enable_mask
= BIT(0),
1138 .hw
.init
= &(const struct clk_init_data
) {
1139 .name
= "cam_cc_csi1phytimer_clk",
1140 .parent_hws
= (const struct clk_hw
*[]) {
1141 &cam_cc_csi1phytimer_clk_src
.clkr
.hw
,
1144 .flags
= CLK_SET_RATE_PARENT
,
1145 .ops
= &clk_branch2_ops
,
1150 static struct clk_branch cam_cc_csi2phytimer_clk
= {
1151 .halt_reg
= 0x150d0,
1152 .halt_check
= BRANCH_HALT
,
1154 .enable_reg
= 0x150d0,
1155 .enable_mask
= BIT(0),
1156 .hw
.init
= &(const struct clk_init_data
) {
1157 .name
= "cam_cc_csi2phytimer_clk",
1158 .parent_hws
= (const struct clk_hw
*[]) {
1159 &cam_cc_csi2phytimer_clk_src
.clkr
.hw
,
1162 .flags
= CLK_SET_RATE_PARENT
,
1163 .ops
= &clk_branch2_ops
,
1168 static struct clk_branch cam_cc_csi3phytimer_clk
= {
1169 .halt_reg
= 0x150f0,
1170 .halt_check
= BRANCH_HALT
,
1172 .enable_reg
= 0x150f0,
1173 .enable_mask
= BIT(0),
1174 .hw
.init
= &(const struct clk_init_data
) {
1175 .name
= "cam_cc_csi3phytimer_clk",
1176 .parent_hws
= (const struct clk_hw
*[]) {
1177 &cam_cc_csi3phytimer_clk_src
.clkr
.hw
,
1180 .flags
= CLK_SET_RATE_PARENT
,
1181 .ops
= &clk_branch2_ops
,
1186 static struct clk_branch cam_cc_csid_clk
= {
1187 .halt_reg
= 0x13168,
1188 .halt_check
= BRANCH_HALT
,
1190 .enable_reg
= 0x13168,
1191 .enable_mask
= BIT(0),
1192 .hw
.init
= &(const struct clk_init_data
) {
1193 .name
= "cam_cc_csid_clk",
1194 .parent_hws
= (const struct clk_hw
*[]) {
1195 &cam_cc_csid_clk_src
.clkr
.hw
,
1198 .flags
= CLK_SET_RATE_PARENT
,
1199 .ops
= &clk_branch2_ops
,
1204 static struct clk_branch cam_cc_csid_csiphy_rx_clk
= {
1205 .halt_reg
= 0x15094,
1206 .halt_check
= BRANCH_HALT
,
1208 .enable_reg
= 0x15094,
1209 .enable_mask
= BIT(0),
1210 .hw
.init
= &(const struct clk_init_data
) {
1211 .name
= "cam_cc_csid_csiphy_rx_clk",
1212 .parent_hws
= (const struct clk_hw
*[]) {
1213 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1216 .flags
= CLK_SET_RATE_PARENT
,
1217 .ops
= &clk_branch2_ops
,
1222 static struct clk_branch cam_cc_csiphy0_clk
= {
1223 .halt_reg
= 0x15090,
1224 .halt_check
= BRANCH_HALT
,
1226 .enable_reg
= 0x15090,
1227 .enable_mask
= BIT(0),
1228 .hw
.init
= &(const struct clk_init_data
) {
1229 .name
= "cam_cc_csiphy0_clk",
1230 .parent_hws
= (const struct clk_hw
*[]) {
1231 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1234 .flags
= CLK_SET_RATE_PARENT
,
1235 .ops
= &clk_branch2_ops
,
1240 static struct clk_branch cam_cc_csiphy1_clk
= {
1241 .halt_reg
= 0x150b4,
1242 .halt_check
= BRANCH_HALT
,
1244 .enable_reg
= 0x150b4,
1245 .enable_mask
= BIT(0),
1246 .hw
.init
= &(const struct clk_init_data
) {
1247 .name
= "cam_cc_csiphy1_clk",
1248 .parent_hws
= (const struct clk_hw
*[]) {
1249 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1252 .flags
= CLK_SET_RATE_PARENT
,
1253 .ops
= &clk_branch2_ops
,
1258 static struct clk_branch cam_cc_csiphy2_clk
= {
1259 .halt_reg
= 0x150d4,
1260 .halt_check
= BRANCH_HALT
,
1262 .enable_reg
= 0x150d4,
1263 .enable_mask
= BIT(0),
1264 .hw
.init
= &(const struct clk_init_data
) {
1265 .name
= "cam_cc_csiphy2_clk",
1266 .parent_hws
= (const struct clk_hw
*[]) {
1267 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1270 .flags
= CLK_SET_RATE_PARENT
,
1271 .ops
= &clk_branch2_ops
,
1276 static struct clk_branch cam_cc_csiphy3_clk
= {
1277 .halt_reg
= 0x150f4,
1278 .halt_check
= BRANCH_HALT
,
1280 .enable_reg
= 0x150f4,
1281 .enable_mask
= BIT(0),
1282 .hw
.init
= &(const struct clk_init_data
) {
1283 .name
= "cam_cc_csiphy3_clk",
1284 .parent_hws
= (const struct clk_hw
*[]) {
1285 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1288 .flags
= CLK_SET_RATE_PARENT
,
1289 .ops
= &clk_branch2_ops
,
1294 static struct clk_branch cam_cc_icp_ahb_clk
= {
1295 .halt_reg
= 0x1309c,
1296 .halt_check
= BRANCH_HALT
,
1298 .enable_reg
= 0x1309c,
1299 .enable_mask
= BIT(0),
1300 .hw
.init
= &(const struct clk_init_data
) {
1301 .name
= "cam_cc_icp_ahb_clk",
1302 .parent_hws
= (const struct clk_hw
*[]) {
1303 &cam_cc_slow_ahb_clk_src
.clkr
.hw
,
1306 .flags
= CLK_SET_RATE_PARENT
,
1307 .ops
= &clk_branch2_ops
,
1312 static struct clk_branch cam_cc_icp_clk
= {
1313 .halt_reg
= 0x13094,
1314 .halt_check
= BRANCH_HALT
,
1316 .enable_reg
= 0x13094,
1317 .enable_mask
= BIT(0),
1318 .hw
.init
= &(const struct clk_init_data
) {
1319 .name
= "cam_cc_icp_clk",
1320 .parent_hws
= (const struct clk_hw
*[]) {
1321 &cam_cc_icp_clk_src
.clkr
.hw
,
1324 .flags
= CLK_SET_RATE_PARENT
,
1325 .ops
= &clk_branch2_ops
,
1330 static struct clk_branch cam_cc_ife_0_clk
= {
1331 .halt_reg
= 0x1101c,
1332 .halt_check
= BRANCH_HALT
,
1334 .enable_reg
= 0x1101c,
1335 .enable_mask
= BIT(0),
1336 .hw
.init
= &(const struct clk_init_data
) {
1337 .name
= "cam_cc_ife_0_clk",
1338 .parent_hws
= (const struct clk_hw
*[]) {
1339 &cam_cc_ife_0_clk_src
.clkr
.hw
,
1342 .flags
= CLK_SET_RATE_PARENT
,
1343 .ops
= &clk_branch2_ops
,
1348 static struct clk_branch cam_cc_ife_0_fast_ahb_clk
= {
1349 .halt_reg
= 0x11030,
1350 .halt_check
= BRANCH_HALT
,
1352 .enable_reg
= 0x11030,
1353 .enable_mask
= BIT(0),
1354 .hw
.init
= &(const struct clk_init_data
) {
1355 .name
= "cam_cc_ife_0_fast_ahb_clk",
1356 .parent_hws
= (const struct clk_hw
*[]) {
1357 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1360 .flags
= CLK_SET_RATE_PARENT
,
1361 .ops
= &clk_branch2_ops
,
1366 static struct clk_branch cam_cc_ife_1_clk
= {
1367 .halt_reg
= 0x1201c,
1368 .halt_check
= BRANCH_HALT
,
1370 .enable_reg
= 0x1201c,
1371 .enable_mask
= BIT(0),
1372 .hw
.init
= &(const struct clk_init_data
) {
1373 .name
= "cam_cc_ife_1_clk",
1374 .parent_hws
= (const struct clk_hw
*[]) {
1375 &cam_cc_ife_1_clk_src
.clkr
.hw
,
1378 .flags
= CLK_SET_RATE_PARENT
,
1379 .ops
= &clk_branch2_ops
,
1384 static struct clk_branch cam_cc_ife_1_fast_ahb_clk
= {
1385 .halt_reg
= 0x12030,
1386 .halt_check
= BRANCH_HALT
,
1388 .enable_reg
= 0x12030,
1389 .enable_mask
= BIT(0),
1390 .hw
.init
= &(const struct clk_init_data
) {
1391 .name
= "cam_cc_ife_1_fast_ahb_clk",
1392 .parent_hws
= (const struct clk_hw
*[]) {
1393 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1396 .flags
= CLK_SET_RATE_PARENT
,
1397 .ops
= &clk_branch2_ops
,
1402 static struct clk_branch cam_cc_ife_lite_ahb_clk
= {
1403 .halt_reg
= 0x13044,
1404 .halt_check
= BRANCH_HALT
,
1406 .enable_reg
= 0x13044,
1407 .enable_mask
= BIT(0),
1408 .hw
.init
= &(const struct clk_init_data
) {
1409 .name
= "cam_cc_ife_lite_ahb_clk",
1410 .parent_hws
= (const struct clk_hw
*[]) {
1411 &cam_cc_slow_ahb_clk_src
.clkr
.hw
,
1414 .flags
= CLK_SET_RATE_PARENT
,
1415 .ops
= &clk_branch2_ops
,
1420 static struct clk_branch cam_cc_ife_lite_clk
= {
1421 .halt_reg
= 0x13018,
1422 .halt_check
= BRANCH_HALT
,
1424 .enable_reg
= 0x13018,
1425 .enable_mask
= BIT(0),
1426 .hw
.init
= &(const struct clk_init_data
) {
1427 .name
= "cam_cc_ife_lite_clk",
1428 .parent_hws
= (const struct clk_hw
*[]) {
1429 &cam_cc_ife_lite_clk_src
.clkr
.hw
,
1432 .flags
= CLK_SET_RATE_PARENT
,
1433 .ops
= &clk_branch2_ops
,
1438 static struct clk_branch cam_cc_ife_lite_cphy_rx_clk
= {
1439 .halt_reg
= 0x13040,
1440 .halt_check
= BRANCH_HALT
,
1442 .enable_reg
= 0x13040,
1443 .enable_mask
= BIT(0),
1444 .hw
.init
= &(const struct clk_init_data
) {
1445 .name
= "cam_cc_ife_lite_cphy_rx_clk",
1446 .parent_hws
= (const struct clk_hw
*[]) {
1447 &cam_cc_cphy_rx_clk_src
.clkr
.hw
,
1450 .flags
= CLK_SET_RATE_PARENT
,
1451 .ops
= &clk_branch2_ops
,
1456 static struct clk_branch cam_cc_ife_lite_csid_clk
= {
1457 .halt_reg
= 0x13038,
1458 .halt_check
= BRANCH_HALT
,
1460 .enable_reg
= 0x13038,
1461 .enable_mask
= BIT(0),
1462 .hw
.init
= &(const struct clk_init_data
) {
1463 .name
= "cam_cc_ife_lite_csid_clk",
1464 .parent_hws
= (const struct clk_hw
*[]) {
1465 &cam_cc_ife_lite_csid_clk_src
.clkr
.hw
,
1468 .flags
= CLK_SET_RATE_PARENT
,
1469 .ops
= &clk_branch2_ops
,
1474 static struct clk_branch cam_cc_ipe_ahb_clk
= {
1475 .halt_reg
= 0x10030,
1476 .halt_check
= BRANCH_HALT
,
1478 .enable_reg
= 0x10030,
1479 .enable_mask
= BIT(0),
1480 .hw
.init
= &(const struct clk_init_data
) {
1481 .name
= "cam_cc_ipe_ahb_clk",
1482 .parent_hws
= (const struct clk_hw
*[]) {
1483 &cam_cc_slow_ahb_clk_src
.clkr
.hw
,
1486 .flags
= CLK_SET_RATE_PARENT
,
1487 .ops
= &clk_branch2_ops
,
1492 static struct clk_branch cam_cc_ipe_clk
= {
1493 .halt_reg
= 0x1001c,
1494 .halt_check
= BRANCH_HALT
,
1496 .enable_reg
= 0x1001c,
1497 .enable_mask
= BIT(0),
1498 .hw
.init
= &(const struct clk_init_data
) {
1499 .name
= "cam_cc_ipe_clk",
1500 .parent_hws
= (const struct clk_hw
*[]) {
1501 &cam_cc_ipe_clk_src
.clkr
.hw
,
1504 .flags
= CLK_SET_RATE_PARENT
,
1505 .ops
= &clk_branch2_ops
,
1510 static struct clk_branch cam_cc_ipe_fast_ahb_clk
= {
1511 .halt_reg
= 0x10034,
1512 .halt_check
= BRANCH_HALT
,
1514 .enable_reg
= 0x10034,
1515 .enable_mask
= BIT(0),
1516 .hw
.init
= &(const struct clk_init_data
) {
1517 .name
= "cam_cc_ipe_fast_ahb_clk",
1518 .parent_hws
= (const struct clk_hw
*[]) {
1519 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1522 .flags
= CLK_SET_RATE_PARENT
,
1523 .ops
= &clk_branch2_ops
,
1528 static struct clk_branch cam_cc_mclk0_clk
= {
1529 .halt_reg
= 0x1501c,
1530 .halt_check
= BRANCH_HALT
,
1532 .enable_reg
= 0x1501c,
1533 .enable_mask
= BIT(0),
1534 .hw
.init
= &(const struct clk_init_data
) {
1535 .name
= "cam_cc_mclk0_clk",
1536 .parent_hws
= (const struct clk_hw
*[]) {
1537 &cam_cc_mclk0_clk_src
.clkr
.hw
,
1540 .flags
= CLK_SET_RATE_PARENT
,
1541 .ops
= &clk_branch2_ops
,
1546 static struct clk_branch cam_cc_mclk1_clk
= {
1547 .halt_reg
= 0x15038,
1548 .halt_check
= BRANCH_HALT
,
1550 .enable_reg
= 0x15038,
1551 .enable_mask
= BIT(0),
1552 .hw
.init
= &(const struct clk_init_data
) {
1553 .name
= "cam_cc_mclk1_clk",
1554 .parent_hws
= (const struct clk_hw
*[]) {
1555 &cam_cc_mclk1_clk_src
.clkr
.hw
,
1558 .flags
= CLK_SET_RATE_PARENT
,
1559 .ops
= &clk_branch2_ops
,
1564 static struct clk_branch cam_cc_mclk2_clk
= {
1565 .halt_reg
= 0x15054,
1566 .halt_check
= BRANCH_HALT
,
1568 .enable_reg
= 0x15054,
1569 .enable_mask
= BIT(0),
1570 .hw
.init
= &(const struct clk_init_data
) {
1571 .name
= "cam_cc_mclk2_clk",
1572 .parent_hws
= (const struct clk_hw
*[]) {
1573 &cam_cc_mclk2_clk_src
.clkr
.hw
,
1576 .flags
= CLK_SET_RATE_PARENT
,
1577 .ops
= &clk_branch2_ops
,
1582 static struct clk_branch cam_cc_mclk3_clk
= {
1583 .halt_reg
= 0x15070,
1584 .halt_check
= BRANCH_HALT
,
1586 .enable_reg
= 0x15070,
1587 .enable_mask
= BIT(0),
1588 .hw
.init
= &(const struct clk_init_data
) {
1589 .name
= "cam_cc_mclk3_clk",
1590 .parent_hws
= (const struct clk_hw
*[]) {
1591 &cam_cc_mclk3_clk_src
.clkr
.hw
,
1594 .flags
= CLK_SET_RATE_PARENT
,
1595 .ops
= &clk_branch2_ops
,
1600 static struct clk_branch cam_cc_sfe_lite_0_clk
= {
1601 .halt_reg
= 0x1304c,
1602 .halt_check
= BRANCH_HALT
,
1604 .enable_reg
= 0x1304c,
1605 .enable_mask
= BIT(0),
1606 .hw
.init
= &(const struct clk_init_data
) {
1607 .name
= "cam_cc_sfe_lite_0_clk",
1608 .parent_hws
= (const struct clk_hw
*[]) {
1609 &cam_cc_ife_0_clk_src
.clkr
.hw
,
1612 .flags
= CLK_SET_RATE_PARENT
,
1613 .ops
= &clk_branch2_ops
,
1618 static struct clk_branch cam_cc_sfe_lite_0_fast_ahb_clk
= {
1619 .halt_reg
= 0x1305c,
1620 .halt_check
= BRANCH_HALT
,
1622 .enable_reg
= 0x1305c,
1623 .enable_mask
= BIT(0),
1624 .hw
.init
= &(const struct clk_init_data
) {
1625 .name
= "cam_cc_sfe_lite_0_fast_ahb_clk",
1626 .parent_hws
= (const struct clk_hw
*[]) {
1627 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1630 .flags
= CLK_SET_RATE_PARENT
,
1631 .ops
= &clk_branch2_ops
,
1636 static struct clk_branch cam_cc_sfe_lite_1_clk
= {
1637 .halt_reg
= 0x13064,
1638 .halt_check
= BRANCH_HALT
,
1640 .enable_reg
= 0x13064,
1641 .enable_mask
= BIT(0),
1642 .hw
.init
= &(const struct clk_init_data
) {
1643 .name
= "cam_cc_sfe_lite_1_clk",
1644 .parent_hws
= (const struct clk_hw
*[]) {
1645 &cam_cc_ife_1_clk_src
.clkr
.hw
,
1648 .flags
= CLK_SET_RATE_PARENT
,
1649 .ops
= &clk_branch2_ops
,
1654 static struct clk_branch cam_cc_sfe_lite_1_fast_ahb_clk
= {
1655 .halt_reg
= 0x13074,
1656 .halt_check
= BRANCH_HALT
,
1658 .enable_reg
= 0x13074,
1659 .enable_mask
= BIT(0),
1660 .hw
.init
= &(const struct clk_init_data
) {
1661 .name
= "cam_cc_sfe_lite_1_fast_ahb_clk",
1662 .parent_hws
= (const struct clk_hw
*[]) {
1663 &cam_cc_fast_ahb_clk_src
.clkr
.hw
,
1666 .flags
= CLK_SET_RATE_PARENT
,
1667 .ops
= &clk_branch2_ops
,
1672 static struct clk_branch cam_cc_sm_obs_clk
= {
1673 .halt_reg
= 0x1510c,
1674 .halt_check
= BRANCH_HALT_SKIP
,
1676 .enable_reg
= 0x1510c,
1677 .enable_mask
= BIT(0),
1678 .hw
.init
= &(const struct clk_init_data
) {
1679 .name
= "cam_cc_sm_obs_clk",
1680 .ops
= &clk_branch2_ops
,
1685 static struct gdsc cam_cc_titan_top_gdsc
= {
1687 .en_rest_wait_val
= 0x2,
1688 .en_few_wait_val
= 0x2,
1689 .clk_dis_wait_val
= 0xf,
1691 .name
= "cam_cc_titan_top_gdsc",
1693 .pwrsts
= PWRSTS_OFF_ON
,
1694 .flags
= POLL_CFG_GDSCR
| RETAIN_FF_ENABLE
,
1697 static struct clk_regmap
*cam_cc_sa8775p_clocks
[] = {
1698 [CAM_CC_CAMNOC_AXI_CLK
] = &cam_cc_camnoc_axi_clk
.clkr
,
1699 [CAM_CC_CAMNOC_AXI_CLK_SRC
] = &cam_cc_camnoc_axi_clk_src
.clkr
,
1700 [CAM_CC_CAMNOC_DCD_XO_CLK
] = &cam_cc_camnoc_dcd_xo_clk
.clkr
,
1701 [CAM_CC_CCI_0_CLK
] = &cam_cc_cci_0_clk
.clkr
,
1702 [CAM_CC_CCI_0_CLK_SRC
] = &cam_cc_cci_0_clk_src
.clkr
,
1703 [CAM_CC_CCI_1_CLK
] = &cam_cc_cci_1_clk
.clkr
,
1704 [CAM_CC_CCI_1_CLK_SRC
] = &cam_cc_cci_1_clk_src
.clkr
,
1705 [CAM_CC_CCI_2_CLK
] = &cam_cc_cci_2_clk
.clkr
,
1706 [CAM_CC_CCI_2_CLK_SRC
] = &cam_cc_cci_2_clk_src
.clkr
,
1707 [CAM_CC_CCI_3_CLK
] = &cam_cc_cci_3_clk
.clkr
,
1708 [CAM_CC_CCI_3_CLK_SRC
] = &cam_cc_cci_3_clk_src
.clkr
,
1709 [CAM_CC_CORE_AHB_CLK
] = &cam_cc_core_ahb_clk
.clkr
,
1710 [CAM_CC_CPAS_AHB_CLK
] = &cam_cc_cpas_ahb_clk
.clkr
,
1711 [CAM_CC_CPAS_FAST_AHB_CLK
] = &cam_cc_cpas_fast_ahb_clk
.clkr
,
1712 [CAM_CC_CPAS_IFE_0_CLK
] = &cam_cc_cpas_ife_0_clk
.clkr
,
1713 [CAM_CC_CPAS_IFE_1_CLK
] = &cam_cc_cpas_ife_1_clk
.clkr
,
1714 [CAM_CC_CPAS_IFE_LITE_CLK
] = &cam_cc_cpas_ife_lite_clk
.clkr
,
1715 [CAM_CC_CPAS_IPE_CLK
] = &cam_cc_cpas_ipe_clk
.clkr
,
1716 [CAM_CC_CPAS_SFE_LITE_0_CLK
] = &cam_cc_cpas_sfe_lite_0_clk
.clkr
,
1717 [CAM_CC_CPAS_SFE_LITE_1_CLK
] = &cam_cc_cpas_sfe_lite_1_clk
.clkr
,
1718 [CAM_CC_CPHY_RX_CLK_SRC
] = &cam_cc_cphy_rx_clk_src
.clkr
,
1719 [CAM_CC_CSI0PHYTIMER_CLK
] = &cam_cc_csi0phytimer_clk
.clkr
,
1720 [CAM_CC_CSI0PHYTIMER_CLK_SRC
] = &cam_cc_csi0phytimer_clk_src
.clkr
,
1721 [CAM_CC_CSI1PHYTIMER_CLK
] = &cam_cc_csi1phytimer_clk
.clkr
,
1722 [CAM_CC_CSI1PHYTIMER_CLK_SRC
] = &cam_cc_csi1phytimer_clk_src
.clkr
,
1723 [CAM_CC_CSI2PHYTIMER_CLK
] = &cam_cc_csi2phytimer_clk
.clkr
,
1724 [CAM_CC_CSI2PHYTIMER_CLK_SRC
] = &cam_cc_csi2phytimer_clk_src
.clkr
,
1725 [CAM_CC_CSI3PHYTIMER_CLK
] = &cam_cc_csi3phytimer_clk
.clkr
,
1726 [CAM_CC_CSI3PHYTIMER_CLK_SRC
] = &cam_cc_csi3phytimer_clk_src
.clkr
,
1727 [CAM_CC_CSID_CLK
] = &cam_cc_csid_clk
.clkr
,
1728 [CAM_CC_CSID_CLK_SRC
] = &cam_cc_csid_clk_src
.clkr
,
1729 [CAM_CC_CSID_CSIPHY_RX_CLK
] = &cam_cc_csid_csiphy_rx_clk
.clkr
,
1730 [CAM_CC_CSIPHY0_CLK
] = &cam_cc_csiphy0_clk
.clkr
,
1731 [CAM_CC_CSIPHY1_CLK
] = &cam_cc_csiphy1_clk
.clkr
,
1732 [CAM_CC_CSIPHY2_CLK
] = &cam_cc_csiphy2_clk
.clkr
,
1733 [CAM_CC_CSIPHY3_CLK
] = &cam_cc_csiphy3_clk
.clkr
,
1734 [CAM_CC_FAST_AHB_CLK_SRC
] = &cam_cc_fast_ahb_clk_src
.clkr
,
1735 [CAM_CC_ICP_AHB_CLK
] = &cam_cc_icp_ahb_clk
.clkr
,
1736 [CAM_CC_ICP_CLK
] = &cam_cc_icp_clk
.clkr
,
1737 [CAM_CC_ICP_CLK_SRC
] = &cam_cc_icp_clk_src
.clkr
,
1738 [CAM_CC_IFE_0_CLK
] = &cam_cc_ife_0_clk
.clkr
,
1739 [CAM_CC_IFE_0_CLK_SRC
] = &cam_cc_ife_0_clk_src
.clkr
,
1740 [CAM_CC_IFE_0_FAST_AHB_CLK
] = &cam_cc_ife_0_fast_ahb_clk
.clkr
,
1741 [CAM_CC_IFE_1_CLK
] = &cam_cc_ife_1_clk
.clkr
,
1742 [CAM_CC_IFE_1_CLK_SRC
] = &cam_cc_ife_1_clk_src
.clkr
,
1743 [CAM_CC_IFE_1_FAST_AHB_CLK
] = &cam_cc_ife_1_fast_ahb_clk
.clkr
,
1744 [CAM_CC_IFE_LITE_AHB_CLK
] = &cam_cc_ife_lite_ahb_clk
.clkr
,
1745 [CAM_CC_IFE_LITE_CLK
] = &cam_cc_ife_lite_clk
.clkr
,
1746 [CAM_CC_IFE_LITE_CLK_SRC
] = &cam_cc_ife_lite_clk_src
.clkr
,
1747 [CAM_CC_IFE_LITE_CPHY_RX_CLK
] = &cam_cc_ife_lite_cphy_rx_clk
.clkr
,
1748 [CAM_CC_IFE_LITE_CSID_CLK
] = &cam_cc_ife_lite_csid_clk
.clkr
,
1749 [CAM_CC_IFE_LITE_CSID_CLK_SRC
] = &cam_cc_ife_lite_csid_clk_src
.clkr
,
1750 [CAM_CC_IPE_AHB_CLK
] = &cam_cc_ipe_ahb_clk
.clkr
,
1751 [CAM_CC_IPE_CLK
] = &cam_cc_ipe_clk
.clkr
,
1752 [CAM_CC_IPE_CLK_SRC
] = &cam_cc_ipe_clk_src
.clkr
,
1753 [CAM_CC_IPE_FAST_AHB_CLK
] = &cam_cc_ipe_fast_ahb_clk
.clkr
,
1754 [CAM_CC_MCLK0_CLK
] = &cam_cc_mclk0_clk
.clkr
,
1755 [CAM_CC_MCLK0_CLK_SRC
] = &cam_cc_mclk0_clk_src
.clkr
,
1756 [CAM_CC_MCLK1_CLK
] = &cam_cc_mclk1_clk
.clkr
,
1757 [CAM_CC_MCLK1_CLK_SRC
] = &cam_cc_mclk1_clk_src
.clkr
,
1758 [CAM_CC_MCLK2_CLK
] = &cam_cc_mclk2_clk
.clkr
,
1759 [CAM_CC_MCLK2_CLK_SRC
] = &cam_cc_mclk2_clk_src
.clkr
,
1760 [CAM_CC_MCLK3_CLK
] = &cam_cc_mclk3_clk
.clkr
,
1761 [CAM_CC_MCLK3_CLK_SRC
] = &cam_cc_mclk3_clk_src
.clkr
,
1762 [CAM_CC_PLL0
] = &cam_cc_pll0
.clkr
,
1763 [CAM_CC_PLL0_OUT_EVEN
] = &cam_cc_pll0_out_even
.clkr
,
1764 [CAM_CC_PLL0_OUT_ODD
] = &cam_cc_pll0_out_odd
.clkr
,
1765 [CAM_CC_PLL2
] = &cam_cc_pll2
.clkr
,
1766 [CAM_CC_PLL3
] = &cam_cc_pll3
.clkr
,
1767 [CAM_CC_PLL3_OUT_EVEN
] = &cam_cc_pll3_out_even
.clkr
,
1768 [CAM_CC_PLL4
] = &cam_cc_pll4
.clkr
,
1769 [CAM_CC_PLL4_OUT_EVEN
] = &cam_cc_pll4_out_even
.clkr
,
1770 [CAM_CC_PLL5
] = &cam_cc_pll5
.clkr
,
1771 [CAM_CC_PLL5_OUT_EVEN
] = &cam_cc_pll5_out_even
.clkr
,
1772 [CAM_CC_SFE_LITE_0_CLK
] = &cam_cc_sfe_lite_0_clk
.clkr
,
1773 [CAM_CC_SFE_LITE_0_FAST_AHB_CLK
] = &cam_cc_sfe_lite_0_fast_ahb_clk
.clkr
,
1774 [CAM_CC_SFE_LITE_1_CLK
] = &cam_cc_sfe_lite_1_clk
.clkr
,
1775 [CAM_CC_SFE_LITE_1_FAST_AHB_CLK
] = &cam_cc_sfe_lite_1_fast_ahb_clk
.clkr
,
1776 [CAM_CC_SLEEP_CLK_SRC
] = &cam_cc_sleep_clk_src
.clkr
,
1777 [CAM_CC_SLOW_AHB_CLK_SRC
] = &cam_cc_slow_ahb_clk_src
.clkr
,
1778 [CAM_CC_SM_OBS_CLK
] = &cam_cc_sm_obs_clk
.clkr
,
1779 [CAM_CC_XO_CLK_SRC
] = &cam_cc_xo_clk_src
.clkr
,
1780 [CAM_CC_QDSS_DEBUG_XO_CLK
] = &cam_cc_qdss_debug_xo_clk
.clkr
,
1783 static struct gdsc
*cam_cc_sa8775p_gdscs
[] = {
1784 [CAM_CC_TITAN_TOP_GDSC
] = &cam_cc_titan_top_gdsc
,
1787 static const struct qcom_reset_map cam_cc_sa8775p_resets
[] = {
1788 [CAM_CC_ICP_BCR
] = { 0x13078 },
1789 [CAM_CC_IFE_0_BCR
] = { 0x11000 },
1790 [CAM_CC_IFE_1_BCR
] = { 0x12000 },
1791 [CAM_CC_IPE_0_BCR
] = { 0x10000 },
1792 [CAM_CC_SFE_LITE_0_BCR
] = { 0x13048 },
1793 [CAM_CC_SFE_LITE_1_BCR
] = { 0x13060 },
1796 static const struct regmap_config cam_cc_sa8775p_regmap_config
= {
1800 .max_register
= 0x16218,
1804 static struct qcom_cc_desc cam_cc_sa8775p_desc
= {
1805 .config
= &cam_cc_sa8775p_regmap_config
,
1806 .clks
= cam_cc_sa8775p_clocks
,
1807 .num_clks
= ARRAY_SIZE(cam_cc_sa8775p_clocks
),
1808 .resets
= cam_cc_sa8775p_resets
,
1809 .num_resets
= ARRAY_SIZE(cam_cc_sa8775p_resets
),
1810 .gdscs
= cam_cc_sa8775p_gdscs
,
1811 .num_gdscs
= ARRAY_SIZE(cam_cc_sa8775p_gdscs
),
1814 static const struct of_device_id cam_cc_sa8775p_match_table
[] = {
1815 { .compatible
= "qcom,sa8775p-camcc" },
1818 MODULE_DEVICE_TABLE(of
, cam_cc_sa8775p_match_table
);
1820 static int cam_cc_sa8775p_probe(struct platform_device
*pdev
)
1822 struct regmap
*regmap
;
1825 ret
= devm_pm_runtime_enable(&pdev
->dev
);
1829 ret
= pm_runtime_resume_and_get(&pdev
->dev
);
1833 regmap
= qcom_cc_map(pdev
, &cam_cc_sa8775p_desc
);
1834 if (IS_ERR(regmap
)) {
1835 pm_runtime_put(&pdev
->dev
);
1836 return PTR_ERR(regmap
);
1839 clk_lucid_evo_pll_configure(&cam_cc_pll0
, regmap
, &cam_cc_pll0_config
);
1840 clk_rivian_evo_pll_configure(&cam_cc_pll2
, regmap
, &cam_cc_pll2_config
);
1841 clk_lucid_evo_pll_configure(&cam_cc_pll3
, regmap
, &cam_cc_pll3_config
);
1842 clk_lucid_evo_pll_configure(&cam_cc_pll4
, regmap
, &cam_cc_pll4_config
);
1843 clk_lucid_evo_pll_configure(&cam_cc_pll5
, regmap
, &cam_cc_pll5_config
);
1845 /* Keep some clocks always enabled */
1846 qcom_branch_set_clk_en(regmap
, 0x13194); /* CAM_CC_CAMNOC_XO_CLK */
1847 qcom_branch_set_clk_en(regmap
, 0x131ec); /* CAM_CC_GDSC_CLK */
1848 qcom_branch_set_clk_en(regmap
, 0x13208); /* CAM_CC_SLEEP_CLK */
1850 ret
= qcom_cc_really_probe(&pdev
->dev
, &cam_cc_sa8775p_desc
, regmap
);
1852 pm_runtime_put(&pdev
->dev
);
1857 static struct platform_driver cam_cc_sa8775p_driver
= {
1858 .probe
= cam_cc_sa8775p_probe
,
1860 .name
= "camcc-sa8775p",
1861 .of_match_table
= cam_cc_sa8775p_match_table
,
1865 module_platform_driver(cam_cc_sa8775p_driver
);
1867 MODULE_DESCRIPTION("QTI CAMCC SA8775P Driver");
1868 MODULE_LICENSE("GPL");