2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/kernel.h>
15 #include <linux/bitops.h>
16 #include <linux/err.h>
17 #include <linux/platform_device.h>
18 #include <linux/module.h>
20 #include <linux/of_device.h>
21 #include <linux/clk-provider.h>
22 #include <linux/regmap.h>
23 #include <linux/reset-controller.h>
25 #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
26 #include <dt-bindings/reset/qcom,mmcc-msm8974.h>
29 #include "clk-regmap.h"
32 #include "clk-branch.h"
53 static const struct parent_map mmcc_xo_mmpll0_mmpll1_gpll0_map
[] = {
60 static const char * const mmcc_xo_mmpll0_mmpll1_gpll0
[] = {
67 static const struct parent_map mmcc_xo_mmpll0_dsi_hdmi_gpll0_map
[] = {
76 static const char * const mmcc_xo_mmpll0_dsi_hdmi_gpll0
[] = {
85 static const struct parent_map mmcc_xo_mmpll0_1_2_gpll0_map
[] = {
93 static const char * const mmcc_xo_mmpll0_1_2_gpll0
[] = {
101 static const struct parent_map mmcc_xo_mmpll0_1_3_gpll0_map
[] = {
109 static const char * const mmcc_xo_mmpll0_1_3_gpll0
[] = {
117 static const struct parent_map mmcc_xo_mmpll0_1_gpll1_0_map
[] = {
125 static const char * const mmcc_xo_mmpll0_1_gpll1_0
[] = {
133 static const struct parent_map mmcc_xo_dsi_hdmi_edp_map
[] = {
142 static const char * const mmcc_xo_dsi_hdmi_edp
[] = {
151 static const struct parent_map mmcc_xo_dsi_hdmi_edp_gpll0_map
[] = {
160 static const char * const mmcc_xo_dsi_hdmi_edp_gpll0
[] = {
169 static const struct parent_map mmcc_xo_dsibyte_hdmi_edp_gpll0_map
[] = {
174 { P_DSI0PLL_BYTE
, 1 },
175 { P_DSI1PLL_BYTE
, 2 }
178 static const char * const mmcc_xo_dsibyte_hdmi_edp_gpll0
[] = {
187 static struct clk_pll mmpll0
= {
191 .config_reg
= 0x0014,
193 .status_reg
= 0x001c,
195 .clkr
.hw
.init
= &(struct clk_init_data
){
197 .parent_names
= (const char *[]){ "xo" },
203 static struct clk_regmap mmpll0_vote
= {
204 .enable_reg
= 0x0100,
205 .enable_mask
= BIT(0),
206 .hw
.init
= &(struct clk_init_data
){
207 .name
= "mmpll0_vote",
208 .parent_names
= (const char *[]){ "mmpll0" },
210 .ops
= &clk_pll_vote_ops
,
214 static struct clk_pll mmpll1
= {
218 .config_reg
= 0x0050,
220 .status_reg
= 0x005c,
222 .clkr
.hw
.init
= &(struct clk_init_data
){
224 .parent_names
= (const char *[]){ "xo" },
230 static struct clk_regmap mmpll1_vote
= {
231 .enable_reg
= 0x0100,
232 .enable_mask
= BIT(1),
233 .hw
.init
= &(struct clk_init_data
){
234 .name
= "mmpll1_vote",
235 .parent_names
= (const char *[]){ "mmpll1" },
237 .ops
= &clk_pll_vote_ops
,
241 static struct clk_pll mmpll2
= {
245 .config_reg
= 0x4110,
247 .status_reg
= 0x411c,
248 .clkr
.hw
.init
= &(struct clk_init_data
){
250 .parent_names
= (const char *[]){ "xo" },
256 static struct clk_pll mmpll3
= {
260 .config_reg
= 0x0090,
262 .status_reg
= 0x009c,
264 .clkr
.hw
.init
= &(struct clk_init_data
){
266 .parent_names
= (const char *[]){ "xo" },
272 static struct clk_rcg2 mmss_ahb_clk_src
= {
275 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
276 .clkr
.hw
.init
= &(struct clk_init_data
){
277 .name
= "mmss_ahb_clk_src",
278 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
280 .ops
= &clk_rcg2_ops
,
284 static struct freq_tbl ftbl_mmss_axi_clk
[] = {
285 F( 19200000, P_XO
, 1, 0, 0),
286 F( 37500000, P_GPLL0
, 16, 0, 0),
287 F( 50000000, P_GPLL0
, 12, 0, 0),
288 F( 75000000, P_GPLL0
, 8, 0, 0),
289 F(100000000, P_GPLL0
, 6, 0, 0),
290 F(150000000, P_GPLL0
, 4, 0, 0),
291 F(291750000, P_MMPLL1
, 4, 0, 0),
292 F(400000000, P_MMPLL0
, 2, 0, 0),
293 F(466800000, P_MMPLL1
, 2.5, 0, 0),
296 static struct clk_rcg2 mmss_axi_clk_src
= {
299 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
300 .freq_tbl
= ftbl_mmss_axi_clk
,
301 .clkr
.hw
.init
= &(struct clk_init_data
){
302 .name
= "mmss_axi_clk_src",
303 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
305 .ops
= &clk_rcg2_ops
,
309 static struct freq_tbl ftbl_ocmemnoc_clk
[] = {
310 F( 19200000, P_XO
, 1, 0, 0),
311 F( 37500000, P_GPLL0
, 16, 0, 0),
312 F( 50000000, P_GPLL0
, 12, 0, 0),
313 F( 75000000, P_GPLL0
, 8, 0, 0),
314 F(100000000, P_GPLL0
, 6, 0, 0),
315 F(150000000, P_GPLL0
, 4, 0, 0),
316 F(291750000, P_MMPLL1
, 4, 0, 0),
317 F(400000000, P_MMPLL0
, 2, 0, 0),
320 static struct clk_rcg2 ocmemnoc_clk_src
= {
323 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
324 .freq_tbl
= ftbl_ocmemnoc_clk
,
325 .clkr
.hw
.init
= &(struct clk_init_data
){
326 .name
= "ocmemnoc_clk_src",
327 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
329 .ops
= &clk_rcg2_ops
,
333 static struct freq_tbl ftbl_camss_csi0_3_clk
[] = {
334 F(100000000, P_GPLL0
, 6, 0, 0),
335 F(200000000, P_MMPLL0
, 4, 0, 0),
339 static struct clk_rcg2 csi0_clk_src
= {
342 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
343 .freq_tbl
= ftbl_camss_csi0_3_clk
,
344 .clkr
.hw
.init
= &(struct clk_init_data
){
345 .name
= "csi0_clk_src",
346 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
348 .ops
= &clk_rcg2_ops
,
352 static struct clk_rcg2 csi1_clk_src
= {
355 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
356 .freq_tbl
= ftbl_camss_csi0_3_clk
,
357 .clkr
.hw
.init
= &(struct clk_init_data
){
358 .name
= "csi1_clk_src",
359 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
361 .ops
= &clk_rcg2_ops
,
365 static struct clk_rcg2 csi2_clk_src
= {
368 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
369 .freq_tbl
= ftbl_camss_csi0_3_clk
,
370 .clkr
.hw
.init
= &(struct clk_init_data
){
371 .name
= "csi2_clk_src",
372 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
374 .ops
= &clk_rcg2_ops
,
378 static struct clk_rcg2 csi3_clk_src
= {
381 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
382 .freq_tbl
= ftbl_camss_csi0_3_clk
,
383 .clkr
.hw
.init
= &(struct clk_init_data
){
384 .name
= "csi3_clk_src",
385 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
387 .ops
= &clk_rcg2_ops
,
391 static struct freq_tbl ftbl_camss_vfe_vfe0_1_clk
[] = {
392 F(37500000, P_GPLL0
, 16, 0, 0),
393 F(50000000, P_GPLL0
, 12, 0, 0),
394 F(60000000, P_GPLL0
, 10, 0, 0),
395 F(80000000, P_GPLL0
, 7.5, 0, 0),
396 F(100000000, P_GPLL0
, 6, 0, 0),
397 F(109090000, P_GPLL0
, 5.5, 0, 0),
398 F(133330000, P_GPLL0
, 4.5, 0, 0),
399 F(200000000, P_GPLL0
, 3, 0, 0),
400 F(228570000, P_MMPLL0
, 3.5, 0, 0),
401 F(266670000, P_MMPLL0
, 3, 0, 0),
402 F(320000000, P_MMPLL0
, 2.5, 0, 0),
403 F(400000000, P_MMPLL0
, 2, 0, 0),
404 F(465000000, P_MMPLL3
, 2, 0, 0),
408 static struct clk_rcg2 vfe0_clk_src
= {
411 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
412 .freq_tbl
= ftbl_camss_vfe_vfe0_1_clk
,
413 .clkr
.hw
.init
= &(struct clk_init_data
){
414 .name
= "vfe0_clk_src",
415 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
417 .ops
= &clk_rcg2_ops
,
421 static struct clk_rcg2 vfe1_clk_src
= {
424 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
425 .freq_tbl
= ftbl_camss_vfe_vfe0_1_clk
,
426 .clkr
.hw
.init
= &(struct clk_init_data
){
427 .name
= "vfe1_clk_src",
428 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
430 .ops
= &clk_rcg2_ops
,
434 static struct freq_tbl ftbl_mdss_mdp_clk
[] = {
435 F(37500000, P_GPLL0
, 16, 0, 0),
436 F(60000000, P_GPLL0
, 10, 0, 0),
437 F(75000000, P_GPLL0
, 8, 0, 0),
438 F(85710000, P_GPLL0
, 7, 0, 0),
439 F(100000000, P_GPLL0
, 6, 0, 0),
440 F(133330000, P_MMPLL0
, 6, 0, 0),
441 F(160000000, P_MMPLL0
, 5, 0, 0),
442 F(200000000, P_MMPLL0
, 4, 0, 0),
443 F(228570000, P_MMPLL0
, 3.5, 0, 0),
444 F(240000000, P_GPLL0
, 2.5, 0, 0),
445 F(266670000, P_MMPLL0
, 3, 0, 0),
446 F(320000000, P_MMPLL0
, 2.5, 0, 0),
450 static struct clk_rcg2 mdp_clk_src
= {
453 .parent_map
= mmcc_xo_mmpll0_dsi_hdmi_gpll0_map
,
454 .freq_tbl
= ftbl_mdss_mdp_clk
,
455 .clkr
.hw
.init
= &(struct clk_init_data
){
456 .name
= "mdp_clk_src",
457 .parent_names
= mmcc_xo_mmpll0_dsi_hdmi_gpll0
,
459 .ops
= &clk_rcg2_ops
,
463 static struct clk_rcg2 gfx3d_clk_src
= {
466 .parent_map
= mmcc_xo_mmpll0_1_2_gpll0_map
,
467 .clkr
.hw
.init
= &(struct clk_init_data
){
468 .name
= "gfx3d_clk_src",
469 .parent_names
= mmcc_xo_mmpll0_1_2_gpll0
,
471 .ops
= &clk_rcg2_ops
,
475 static struct freq_tbl ftbl_camss_jpeg_jpeg0_2_clk
[] = {
476 F(75000000, P_GPLL0
, 8, 0, 0),
477 F(133330000, P_GPLL0
, 4.5, 0, 0),
478 F(200000000, P_GPLL0
, 3, 0, 0),
479 F(228570000, P_MMPLL0
, 3.5, 0, 0),
480 F(266670000, P_MMPLL0
, 3, 0, 0),
481 F(320000000, P_MMPLL0
, 2.5, 0, 0),
485 static struct clk_rcg2 jpeg0_clk_src
= {
488 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
489 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
490 .clkr
.hw
.init
= &(struct clk_init_data
){
491 .name
= "jpeg0_clk_src",
492 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
494 .ops
= &clk_rcg2_ops
,
498 static struct clk_rcg2 jpeg1_clk_src
= {
501 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
502 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
503 .clkr
.hw
.init
= &(struct clk_init_data
){
504 .name
= "jpeg1_clk_src",
505 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
507 .ops
= &clk_rcg2_ops
,
511 static struct clk_rcg2 jpeg2_clk_src
= {
514 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
515 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
516 .clkr
.hw
.init
= &(struct clk_init_data
){
517 .name
= "jpeg2_clk_src",
518 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
520 .ops
= &clk_rcg2_ops
,
524 static struct clk_rcg2 pclk0_clk_src
= {
528 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
529 .clkr
.hw
.init
= &(struct clk_init_data
){
530 .name
= "pclk0_clk_src",
531 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
533 .ops
= &clk_pixel_ops
,
534 .flags
= CLK_SET_RATE_PARENT
,
538 static struct clk_rcg2 pclk1_clk_src
= {
542 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
543 .clkr
.hw
.init
= &(struct clk_init_data
){
544 .name
= "pclk1_clk_src",
545 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
547 .ops
= &clk_pixel_ops
,
548 .flags
= CLK_SET_RATE_PARENT
,
552 static struct freq_tbl ftbl_venus0_vcodec0_clk
[] = {
553 F(50000000, P_GPLL0
, 12, 0, 0),
554 F(100000000, P_GPLL0
, 6, 0, 0),
555 F(133330000, P_MMPLL0
, 6, 0, 0),
556 F(200000000, P_MMPLL0
, 4, 0, 0),
557 F(266670000, P_MMPLL0
, 3, 0, 0),
558 F(465000000, P_MMPLL3
, 2, 0, 0),
562 static struct clk_rcg2 vcodec0_clk_src
= {
566 .parent_map
= mmcc_xo_mmpll0_1_3_gpll0_map
,
567 .freq_tbl
= ftbl_venus0_vcodec0_clk
,
568 .clkr
.hw
.init
= &(struct clk_init_data
){
569 .name
= "vcodec0_clk_src",
570 .parent_names
= mmcc_xo_mmpll0_1_3_gpll0
,
572 .ops
= &clk_rcg2_ops
,
576 static struct freq_tbl ftbl_camss_cci_cci_clk
[] = {
577 F(19200000, P_XO
, 1, 0, 0),
581 static struct clk_rcg2 cci_clk_src
= {
584 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
585 .freq_tbl
= ftbl_camss_cci_cci_clk
,
586 .clkr
.hw
.init
= &(struct clk_init_data
){
587 .name
= "cci_clk_src",
588 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
590 .ops
= &clk_rcg2_ops
,
594 static struct freq_tbl ftbl_camss_gp0_1_clk
[] = {
595 F(10000, P_XO
, 16, 1, 120),
596 F(24000, P_XO
, 16, 1, 50),
597 F(6000000, P_GPLL0
, 10, 1, 10),
598 F(12000000, P_GPLL0
, 10, 1, 5),
599 F(13000000, P_GPLL0
, 4, 13, 150),
600 F(24000000, P_GPLL0
, 5, 1, 5),
604 static struct clk_rcg2 camss_gp0_clk_src
= {
608 .parent_map
= mmcc_xo_mmpll0_1_gpll1_0_map
,
609 .freq_tbl
= ftbl_camss_gp0_1_clk
,
610 .clkr
.hw
.init
= &(struct clk_init_data
){
611 .name
= "camss_gp0_clk_src",
612 .parent_names
= mmcc_xo_mmpll0_1_gpll1_0
,
614 .ops
= &clk_rcg2_ops
,
618 static struct clk_rcg2 camss_gp1_clk_src
= {
622 .parent_map
= mmcc_xo_mmpll0_1_gpll1_0_map
,
623 .freq_tbl
= ftbl_camss_gp0_1_clk
,
624 .clkr
.hw
.init
= &(struct clk_init_data
){
625 .name
= "camss_gp1_clk_src",
626 .parent_names
= mmcc_xo_mmpll0_1_gpll1_0
,
628 .ops
= &clk_rcg2_ops
,
632 static struct freq_tbl ftbl_camss_mclk0_3_clk
[] = {
633 F(4800000, P_XO
, 4, 0, 0),
634 F(6000000, P_GPLL0
, 10, 1, 10),
635 F(8000000, P_GPLL0
, 15, 1, 5),
636 F(9600000, P_XO
, 2, 0, 0),
637 F(16000000, P_GPLL0
, 12.5, 1, 3),
638 F(19200000, P_XO
, 1, 0, 0),
639 F(24000000, P_GPLL0
, 5, 1, 5),
640 F(32000000, P_MMPLL0
, 5, 1, 5),
641 F(48000000, P_GPLL0
, 12.5, 0, 0),
642 F(64000000, P_MMPLL0
, 12.5, 0, 0),
643 F(66670000, P_GPLL0
, 9, 0, 0),
647 static struct clk_rcg2 mclk0_clk_src
= {
650 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
651 .freq_tbl
= ftbl_camss_mclk0_3_clk
,
652 .clkr
.hw
.init
= &(struct clk_init_data
){
653 .name
= "mclk0_clk_src",
654 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
656 .ops
= &clk_rcg2_ops
,
660 static struct clk_rcg2 mclk1_clk_src
= {
663 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
664 .freq_tbl
= ftbl_camss_mclk0_3_clk
,
665 .clkr
.hw
.init
= &(struct clk_init_data
){
666 .name
= "mclk1_clk_src",
667 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
669 .ops
= &clk_rcg2_ops
,
673 static struct clk_rcg2 mclk2_clk_src
= {
676 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
677 .freq_tbl
= ftbl_camss_mclk0_3_clk
,
678 .clkr
.hw
.init
= &(struct clk_init_data
){
679 .name
= "mclk2_clk_src",
680 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
682 .ops
= &clk_rcg2_ops
,
686 static struct clk_rcg2 mclk3_clk_src
= {
689 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
690 .freq_tbl
= ftbl_camss_mclk0_3_clk
,
691 .clkr
.hw
.init
= &(struct clk_init_data
){
692 .name
= "mclk3_clk_src",
693 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
695 .ops
= &clk_rcg2_ops
,
699 static struct freq_tbl ftbl_camss_phy0_2_csi0_2phytimer_clk
[] = {
700 F(100000000, P_GPLL0
, 6, 0, 0),
701 F(200000000, P_MMPLL0
, 4, 0, 0),
705 static struct clk_rcg2 csi0phytimer_clk_src
= {
708 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
709 .freq_tbl
= ftbl_camss_phy0_2_csi0_2phytimer_clk
,
710 .clkr
.hw
.init
= &(struct clk_init_data
){
711 .name
= "csi0phytimer_clk_src",
712 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
714 .ops
= &clk_rcg2_ops
,
718 static struct clk_rcg2 csi1phytimer_clk_src
= {
721 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
722 .freq_tbl
= ftbl_camss_phy0_2_csi0_2phytimer_clk
,
723 .clkr
.hw
.init
= &(struct clk_init_data
){
724 .name
= "csi1phytimer_clk_src",
725 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
727 .ops
= &clk_rcg2_ops
,
731 static struct clk_rcg2 csi2phytimer_clk_src
= {
734 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
735 .freq_tbl
= ftbl_camss_phy0_2_csi0_2phytimer_clk
,
736 .clkr
.hw
.init
= &(struct clk_init_data
){
737 .name
= "csi2phytimer_clk_src",
738 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
740 .ops
= &clk_rcg2_ops
,
744 static struct freq_tbl ftbl_camss_vfe_cpp_clk
[] = {
745 F(133330000, P_GPLL0
, 4.5, 0, 0),
746 F(266670000, P_MMPLL0
, 3, 0, 0),
747 F(320000000, P_MMPLL0
, 2.5, 0, 0),
748 F(400000000, P_MMPLL0
, 2, 0, 0),
749 F(465000000, P_MMPLL3
, 2, 0, 0),
753 static struct clk_rcg2 cpp_clk_src
= {
756 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
757 .freq_tbl
= ftbl_camss_vfe_cpp_clk
,
758 .clkr
.hw
.init
= &(struct clk_init_data
){
759 .name
= "cpp_clk_src",
760 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
762 .ops
= &clk_rcg2_ops
,
766 static struct freq_tbl byte_freq_tbl
[] = {
767 { .src
= P_DSI0PLL_BYTE
},
771 static struct clk_rcg2 byte0_clk_src
= {
774 .parent_map
= mmcc_xo_dsibyte_hdmi_edp_gpll0_map
,
775 .freq_tbl
= byte_freq_tbl
,
776 .clkr
.hw
.init
= &(struct clk_init_data
){
777 .name
= "byte0_clk_src",
778 .parent_names
= mmcc_xo_dsibyte_hdmi_edp_gpll0
,
780 .ops
= &clk_byte2_ops
,
781 .flags
= CLK_SET_RATE_PARENT
,
785 static struct clk_rcg2 byte1_clk_src
= {
788 .parent_map
= mmcc_xo_dsibyte_hdmi_edp_gpll0_map
,
789 .freq_tbl
= byte_freq_tbl
,
790 .clkr
.hw
.init
= &(struct clk_init_data
){
791 .name
= "byte1_clk_src",
792 .parent_names
= mmcc_xo_dsibyte_hdmi_edp_gpll0
,
794 .ops
= &clk_byte2_ops
,
795 .flags
= CLK_SET_RATE_PARENT
,
799 static struct freq_tbl ftbl_mdss_edpaux_clk
[] = {
800 F(19200000, P_XO
, 1, 0, 0),
804 static struct clk_rcg2 edpaux_clk_src
= {
807 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
808 .freq_tbl
= ftbl_mdss_edpaux_clk
,
809 .clkr
.hw
.init
= &(struct clk_init_data
){
810 .name
= "edpaux_clk_src",
811 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
813 .ops
= &clk_rcg2_ops
,
817 static struct freq_tbl ftbl_mdss_edplink_clk
[] = {
818 F(135000000, P_EDPLINK
, 2, 0, 0),
819 F(270000000, P_EDPLINK
, 11, 0, 0),
823 static struct clk_rcg2 edplink_clk_src
= {
826 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
827 .freq_tbl
= ftbl_mdss_edplink_clk
,
828 .clkr
.hw
.init
= &(struct clk_init_data
){
829 .name
= "edplink_clk_src",
830 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
832 .ops
= &clk_rcg2_ops
,
833 .flags
= CLK_SET_RATE_PARENT
,
837 static struct freq_tbl edp_pixel_freq_tbl
[] = {
842 static struct clk_rcg2 edppixel_clk_src
= {
846 .parent_map
= mmcc_xo_dsi_hdmi_edp_map
,
847 .freq_tbl
= edp_pixel_freq_tbl
,
848 .clkr
.hw
.init
= &(struct clk_init_data
){
849 .name
= "edppixel_clk_src",
850 .parent_names
= mmcc_xo_dsi_hdmi_edp
,
852 .ops
= &clk_edp_pixel_ops
,
856 static struct freq_tbl ftbl_mdss_esc0_1_clk
[] = {
857 F(19200000, P_XO
, 1, 0, 0),
861 static struct clk_rcg2 esc0_clk_src
= {
864 .parent_map
= mmcc_xo_dsibyte_hdmi_edp_gpll0_map
,
865 .freq_tbl
= ftbl_mdss_esc0_1_clk
,
866 .clkr
.hw
.init
= &(struct clk_init_data
){
867 .name
= "esc0_clk_src",
868 .parent_names
= mmcc_xo_dsibyte_hdmi_edp_gpll0
,
870 .ops
= &clk_rcg2_ops
,
874 static struct clk_rcg2 esc1_clk_src
= {
877 .parent_map
= mmcc_xo_dsibyte_hdmi_edp_gpll0_map
,
878 .freq_tbl
= ftbl_mdss_esc0_1_clk
,
879 .clkr
.hw
.init
= &(struct clk_init_data
){
880 .name
= "esc1_clk_src",
881 .parent_names
= mmcc_xo_dsibyte_hdmi_edp_gpll0
,
883 .ops
= &clk_rcg2_ops
,
887 static struct freq_tbl extpclk_freq_tbl
[] = {
888 { .src
= P_HDMIPLL
},
892 static struct clk_rcg2 extpclk_clk_src
= {
895 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
896 .freq_tbl
= extpclk_freq_tbl
,
897 .clkr
.hw
.init
= &(struct clk_init_data
){
898 .name
= "extpclk_clk_src",
899 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
901 .ops
= &clk_byte_ops
,
902 .flags
= CLK_SET_RATE_PARENT
,
906 static struct freq_tbl ftbl_mdss_hdmi_clk
[] = {
907 F(19200000, P_XO
, 1, 0, 0),
911 static struct clk_rcg2 hdmi_clk_src
= {
914 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
915 .freq_tbl
= ftbl_mdss_hdmi_clk
,
916 .clkr
.hw
.init
= &(struct clk_init_data
){
917 .name
= "hdmi_clk_src",
918 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
920 .ops
= &clk_rcg2_ops
,
924 static struct freq_tbl ftbl_mdss_vsync_clk
[] = {
925 F(19200000, P_XO
, 1, 0, 0),
929 static struct clk_rcg2 vsync_clk_src
= {
932 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
933 .freq_tbl
= ftbl_mdss_vsync_clk
,
934 .clkr
.hw
.init
= &(struct clk_init_data
){
935 .name
= "vsync_clk_src",
936 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
938 .ops
= &clk_rcg2_ops
,
942 static struct clk_branch camss_cci_cci_ahb_clk
= {
945 .enable_reg
= 0x3348,
946 .enable_mask
= BIT(0),
947 .hw
.init
= &(struct clk_init_data
){
948 .name
= "camss_cci_cci_ahb_clk",
949 .parent_names
= (const char *[]){
953 .ops
= &clk_branch2_ops
,
958 static struct clk_branch camss_cci_cci_clk
= {
961 .enable_reg
= 0x3344,
962 .enable_mask
= BIT(0),
963 .hw
.init
= &(struct clk_init_data
){
964 .name
= "camss_cci_cci_clk",
965 .parent_names
= (const char *[]){
969 .flags
= CLK_SET_RATE_PARENT
,
970 .ops
= &clk_branch2_ops
,
975 static struct clk_branch camss_csi0_ahb_clk
= {
978 .enable_reg
= 0x30bc,
979 .enable_mask
= BIT(0),
980 .hw
.init
= &(struct clk_init_data
){
981 .name
= "camss_csi0_ahb_clk",
982 .parent_names
= (const char *[]){
986 .ops
= &clk_branch2_ops
,
991 static struct clk_branch camss_csi0_clk
= {
994 .enable_reg
= 0x30b4,
995 .enable_mask
= BIT(0),
996 .hw
.init
= &(struct clk_init_data
){
997 .name
= "camss_csi0_clk",
998 .parent_names
= (const char *[]){
1002 .flags
= CLK_SET_RATE_PARENT
,
1003 .ops
= &clk_branch2_ops
,
1008 static struct clk_branch camss_csi0phy_clk
= {
1011 .enable_reg
= 0x30c4,
1012 .enable_mask
= BIT(0),
1013 .hw
.init
= &(struct clk_init_data
){
1014 .name
= "camss_csi0phy_clk",
1015 .parent_names
= (const char *[]){
1019 .flags
= CLK_SET_RATE_PARENT
,
1020 .ops
= &clk_branch2_ops
,
1025 static struct clk_branch camss_csi0pix_clk
= {
1028 .enable_reg
= 0x30e4,
1029 .enable_mask
= BIT(0),
1030 .hw
.init
= &(struct clk_init_data
){
1031 .name
= "camss_csi0pix_clk",
1032 .parent_names
= (const char *[]){
1036 .flags
= CLK_SET_RATE_PARENT
,
1037 .ops
= &clk_branch2_ops
,
1042 static struct clk_branch camss_csi0rdi_clk
= {
1045 .enable_reg
= 0x30d4,
1046 .enable_mask
= BIT(0),
1047 .hw
.init
= &(struct clk_init_data
){
1048 .name
= "camss_csi0rdi_clk",
1049 .parent_names
= (const char *[]){
1053 .flags
= CLK_SET_RATE_PARENT
,
1054 .ops
= &clk_branch2_ops
,
1059 static struct clk_branch camss_csi1_ahb_clk
= {
1062 .enable_reg
= 0x3128,
1063 .enable_mask
= BIT(0),
1064 .hw
.init
= &(struct clk_init_data
){
1065 .name
= "camss_csi1_ahb_clk",
1066 .parent_names
= (const char *[]){
1070 .ops
= &clk_branch2_ops
,
1075 static struct clk_branch camss_csi1_clk
= {
1078 .enable_reg
= 0x3124,
1079 .enable_mask
= BIT(0),
1080 .hw
.init
= &(struct clk_init_data
){
1081 .name
= "camss_csi1_clk",
1082 .parent_names
= (const char *[]){
1086 .flags
= CLK_SET_RATE_PARENT
,
1087 .ops
= &clk_branch2_ops
,
1092 static struct clk_branch camss_csi1phy_clk
= {
1095 .enable_reg
= 0x3134,
1096 .enable_mask
= BIT(0),
1097 .hw
.init
= &(struct clk_init_data
){
1098 .name
= "camss_csi1phy_clk",
1099 .parent_names
= (const char *[]){
1103 .flags
= CLK_SET_RATE_PARENT
,
1104 .ops
= &clk_branch2_ops
,
1109 static struct clk_branch camss_csi1pix_clk
= {
1112 .enable_reg
= 0x3154,
1113 .enable_mask
= BIT(0),
1114 .hw
.init
= &(struct clk_init_data
){
1115 .name
= "camss_csi1pix_clk",
1116 .parent_names
= (const char *[]){
1120 .flags
= CLK_SET_RATE_PARENT
,
1121 .ops
= &clk_branch2_ops
,
1126 static struct clk_branch camss_csi1rdi_clk
= {
1129 .enable_reg
= 0x3144,
1130 .enable_mask
= BIT(0),
1131 .hw
.init
= &(struct clk_init_data
){
1132 .name
= "camss_csi1rdi_clk",
1133 .parent_names
= (const char *[]){
1137 .flags
= CLK_SET_RATE_PARENT
,
1138 .ops
= &clk_branch2_ops
,
1143 static struct clk_branch camss_csi2_ahb_clk
= {
1146 .enable_reg
= 0x3188,
1147 .enable_mask
= BIT(0),
1148 .hw
.init
= &(struct clk_init_data
){
1149 .name
= "camss_csi2_ahb_clk",
1150 .parent_names
= (const char *[]){
1154 .ops
= &clk_branch2_ops
,
1159 static struct clk_branch camss_csi2_clk
= {
1162 .enable_reg
= 0x3184,
1163 .enable_mask
= BIT(0),
1164 .hw
.init
= &(struct clk_init_data
){
1165 .name
= "camss_csi2_clk",
1166 .parent_names
= (const char *[]){
1170 .flags
= CLK_SET_RATE_PARENT
,
1171 .ops
= &clk_branch2_ops
,
1176 static struct clk_branch camss_csi2phy_clk
= {
1179 .enable_reg
= 0x3194,
1180 .enable_mask
= BIT(0),
1181 .hw
.init
= &(struct clk_init_data
){
1182 .name
= "camss_csi2phy_clk",
1183 .parent_names
= (const char *[]){
1187 .flags
= CLK_SET_RATE_PARENT
,
1188 .ops
= &clk_branch2_ops
,
1193 static struct clk_branch camss_csi2pix_clk
= {
1196 .enable_reg
= 0x31b4,
1197 .enable_mask
= BIT(0),
1198 .hw
.init
= &(struct clk_init_data
){
1199 .name
= "camss_csi2pix_clk",
1200 .parent_names
= (const char *[]){
1204 .flags
= CLK_SET_RATE_PARENT
,
1205 .ops
= &clk_branch2_ops
,
1210 static struct clk_branch camss_csi2rdi_clk
= {
1213 .enable_reg
= 0x31a4,
1214 .enable_mask
= BIT(0),
1215 .hw
.init
= &(struct clk_init_data
){
1216 .name
= "camss_csi2rdi_clk",
1217 .parent_names
= (const char *[]){
1221 .flags
= CLK_SET_RATE_PARENT
,
1222 .ops
= &clk_branch2_ops
,
1227 static struct clk_branch camss_csi3_ahb_clk
= {
1230 .enable_reg
= 0x31e8,
1231 .enable_mask
= BIT(0),
1232 .hw
.init
= &(struct clk_init_data
){
1233 .name
= "camss_csi3_ahb_clk",
1234 .parent_names
= (const char *[]){
1238 .ops
= &clk_branch2_ops
,
1243 static struct clk_branch camss_csi3_clk
= {
1246 .enable_reg
= 0x31e4,
1247 .enable_mask
= BIT(0),
1248 .hw
.init
= &(struct clk_init_data
){
1249 .name
= "camss_csi3_clk",
1250 .parent_names
= (const char *[]){
1254 .flags
= CLK_SET_RATE_PARENT
,
1255 .ops
= &clk_branch2_ops
,
1260 static struct clk_branch camss_csi3phy_clk
= {
1263 .enable_reg
= 0x31f4,
1264 .enable_mask
= BIT(0),
1265 .hw
.init
= &(struct clk_init_data
){
1266 .name
= "camss_csi3phy_clk",
1267 .parent_names
= (const char *[]){
1271 .flags
= CLK_SET_RATE_PARENT
,
1272 .ops
= &clk_branch2_ops
,
1277 static struct clk_branch camss_csi3pix_clk
= {
1280 .enable_reg
= 0x3214,
1281 .enable_mask
= BIT(0),
1282 .hw
.init
= &(struct clk_init_data
){
1283 .name
= "camss_csi3pix_clk",
1284 .parent_names
= (const char *[]){
1288 .flags
= CLK_SET_RATE_PARENT
,
1289 .ops
= &clk_branch2_ops
,
1294 static struct clk_branch camss_csi3rdi_clk
= {
1297 .enable_reg
= 0x3204,
1298 .enable_mask
= BIT(0),
1299 .hw
.init
= &(struct clk_init_data
){
1300 .name
= "camss_csi3rdi_clk",
1301 .parent_names
= (const char *[]){
1305 .flags
= CLK_SET_RATE_PARENT
,
1306 .ops
= &clk_branch2_ops
,
1311 static struct clk_branch camss_csi_vfe0_clk
= {
1314 .enable_reg
= 0x3704,
1315 .enable_mask
= BIT(0),
1316 .hw
.init
= &(struct clk_init_data
){
1317 .name
= "camss_csi_vfe0_clk",
1318 .parent_names
= (const char *[]){
1322 .flags
= CLK_SET_RATE_PARENT
,
1323 .ops
= &clk_branch2_ops
,
1328 static struct clk_branch camss_csi_vfe1_clk
= {
1331 .enable_reg
= 0x3714,
1332 .enable_mask
= BIT(0),
1333 .hw
.init
= &(struct clk_init_data
){
1334 .name
= "camss_csi_vfe1_clk",
1335 .parent_names
= (const char *[]){
1339 .flags
= CLK_SET_RATE_PARENT
,
1340 .ops
= &clk_branch2_ops
,
1345 static struct clk_branch camss_gp0_clk
= {
1348 .enable_reg
= 0x3444,
1349 .enable_mask
= BIT(0),
1350 .hw
.init
= &(struct clk_init_data
){
1351 .name
= "camss_gp0_clk",
1352 .parent_names
= (const char *[]){
1353 "camss_gp0_clk_src",
1356 .flags
= CLK_SET_RATE_PARENT
,
1357 .ops
= &clk_branch2_ops
,
1362 static struct clk_branch camss_gp1_clk
= {
1365 .enable_reg
= 0x3474,
1366 .enable_mask
= BIT(0),
1367 .hw
.init
= &(struct clk_init_data
){
1368 .name
= "camss_gp1_clk",
1369 .parent_names
= (const char *[]){
1370 "camss_gp1_clk_src",
1373 .flags
= CLK_SET_RATE_PARENT
,
1374 .ops
= &clk_branch2_ops
,
1379 static struct clk_branch camss_ispif_ahb_clk
= {
1382 .enable_reg
= 0x3224,
1383 .enable_mask
= BIT(0),
1384 .hw
.init
= &(struct clk_init_data
){
1385 .name
= "camss_ispif_ahb_clk",
1386 .parent_names
= (const char *[]){
1390 .ops
= &clk_branch2_ops
,
1395 static struct clk_branch camss_jpeg_jpeg0_clk
= {
1398 .enable_reg
= 0x35a8,
1399 .enable_mask
= BIT(0),
1400 .hw
.init
= &(struct clk_init_data
){
1401 .name
= "camss_jpeg_jpeg0_clk",
1402 .parent_names
= (const char *[]){
1406 .flags
= CLK_SET_RATE_PARENT
,
1407 .ops
= &clk_branch2_ops
,
1412 static struct clk_branch camss_jpeg_jpeg1_clk
= {
1415 .enable_reg
= 0x35ac,
1416 .enable_mask
= BIT(0),
1417 .hw
.init
= &(struct clk_init_data
){
1418 .name
= "camss_jpeg_jpeg1_clk",
1419 .parent_names
= (const char *[]){
1423 .flags
= CLK_SET_RATE_PARENT
,
1424 .ops
= &clk_branch2_ops
,
1429 static struct clk_branch camss_jpeg_jpeg2_clk
= {
1432 .enable_reg
= 0x35b0,
1433 .enable_mask
= BIT(0),
1434 .hw
.init
= &(struct clk_init_data
){
1435 .name
= "camss_jpeg_jpeg2_clk",
1436 .parent_names
= (const char *[]){
1440 .flags
= CLK_SET_RATE_PARENT
,
1441 .ops
= &clk_branch2_ops
,
1446 static struct clk_branch camss_jpeg_jpeg_ahb_clk
= {
1449 .enable_reg
= 0x35b4,
1450 .enable_mask
= BIT(0),
1451 .hw
.init
= &(struct clk_init_data
){
1452 .name
= "camss_jpeg_jpeg_ahb_clk",
1453 .parent_names
= (const char *[]){
1457 .ops
= &clk_branch2_ops
,
1462 static struct clk_branch camss_jpeg_jpeg_axi_clk
= {
1465 .enable_reg
= 0x35b8,
1466 .enable_mask
= BIT(0),
1467 .hw
.init
= &(struct clk_init_data
){
1468 .name
= "camss_jpeg_jpeg_axi_clk",
1469 .parent_names
= (const char *[]){
1473 .ops
= &clk_branch2_ops
,
1478 static struct clk_branch camss_jpeg_jpeg_ocmemnoc_clk
= {
1481 .enable_reg
= 0x35bc,
1482 .enable_mask
= BIT(0),
1483 .hw
.init
= &(struct clk_init_data
){
1484 .name
= "camss_jpeg_jpeg_ocmemnoc_clk",
1485 .parent_names
= (const char *[]){
1489 .flags
= CLK_SET_RATE_PARENT
,
1490 .ops
= &clk_branch2_ops
,
1495 static struct clk_branch camss_mclk0_clk
= {
1498 .enable_reg
= 0x3384,
1499 .enable_mask
= BIT(0),
1500 .hw
.init
= &(struct clk_init_data
){
1501 .name
= "camss_mclk0_clk",
1502 .parent_names
= (const char *[]){
1506 .flags
= CLK_SET_RATE_PARENT
,
1507 .ops
= &clk_branch2_ops
,
1512 static struct clk_branch camss_mclk1_clk
= {
1515 .enable_reg
= 0x33b4,
1516 .enable_mask
= BIT(0),
1517 .hw
.init
= &(struct clk_init_data
){
1518 .name
= "camss_mclk1_clk",
1519 .parent_names
= (const char *[]){
1523 .flags
= CLK_SET_RATE_PARENT
,
1524 .ops
= &clk_branch2_ops
,
1529 static struct clk_branch camss_mclk2_clk
= {
1532 .enable_reg
= 0x33e4,
1533 .enable_mask
= BIT(0),
1534 .hw
.init
= &(struct clk_init_data
){
1535 .name
= "camss_mclk2_clk",
1536 .parent_names
= (const char *[]){
1540 .flags
= CLK_SET_RATE_PARENT
,
1541 .ops
= &clk_branch2_ops
,
1546 static struct clk_branch camss_mclk3_clk
= {
1549 .enable_reg
= 0x3414,
1550 .enable_mask
= BIT(0),
1551 .hw
.init
= &(struct clk_init_data
){
1552 .name
= "camss_mclk3_clk",
1553 .parent_names
= (const char *[]){
1557 .flags
= CLK_SET_RATE_PARENT
,
1558 .ops
= &clk_branch2_ops
,
1563 static struct clk_branch camss_micro_ahb_clk
= {
1566 .enable_reg
= 0x3494,
1567 .enable_mask
= BIT(0),
1568 .hw
.init
= &(struct clk_init_data
){
1569 .name
= "camss_micro_ahb_clk",
1570 .parent_names
= (const char *[]){
1574 .ops
= &clk_branch2_ops
,
1579 static struct clk_branch camss_phy0_csi0phytimer_clk
= {
1582 .enable_reg
= 0x3024,
1583 .enable_mask
= BIT(0),
1584 .hw
.init
= &(struct clk_init_data
){
1585 .name
= "camss_phy0_csi0phytimer_clk",
1586 .parent_names
= (const char *[]){
1587 "csi0phytimer_clk_src",
1590 .flags
= CLK_SET_RATE_PARENT
,
1591 .ops
= &clk_branch2_ops
,
1596 static struct clk_branch camss_phy1_csi1phytimer_clk
= {
1599 .enable_reg
= 0x3054,
1600 .enable_mask
= BIT(0),
1601 .hw
.init
= &(struct clk_init_data
){
1602 .name
= "camss_phy1_csi1phytimer_clk",
1603 .parent_names
= (const char *[]){
1604 "csi1phytimer_clk_src",
1607 .flags
= CLK_SET_RATE_PARENT
,
1608 .ops
= &clk_branch2_ops
,
1613 static struct clk_branch camss_phy2_csi2phytimer_clk
= {
1616 .enable_reg
= 0x3084,
1617 .enable_mask
= BIT(0),
1618 .hw
.init
= &(struct clk_init_data
){
1619 .name
= "camss_phy2_csi2phytimer_clk",
1620 .parent_names
= (const char *[]){
1621 "csi2phytimer_clk_src",
1624 .flags
= CLK_SET_RATE_PARENT
,
1625 .ops
= &clk_branch2_ops
,
1630 static struct clk_branch camss_top_ahb_clk
= {
1633 .enable_reg
= 0x3484,
1634 .enable_mask
= BIT(0),
1635 .hw
.init
= &(struct clk_init_data
){
1636 .name
= "camss_top_ahb_clk",
1637 .parent_names
= (const char *[]){
1641 .ops
= &clk_branch2_ops
,
1646 static struct clk_branch camss_vfe_cpp_ahb_clk
= {
1649 .enable_reg
= 0x36b4,
1650 .enable_mask
= BIT(0),
1651 .hw
.init
= &(struct clk_init_data
){
1652 .name
= "camss_vfe_cpp_ahb_clk",
1653 .parent_names
= (const char *[]){
1657 .ops
= &clk_branch2_ops
,
1662 static struct clk_branch camss_vfe_cpp_clk
= {
1665 .enable_reg
= 0x36b0,
1666 .enable_mask
= BIT(0),
1667 .hw
.init
= &(struct clk_init_data
){
1668 .name
= "camss_vfe_cpp_clk",
1669 .parent_names
= (const char *[]){
1673 .flags
= CLK_SET_RATE_PARENT
,
1674 .ops
= &clk_branch2_ops
,
1679 static struct clk_branch camss_vfe_vfe0_clk
= {
1682 .enable_reg
= 0x36a8,
1683 .enable_mask
= BIT(0),
1684 .hw
.init
= &(struct clk_init_data
){
1685 .name
= "camss_vfe_vfe0_clk",
1686 .parent_names
= (const char *[]){
1690 .flags
= CLK_SET_RATE_PARENT
,
1691 .ops
= &clk_branch2_ops
,
1696 static struct clk_branch camss_vfe_vfe1_clk
= {
1699 .enable_reg
= 0x36ac,
1700 .enable_mask
= BIT(0),
1701 .hw
.init
= &(struct clk_init_data
){
1702 .name
= "camss_vfe_vfe1_clk",
1703 .parent_names
= (const char *[]){
1707 .flags
= CLK_SET_RATE_PARENT
,
1708 .ops
= &clk_branch2_ops
,
1713 static struct clk_branch camss_vfe_vfe_ahb_clk
= {
1716 .enable_reg
= 0x36b8,
1717 .enable_mask
= BIT(0),
1718 .hw
.init
= &(struct clk_init_data
){
1719 .name
= "camss_vfe_vfe_ahb_clk",
1720 .parent_names
= (const char *[]){
1724 .ops
= &clk_branch2_ops
,
1729 static struct clk_branch camss_vfe_vfe_axi_clk
= {
1732 .enable_reg
= 0x36bc,
1733 .enable_mask
= BIT(0),
1734 .hw
.init
= &(struct clk_init_data
){
1735 .name
= "camss_vfe_vfe_axi_clk",
1736 .parent_names
= (const char *[]){
1740 .ops
= &clk_branch2_ops
,
1745 static struct clk_branch camss_vfe_vfe_ocmemnoc_clk
= {
1748 .enable_reg
= 0x36c0,
1749 .enable_mask
= BIT(0),
1750 .hw
.init
= &(struct clk_init_data
){
1751 .name
= "camss_vfe_vfe_ocmemnoc_clk",
1752 .parent_names
= (const char *[]){
1756 .flags
= CLK_SET_RATE_PARENT
,
1757 .ops
= &clk_branch2_ops
,
1762 static struct clk_branch mdss_ahb_clk
= {
1765 .enable_reg
= 0x2308,
1766 .enable_mask
= BIT(0),
1767 .hw
.init
= &(struct clk_init_data
){
1768 .name
= "mdss_ahb_clk",
1769 .parent_names
= (const char *[]){
1773 .ops
= &clk_branch2_ops
,
1778 static struct clk_branch mdss_axi_clk
= {
1781 .enable_reg
= 0x2310,
1782 .enable_mask
= BIT(0),
1783 .hw
.init
= &(struct clk_init_data
){
1784 .name
= "mdss_axi_clk",
1785 .parent_names
= (const char *[]){
1789 .flags
= CLK_SET_RATE_PARENT
,
1790 .ops
= &clk_branch2_ops
,
1795 static struct clk_branch mdss_byte0_clk
= {
1798 .enable_reg
= 0x233c,
1799 .enable_mask
= BIT(0),
1800 .hw
.init
= &(struct clk_init_data
){
1801 .name
= "mdss_byte0_clk",
1802 .parent_names
= (const char *[]){
1806 .flags
= CLK_SET_RATE_PARENT
,
1807 .ops
= &clk_branch2_ops
,
1812 static struct clk_branch mdss_byte1_clk
= {
1815 .enable_reg
= 0x2340,
1816 .enable_mask
= BIT(0),
1817 .hw
.init
= &(struct clk_init_data
){
1818 .name
= "mdss_byte1_clk",
1819 .parent_names
= (const char *[]){
1823 .flags
= CLK_SET_RATE_PARENT
,
1824 .ops
= &clk_branch2_ops
,
1829 static struct clk_branch mdss_edpaux_clk
= {
1832 .enable_reg
= 0x2334,
1833 .enable_mask
= BIT(0),
1834 .hw
.init
= &(struct clk_init_data
){
1835 .name
= "mdss_edpaux_clk",
1836 .parent_names
= (const char *[]){
1840 .flags
= CLK_SET_RATE_PARENT
,
1841 .ops
= &clk_branch2_ops
,
1846 static struct clk_branch mdss_edplink_clk
= {
1849 .enable_reg
= 0x2330,
1850 .enable_mask
= BIT(0),
1851 .hw
.init
= &(struct clk_init_data
){
1852 .name
= "mdss_edplink_clk",
1853 .parent_names
= (const char *[]){
1857 .flags
= CLK_SET_RATE_PARENT
,
1858 .ops
= &clk_branch2_ops
,
1863 static struct clk_branch mdss_edppixel_clk
= {
1866 .enable_reg
= 0x232c,
1867 .enable_mask
= BIT(0),
1868 .hw
.init
= &(struct clk_init_data
){
1869 .name
= "mdss_edppixel_clk",
1870 .parent_names
= (const char *[]){
1874 .flags
= CLK_SET_RATE_PARENT
,
1875 .ops
= &clk_branch2_ops
,
1880 static struct clk_branch mdss_esc0_clk
= {
1883 .enable_reg
= 0x2344,
1884 .enable_mask
= BIT(0),
1885 .hw
.init
= &(struct clk_init_data
){
1886 .name
= "mdss_esc0_clk",
1887 .parent_names
= (const char *[]){
1891 .flags
= CLK_SET_RATE_PARENT
,
1892 .ops
= &clk_branch2_ops
,
1897 static struct clk_branch mdss_esc1_clk
= {
1900 .enable_reg
= 0x2348,
1901 .enable_mask
= BIT(0),
1902 .hw
.init
= &(struct clk_init_data
){
1903 .name
= "mdss_esc1_clk",
1904 .parent_names
= (const char *[]){
1908 .flags
= CLK_SET_RATE_PARENT
,
1909 .ops
= &clk_branch2_ops
,
1914 static struct clk_branch mdss_extpclk_clk
= {
1917 .enable_reg
= 0x2324,
1918 .enable_mask
= BIT(0),
1919 .hw
.init
= &(struct clk_init_data
){
1920 .name
= "mdss_extpclk_clk",
1921 .parent_names
= (const char *[]){
1925 .flags
= CLK_SET_RATE_PARENT
,
1926 .ops
= &clk_branch2_ops
,
1931 static struct clk_branch mdss_hdmi_ahb_clk
= {
1934 .enable_reg
= 0x230c,
1935 .enable_mask
= BIT(0),
1936 .hw
.init
= &(struct clk_init_data
){
1937 .name
= "mdss_hdmi_ahb_clk",
1938 .parent_names
= (const char *[]){
1942 .ops
= &clk_branch2_ops
,
1947 static struct clk_branch mdss_hdmi_clk
= {
1950 .enable_reg
= 0x2338,
1951 .enable_mask
= BIT(0),
1952 .hw
.init
= &(struct clk_init_data
){
1953 .name
= "mdss_hdmi_clk",
1954 .parent_names
= (const char *[]){
1958 .flags
= CLK_SET_RATE_PARENT
,
1959 .ops
= &clk_branch2_ops
,
1964 static struct clk_branch mdss_mdp_clk
= {
1967 .enable_reg
= 0x231c,
1968 .enable_mask
= BIT(0),
1969 .hw
.init
= &(struct clk_init_data
){
1970 .name
= "mdss_mdp_clk",
1971 .parent_names
= (const char *[]){
1975 .flags
= CLK_SET_RATE_PARENT
,
1976 .ops
= &clk_branch2_ops
,
1981 static struct clk_branch mdss_mdp_lut_clk
= {
1984 .enable_reg
= 0x2320,
1985 .enable_mask
= BIT(0),
1986 .hw
.init
= &(struct clk_init_data
){
1987 .name
= "mdss_mdp_lut_clk",
1988 .parent_names
= (const char *[]){
1992 .flags
= CLK_SET_RATE_PARENT
,
1993 .ops
= &clk_branch2_ops
,
1998 static struct clk_branch mdss_pclk0_clk
= {
2001 .enable_reg
= 0x2314,
2002 .enable_mask
= BIT(0),
2003 .hw
.init
= &(struct clk_init_data
){
2004 .name
= "mdss_pclk0_clk",
2005 .parent_names
= (const char *[]){
2009 .flags
= CLK_SET_RATE_PARENT
,
2010 .ops
= &clk_branch2_ops
,
2015 static struct clk_branch mdss_pclk1_clk
= {
2018 .enable_reg
= 0x2318,
2019 .enable_mask
= BIT(0),
2020 .hw
.init
= &(struct clk_init_data
){
2021 .name
= "mdss_pclk1_clk",
2022 .parent_names
= (const char *[]){
2026 .flags
= CLK_SET_RATE_PARENT
,
2027 .ops
= &clk_branch2_ops
,
2032 static struct clk_branch mdss_vsync_clk
= {
2035 .enable_reg
= 0x2328,
2036 .enable_mask
= BIT(0),
2037 .hw
.init
= &(struct clk_init_data
){
2038 .name
= "mdss_vsync_clk",
2039 .parent_names
= (const char *[]){
2043 .flags
= CLK_SET_RATE_PARENT
,
2044 .ops
= &clk_branch2_ops
,
2049 static struct clk_branch mmss_misc_ahb_clk
= {
2052 .enable_reg
= 0x502c,
2053 .enable_mask
= BIT(0),
2054 .hw
.init
= &(struct clk_init_data
){
2055 .name
= "mmss_misc_ahb_clk",
2056 .parent_names
= (const char *[]){
2060 .ops
= &clk_branch2_ops
,
2065 static struct clk_branch mmss_mmssnoc_ahb_clk
= {
2068 .enable_reg
= 0x5024,
2069 .enable_mask
= BIT(0),
2070 .hw
.init
= &(struct clk_init_data
){
2071 .name
= "mmss_mmssnoc_ahb_clk",
2072 .parent_names
= (const char *[]){
2076 .ops
= &clk_branch2_ops
,
2077 .flags
= CLK_IGNORE_UNUSED
,
2082 static struct clk_branch mmss_mmssnoc_bto_ahb_clk
= {
2085 .enable_reg
= 0x5028,
2086 .enable_mask
= BIT(0),
2087 .hw
.init
= &(struct clk_init_data
){
2088 .name
= "mmss_mmssnoc_bto_ahb_clk",
2089 .parent_names
= (const char *[]){
2093 .ops
= &clk_branch2_ops
,
2094 .flags
= CLK_IGNORE_UNUSED
,
2099 static struct clk_branch mmss_mmssnoc_axi_clk
= {
2102 .enable_reg
= 0x506c,
2103 .enable_mask
= BIT(0),
2104 .hw
.init
= &(struct clk_init_data
){
2105 .name
= "mmss_mmssnoc_axi_clk",
2106 .parent_names
= (const char *[]){
2110 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2111 .ops
= &clk_branch2_ops
,
2116 static struct clk_branch mmss_s0_axi_clk
= {
2119 .enable_reg
= 0x5064,
2120 .enable_mask
= BIT(0),
2121 .hw
.init
= &(struct clk_init_data
){
2122 .name
= "mmss_s0_axi_clk",
2123 .parent_names
= (const char *[]){
2127 .ops
= &clk_branch2_ops
,
2128 .flags
= CLK_IGNORE_UNUSED
,
2133 static struct clk_branch ocmemcx_ahb_clk
= {
2136 .enable_reg
= 0x405c,
2137 .enable_mask
= BIT(0),
2138 .hw
.init
= &(struct clk_init_data
){
2139 .name
= "ocmemcx_ahb_clk",
2140 .parent_names
= (const char *[]){
2144 .ops
= &clk_branch2_ops
,
2149 static struct clk_branch ocmemcx_ocmemnoc_clk
= {
2152 .enable_reg
= 0x4058,
2153 .enable_mask
= BIT(0),
2154 .hw
.init
= &(struct clk_init_data
){
2155 .name
= "ocmemcx_ocmemnoc_clk",
2156 .parent_names
= (const char *[]){
2160 .flags
= CLK_SET_RATE_PARENT
,
2161 .ops
= &clk_branch2_ops
,
2166 static struct clk_branch oxili_ocmemgx_clk
= {
2169 .enable_reg
= 0x402c,
2170 .enable_mask
= BIT(0),
2171 .hw
.init
= &(struct clk_init_data
){
2172 .name
= "oxili_ocmemgx_clk",
2173 .parent_names
= (const char *[]){
2177 .flags
= CLK_SET_RATE_PARENT
,
2178 .ops
= &clk_branch2_ops
,
2183 static struct clk_branch ocmemnoc_clk
= {
2186 .enable_reg
= 0x50b4,
2187 .enable_mask
= BIT(0),
2188 .hw
.init
= &(struct clk_init_data
){
2189 .name
= "ocmemnoc_clk",
2190 .parent_names
= (const char *[]){
2194 .flags
= CLK_SET_RATE_PARENT
,
2195 .ops
= &clk_branch2_ops
,
2200 static struct clk_branch oxili_gfx3d_clk
= {
2203 .enable_reg
= 0x4028,
2204 .enable_mask
= BIT(0),
2205 .hw
.init
= &(struct clk_init_data
){
2206 .name
= "oxili_gfx3d_clk",
2207 .parent_names
= (const char *[]){
2211 .flags
= CLK_SET_RATE_PARENT
,
2212 .ops
= &clk_branch2_ops
,
2217 static struct clk_branch oxilicx_ahb_clk
= {
2220 .enable_reg
= 0x403c,
2221 .enable_mask
= BIT(0),
2222 .hw
.init
= &(struct clk_init_data
){
2223 .name
= "oxilicx_ahb_clk",
2224 .parent_names
= (const char *[]){
2228 .ops
= &clk_branch2_ops
,
2233 static struct clk_branch oxilicx_axi_clk
= {
2236 .enable_reg
= 0x4038,
2237 .enable_mask
= BIT(0),
2238 .hw
.init
= &(struct clk_init_data
){
2239 .name
= "oxilicx_axi_clk",
2240 .parent_names
= (const char *[]){
2244 .ops
= &clk_branch2_ops
,
2249 static struct clk_branch venus0_ahb_clk
= {
2252 .enable_reg
= 0x1030,
2253 .enable_mask
= BIT(0),
2254 .hw
.init
= &(struct clk_init_data
){
2255 .name
= "venus0_ahb_clk",
2256 .parent_names
= (const char *[]){
2260 .ops
= &clk_branch2_ops
,
2265 static struct clk_branch venus0_axi_clk
= {
2268 .enable_reg
= 0x1034,
2269 .enable_mask
= BIT(0),
2270 .hw
.init
= &(struct clk_init_data
){
2271 .name
= "venus0_axi_clk",
2272 .parent_names
= (const char *[]){
2276 .ops
= &clk_branch2_ops
,
2281 static struct clk_branch venus0_ocmemnoc_clk
= {
2284 .enable_reg
= 0x1038,
2285 .enable_mask
= BIT(0),
2286 .hw
.init
= &(struct clk_init_data
){
2287 .name
= "venus0_ocmemnoc_clk",
2288 .parent_names
= (const char *[]){
2292 .flags
= CLK_SET_RATE_PARENT
,
2293 .ops
= &clk_branch2_ops
,
2298 static struct clk_branch venus0_vcodec0_clk
= {
2301 .enable_reg
= 0x1028,
2302 .enable_mask
= BIT(0),
2303 .hw
.init
= &(struct clk_init_data
){
2304 .name
= "venus0_vcodec0_clk",
2305 .parent_names
= (const char *[]){
2309 .flags
= CLK_SET_RATE_PARENT
,
2310 .ops
= &clk_branch2_ops
,
2315 static const struct pll_config mmpll1_config
= {
2320 .vco_mask
= 0x3 << 20,
2322 .pre_div_mask
= 0x7 << 12,
2323 .post_div_val
= 0x0,
2324 .post_div_mask
= 0x3 << 8,
2325 .mn_ena_mask
= BIT(24),
2326 .main_output_mask
= BIT(0),
2329 static struct pll_config mmpll3_config
= {
2334 .vco_mask
= 0x3 << 20,
2336 .pre_div_mask
= 0x7 << 12,
2337 .post_div_val
= 0x0,
2338 .post_div_mask
= 0x3 << 8,
2339 .mn_ena_mask
= BIT(24),
2340 .main_output_mask
= BIT(0),
2341 .aux_output_mask
= BIT(1),
2344 static struct gdsc venus0_gdsc
= {
2346 .cxcs
= (unsigned int []){ 0x1028 },
2348 .resets
= (unsigned int []){ VENUS0_RESET
},
2353 .pwrsts
= PWRSTS_ON
,
2356 static struct gdsc mdss_gdsc
= {
2358 .cxcs
= (unsigned int []){ 0x231c, 0x2320 },
2363 .pwrsts
= PWRSTS_RET_ON
,
2366 static struct gdsc camss_jpeg_gdsc
= {
2368 .cxcs
= (unsigned int []){ 0x35a8, 0x35ac, 0x35b0 },
2371 .name
= "camss_jpeg",
2373 .pwrsts
= PWRSTS_OFF_ON
,
2376 static struct gdsc camss_vfe_gdsc
= {
2378 .cxcs
= (unsigned int []){ 0x36a8, 0x36ac, 0x3704, 0x3714, 0x36b0 },
2381 .name
= "camss_vfe",
2383 .pwrsts
= PWRSTS_OFF_ON
,
2386 static struct gdsc oxili_gdsc
= {
2388 .cxcs
= (unsigned int []){ 0x4028 },
2393 .pwrsts
= PWRSTS_OFF_ON
,
2396 static struct gdsc oxilicx_gdsc
= {
2401 .parent
= &oxili_gdsc
.pd
,
2402 .pwrsts
= PWRSTS_OFF_ON
,
2405 static struct clk_regmap
*mmcc_msm8974_clocks
[] = {
2406 [MMSS_AHB_CLK_SRC
] = &mmss_ahb_clk_src
.clkr
,
2407 [MMSS_AXI_CLK_SRC
] = &mmss_axi_clk_src
.clkr
,
2408 [OCMEMNOC_CLK_SRC
] = &ocmemnoc_clk_src
.clkr
,
2409 [MMPLL0
] = &mmpll0
.clkr
,
2410 [MMPLL0_VOTE
] = &mmpll0_vote
,
2411 [MMPLL1
] = &mmpll1
.clkr
,
2412 [MMPLL1_VOTE
] = &mmpll1_vote
,
2413 [MMPLL2
] = &mmpll2
.clkr
,
2414 [MMPLL3
] = &mmpll3
.clkr
,
2415 [CSI0_CLK_SRC
] = &csi0_clk_src
.clkr
,
2416 [CSI1_CLK_SRC
] = &csi1_clk_src
.clkr
,
2417 [CSI2_CLK_SRC
] = &csi2_clk_src
.clkr
,
2418 [CSI3_CLK_SRC
] = &csi3_clk_src
.clkr
,
2419 [VFE0_CLK_SRC
] = &vfe0_clk_src
.clkr
,
2420 [VFE1_CLK_SRC
] = &vfe1_clk_src
.clkr
,
2421 [MDP_CLK_SRC
] = &mdp_clk_src
.clkr
,
2422 [GFX3D_CLK_SRC
] = &gfx3d_clk_src
.clkr
,
2423 [JPEG0_CLK_SRC
] = &jpeg0_clk_src
.clkr
,
2424 [JPEG1_CLK_SRC
] = &jpeg1_clk_src
.clkr
,
2425 [JPEG2_CLK_SRC
] = &jpeg2_clk_src
.clkr
,
2426 [PCLK0_CLK_SRC
] = &pclk0_clk_src
.clkr
,
2427 [PCLK1_CLK_SRC
] = &pclk1_clk_src
.clkr
,
2428 [VCODEC0_CLK_SRC
] = &vcodec0_clk_src
.clkr
,
2429 [CCI_CLK_SRC
] = &cci_clk_src
.clkr
,
2430 [CAMSS_GP0_CLK_SRC
] = &camss_gp0_clk_src
.clkr
,
2431 [CAMSS_GP1_CLK_SRC
] = &camss_gp1_clk_src
.clkr
,
2432 [MCLK0_CLK_SRC
] = &mclk0_clk_src
.clkr
,
2433 [MCLK1_CLK_SRC
] = &mclk1_clk_src
.clkr
,
2434 [MCLK2_CLK_SRC
] = &mclk2_clk_src
.clkr
,
2435 [MCLK3_CLK_SRC
] = &mclk3_clk_src
.clkr
,
2436 [CSI0PHYTIMER_CLK_SRC
] = &csi0phytimer_clk_src
.clkr
,
2437 [CSI1PHYTIMER_CLK_SRC
] = &csi1phytimer_clk_src
.clkr
,
2438 [CSI2PHYTIMER_CLK_SRC
] = &csi2phytimer_clk_src
.clkr
,
2439 [CPP_CLK_SRC
] = &cpp_clk_src
.clkr
,
2440 [BYTE0_CLK_SRC
] = &byte0_clk_src
.clkr
,
2441 [BYTE1_CLK_SRC
] = &byte1_clk_src
.clkr
,
2442 [EDPAUX_CLK_SRC
] = &edpaux_clk_src
.clkr
,
2443 [EDPLINK_CLK_SRC
] = &edplink_clk_src
.clkr
,
2444 [EDPPIXEL_CLK_SRC
] = &edppixel_clk_src
.clkr
,
2445 [ESC0_CLK_SRC
] = &esc0_clk_src
.clkr
,
2446 [ESC1_CLK_SRC
] = &esc1_clk_src
.clkr
,
2447 [EXTPCLK_CLK_SRC
] = &extpclk_clk_src
.clkr
,
2448 [HDMI_CLK_SRC
] = &hdmi_clk_src
.clkr
,
2449 [VSYNC_CLK_SRC
] = &vsync_clk_src
.clkr
,
2450 [CAMSS_CCI_CCI_AHB_CLK
] = &camss_cci_cci_ahb_clk
.clkr
,
2451 [CAMSS_CCI_CCI_CLK
] = &camss_cci_cci_clk
.clkr
,
2452 [CAMSS_CSI0_AHB_CLK
] = &camss_csi0_ahb_clk
.clkr
,
2453 [CAMSS_CSI0_CLK
] = &camss_csi0_clk
.clkr
,
2454 [CAMSS_CSI0PHY_CLK
] = &camss_csi0phy_clk
.clkr
,
2455 [CAMSS_CSI0PIX_CLK
] = &camss_csi0pix_clk
.clkr
,
2456 [CAMSS_CSI0RDI_CLK
] = &camss_csi0rdi_clk
.clkr
,
2457 [CAMSS_CSI1_AHB_CLK
] = &camss_csi1_ahb_clk
.clkr
,
2458 [CAMSS_CSI1_CLK
] = &camss_csi1_clk
.clkr
,
2459 [CAMSS_CSI1PHY_CLK
] = &camss_csi1phy_clk
.clkr
,
2460 [CAMSS_CSI1PIX_CLK
] = &camss_csi1pix_clk
.clkr
,
2461 [CAMSS_CSI1RDI_CLK
] = &camss_csi1rdi_clk
.clkr
,
2462 [CAMSS_CSI2_AHB_CLK
] = &camss_csi2_ahb_clk
.clkr
,
2463 [CAMSS_CSI2_CLK
] = &camss_csi2_clk
.clkr
,
2464 [CAMSS_CSI2PHY_CLK
] = &camss_csi2phy_clk
.clkr
,
2465 [CAMSS_CSI2PIX_CLK
] = &camss_csi2pix_clk
.clkr
,
2466 [CAMSS_CSI2RDI_CLK
] = &camss_csi2rdi_clk
.clkr
,
2467 [CAMSS_CSI3_AHB_CLK
] = &camss_csi3_ahb_clk
.clkr
,
2468 [CAMSS_CSI3_CLK
] = &camss_csi3_clk
.clkr
,
2469 [CAMSS_CSI3PHY_CLK
] = &camss_csi3phy_clk
.clkr
,
2470 [CAMSS_CSI3PIX_CLK
] = &camss_csi3pix_clk
.clkr
,
2471 [CAMSS_CSI3RDI_CLK
] = &camss_csi3rdi_clk
.clkr
,
2472 [CAMSS_CSI_VFE0_CLK
] = &camss_csi_vfe0_clk
.clkr
,
2473 [CAMSS_CSI_VFE1_CLK
] = &camss_csi_vfe1_clk
.clkr
,
2474 [CAMSS_GP0_CLK
] = &camss_gp0_clk
.clkr
,
2475 [CAMSS_GP1_CLK
] = &camss_gp1_clk
.clkr
,
2476 [CAMSS_ISPIF_AHB_CLK
] = &camss_ispif_ahb_clk
.clkr
,
2477 [CAMSS_JPEG_JPEG0_CLK
] = &camss_jpeg_jpeg0_clk
.clkr
,
2478 [CAMSS_JPEG_JPEG1_CLK
] = &camss_jpeg_jpeg1_clk
.clkr
,
2479 [CAMSS_JPEG_JPEG2_CLK
] = &camss_jpeg_jpeg2_clk
.clkr
,
2480 [CAMSS_JPEG_JPEG_AHB_CLK
] = &camss_jpeg_jpeg_ahb_clk
.clkr
,
2481 [CAMSS_JPEG_JPEG_AXI_CLK
] = &camss_jpeg_jpeg_axi_clk
.clkr
,
2482 [CAMSS_JPEG_JPEG_OCMEMNOC_CLK
] = &camss_jpeg_jpeg_ocmemnoc_clk
.clkr
,
2483 [CAMSS_MCLK0_CLK
] = &camss_mclk0_clk
.clkr
,
2484 [CAMSS_MCLK1_CLK
] = &camss_mclk1_clk
.clkr
,
2485 [CAMSS_MCLK2_CLK
] = &camss_mclk2_clk
.clkr
,
2486 [CAMSS_MCLK3_CLK
] = &camss_mclk3_clk
.clkr
,
2487 [CAMSS_MICRO_AHB_CLK
] = &camss_micro_ahb_clk
.clkr
,
2488 [CAMSS_PHY0_CSI0PHYTIMER_CLK
] = &camss_phy0_csi0phytimer_clk
.clkr
,
2489 [CAMSS_PHY1_CSI1PHYTIMER_CLK
] = &camss_phy1_csi1phytimer_clk
.clkr
,
2490 [CAMSS_PHY2_CSI2PHYTIMER_CLK
] = &camss_phy2_csi2phytimer_clk
.clkr
,
2491 [CAMSS_TOP_AHB_CLK
] = &camss_top_ahb_clk
.clkr
,
2492 [CAMSS_VFE_CPP_AHB_CLK
] = &camss_vfe_cpp_ahb_clk
.clkr
,
2493 [CAMSS_VFE_CPP_CLK
] = &camss_vfe_cpp_clk
.clkr
,
2494 [CAMSS_VFE_VFE0_CLK
] = &camss_vfe_vfe0_clk
.clkr
,
2495 [CAMSS_VFE_VFE1_CLK
] = &camss_vfe_vfe1_clk
.clkr
,
2496 [CAMSS_VFE_VFE_AHB_CLK
] = &camss_vfe_vfe_ahb_clk
.clkr
,
2497 [CAMSS_VFE_VFE_AXI_CLK
] = &camss_vfe_vfe_axi_clk
.clkr
,
2498 [CAMSS_VFE_VFE_OCMEMNOC_CLK
] = &camss_vfe_vfe_ocmemnoc_clk
.clkr
,
2499 [MDSS_AHB_CLK
] = &mdss_ahb_clk
.clkr
,
2500 [MDSS_AXI_CLK
] = &mdss_axi_clk
.clkr
,
2501 [MDSS_BYTE0_CLK
] = &mdss_byte0_clk
.clkr
,
2502 [MDSS_BYTE1_CLK
] = &mdss_byte1_clk
.clkr
,
2503 [MDSS_EDPAUX_CLK
] = &mdss_edpaux_clk
.clkr
,
2504 [MDSS_EDPLINK_CLK
] = &mdss_edplink_clk
.clkr
,
2505 [MDSS_EDPPIXEL_CLK
] = &mdss_edppixel_clk
.clkr
,
2506 [MDSS_ESC0_CLK
] = &mdss_esc0_clk
.clkr
,
2507 [MDSS_ESC1_CLK
] = &mdss_esc1_clk
.clkr
,
2508 [MDSS_EXTPCLK_CLK
] = &mdss_extpclk_clk
.clkr
,
2509 [MDSS_HDMI_AHB_CLK
] = &mdss_hdmi_ahb_clk
.clkr
,
2510 [MDSS_HDMI_CLK
] = &mdss_hdmi_clk
.clkr
,
2511 [MDSS_MDP_CLK
] = &mdss_mdp_clk
.clkr
,
2512 [MDSS_MDP_LUT_CLK
] = &mdss_mdp_lut_clk
.clkr
,
2513 [MDSS_PCLK0_CLK
] = &mdss_pclk0_clk
.clkr
,
2514 [MDSS_PCLK1_CLK
] = &mdss_pclk1_clk
.clkr
,
2515 [MDSS_VSYNC_CLK
] = &mdss_vsync_clk
.clkr
,
2516 [MMSS_MISC_AHB_CLK
] = &mmss_misc_ahb_clk
.clkr
,
2517 [MMSS_MMSSNOC_AHB_CLK
] = &mmss_mmssnoc_ahb_clk
.clkr
,
2518 [MMSS_MMSSNOC_BTO_AHB_CLK
] = &mmss_mmssnoc_bto_ahb_clk
.clkr
,
2519 [MMSS_MMSSNOC_AXI_CLK
] = &mmss_mmssnoc_axi_clk
.clkr
,
2520 [MMSS_S0_AXI_CLK
] = &mmss_s0_axi_clk
.clkr
,
2521 [OCMEMCX_AHB_CLK
] = &ocmemcx_ahb_clk
.clkr
,
2522 [OCMEMCX_OCMEMNOC_CLK
] = &ocmemcx_ocmemnoc_clk
.clkr
,
2523 [OXILI_OCMEMGX_CLK
] = &oxili_ocmemgx_clk
.clkr
,
2524 [OCMEMNOC_CLK
] = &ocmemnoc_clk
.clkr
,
2525 [OXILI_GFX3D_CLK
] = &oxili_gfx3d_clk
.clkr
,
2526 [OXILICX_AHB_CLK
] = &oxilicx_ahb_clk
.clkr
,
2527 [OXILICX_AXI_CLK
] = &oxilicx_axi_clk
.clkr
,
2528 [VENUS0_AHB_CLK
] = &venus0_ahb_clk
.clkr
,
2529 [VENUS0_AXI_CLK
] = &venus0_axi_clk
.clkr
,
2530 [VENUS0_OCMEMNOC_CLK
] = &venus0_ocmemnoc_clk
.clkr
,
2531 [VENUS0_VCODEC0_CLK
] = &venus0_vcodec0_clk
.clkr
,
2534 static const struct qcom_reset_map mmcc_msm8974_resets
[] = {
2535 [SPDM_RESET
] = { 0x0200 },
2536 [SPDM_RM_RESET
] = { 0x0300 },
2537 [VENUS0_RESET
] = { 0x1020 },
2538 [MDSS_RESET
] = { 0x2300 },
2539 [CAMSS_PHY0_RESET
] = { 0x3020 },
2540 [CAMSS_PHY1_RESET
] = { 0x3050 },
2541 [CAMSS_PHY2_RESET
] = { 0x3080 },
2542 [CAMSS_CSI0_RESET
] = { 0x30b0 },
2543 [CAMSS_CSI0PHY_RESET
] = { 0x30c0 },
2544 [CAMSS_CSI0RDI_RESET
] = { 0x30d0 },
2545 [CAMSS_CSI0PIX_RESET
] = { 0x30e0 },
2546 [CAMSS_CSI1_RESET
] = { 0x3120 },
2547 [CAMSS_CSI1PHY_RESET
] = { 0x3130 },
2548 [CAMSS_CSI1RDI_RESET
] = { 0x3140 },
2549 [CAMSS_CSI1PIX_RESET
] = { 0x3150 },
2550 [CAMSS_CSI2_RESET
] = { 0x3180 },
2551 [CAMSS_CSI2PHY_RESET
] = { 0x3190 },
2552 [CAMSS_CSI2RDI_RESET
] = { 0x31a0 },
2553 [CAMSS_CSI2PIX_RESET
] = { 0x31b0 },
2554 [CAMSS_CSI3_RESET
] = { 0x31e0 },
2555 [CAMSS_CSI3PHY_RESET
] = { 0x31f0 },
2556 [CAMSS_CSI3RDI_RESET
] = { 0x3200 },
2557 [CAMSS_CSI3PIX_RESET
] = { 0x3210 },
2558 [CAMSS_ISPIF_RESET
] = { 0x3220 },
2559 [CAMSS_CCI_RESET
] = { 0x3340 },
2560 [CAMSS_MCLK0_RESET
] = { 0x3380 },
2561 [CAMSS_MCLK1_RESET
] = { 0x33b0 },
2562 [CAMSS_MCLK2_RESET
] = { 0x33e0 },
2563 [CAMSS_MCLK3_RESET
] = { 0x3410 },
2564 [CAMSS_GP0_RESET
] = { 0x3440 },
2565 [CAMSS_GP1_RESET
] = { 0x3470 },
2566 [CAMSS_TOP_RESET
] = { 0x3480 },
2567 [CAMSS_MICRO_RESET
] = { 0x3490 },
2568 [CAMSS_JPEG_RESET
] = { 0x35a0 },
2569 [CAMSS_VFE_RESET
] = { 0x36a0 },
2570 [CAMSS_CSI_VFE0_RESET
] = { 0x3700 },
2571 [CAMSS_CSI_VFE1_RESET
] = { 0x3710 },
2572 [OXILI_RESET
] = { 0x4020 },
2573 [OXILICX_RESET
] = { 0x4030 },
2574 [OCMEMCX_RESET
] = { 0x4050 },
2575 [MMSS_RBCRP_RESET
] = { 0x4080 },
2576 [MMSSNOCAHB_RESET
] = { 0x5020 },
2577 [MMSSNOCAXI_RESET
] = { 0x5060 },
2578 [OCMEMNOC_RESET
] = { 0x50b0 },
2581 static struct gdsc
*mmcc_msm8974_gdscs
[] = {
2582 [VENUS0_GDSC
] = &venus0_gdsc
,
2583 [MDSS_GDSC
] = &mdss_gdsc
,
2584 [CAMSS_JPEG_GDSC
] = &camss_jpeg_gdsc
,
2585 [CAMSS_VFE_GDSC
] = &camss_vfe_gdsc
,
2586 [OXILI_GDSC
] = &oxili_gdsc
,
2587 [OXILICX_GDSC
] = &oxilicx_gdsc
,
2590 static const struct regmap_config mmcc_msm8974_regmap_config
= {
2594 .max_register
= 0x5104,
2598 static const struct qcom_cc_desc mmcc_msm8974_desc
= {
2599 .config
= &mmcc_msm8974_regmap_config
,
2600 .clks
= mmcc_msm8974_clocks
,
2601 .num_clks
= ARRAY_SIZE(mmcc_msm8974_clocks
),
2602 .resets
= mmcc_msm8974_resets
,
2603 .num_resets
= ARRAY_SIZE(mmcc_msm8974_resets
),
2604 .gdscs
= mmcc_msm8974_gdscs
,
2605 .num_gdscs
= ARRAY_SIZE(mmcc_msm8974_gdscs
),
2608 static const struct of_device_id mmcc_msm8974_match_table
[] = {
2609 { .compatible
= "qcom,mmcc-msm8974" },
2612 MODULE_DEVICE_TABLE(of
, mmcc_msm8974_match_table
);
2614 static int mmcc_msm8974_probe(struct platform_device
*pdev
)
2616 struct regmap
*regmap
;
2618 regmap
= qcom_cc_map(pdev
, &mmcc_msm8974_desc
);
2620 return PTR_ERR(regmap
);
2622 clk_pll_configure_sr_hpm_lp(&mmpll1
, regmap
, &mmpll1_config
, true);
2623 clk_pll_configure_sr_hpm_lp(&mmpll3
, regmap
, &mmpll3_config
, false);
2625 return qcom_cc_really_probe(pdev
, &mmcc_msm8974_desc
, regmap
);
2628 static struct platform_driver mmcc_msm8974_driver
= {
2629 .probe
= mmcc_msm8974_probe
,
2631 .name
= "mmcc-msm8974",
2632 .of_match_table
= mmcc_msm8974_match_table
,
2635 module_platform_driver(mmcc_msm8974_driver
);
2637 MODULE_DESCRIPTION("QCOM MMCC MSM8974 Driver");
2638 MODULE_LICENSE("GPL v2");
2639 MODULE_ALIAS("platform:mmcc-msm8974");