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>
28 #include "clk-regmap.h"
31 #include "clk-branch.h"
47 static const u8 mmcc_xo_mmpll0_mmpll1_gpll0_map
[] = {
54 static const char *mmcc_xo_mmpll0_mmpll1_gpll0
[] = {
61 static const u8 mmcc_xo_mmpll0_dsi_hdmi_gpll0_map
[] = {
70 static const char *mmcc_xo_mmpll0_dsi_hdmi_gpll0
[] = {
79 static const u8 mmcc_xo_mmpll0_1_2_gpll0_map
[] = {
87 static const char *mmcc_xo_mmpll0_1_2_gpll0
[] = {
95 static const u8 mmcc_xo_mmpll0_1_3_gpll0_map
[] = {
103 static const char *mmcc_xo_mmpll0_1_3_gpll0
[] = {
111 static const u8 mmcc_xo_mmpll0_1_gpll1_0_map
[] = {
119 static const char *mmcc_xo_mmpll0_1_gpll1_0
[] = {
127 static const u8 mmcc_xo_dsi_hdmi_edp_map
[] = {
136 static const char *mmcc_xo_dsi_hdmi_edp
[] = {
145 static const u8 mmcc_xo_dsi_hdmi_edp_gpll0_map
[] = {
154 static const char *mmcc_xo_dsi_hdmi_edp_gpll0
[] = {
163 #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
165 static struct clk_pll mmpll0
= {
169 .config_reg
= 0x0014,
171 .status_reg
= 0x001c,
172 .clkr
.hw
.init
= &(struct clk_init_data
){
174 .parent_names
= (const char *[]){ "xo" },
180 static struct clk_regmap mmpll0_vote
= {
181 .enable_reg
= 0x0100,
182 .enable_mask
= BIT(0),
183 .hw
.init
= &(struct clk_init_data
){
184 .name
= "mmpll0_vote",
185 .parent_names
= (const char *[]){ "mmpll0" },
187 .ops
= &clk_pll_vote_ops
,
191 static struct clk_pll mmpll1
= {
195 .config_reg
= 0x0054,
197 .status_reg
= 0x005c,
198 .clkr
.hw
.init
= &(struct clk_init_data
){
200 .parent_names
= (const char *[]){ "xo" },
206 static struct clk_regmap mmpll1_vote
= {
207 .enable_reg
= 0x0100,
208 .enable_mask
= BIT(1),
209 .hw
.init
= &(struct clk_init_data
){
210 .name
= "mmpll1_vote",
211 .parent_names
= (const char *[]){ "mmpll1" },
213 .ops
= &clk_pll_vote_ops
,
217 static struct clk_pll mmpll2
= {
221 .config_reg
= 0x4114,
223 .status_reg
= 0x411c,
224 .clkr
.hw
.init
= &(struct clk_init_data
){
226 .parent_names
= (const char *[]){ "xo" },
232 static struct clk_pll mmpll3
= {
236 .config_reg
= 0x0094,
238 .status_reg
= 0x009c,
239 .clkr
.hw
.init
= &(struct clk_init_data
){
241 .parent_names
= (const char *[]){ "xo" },
247 static struct clk_rcg2 mmss_ahb_clk_src
= {
250 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
251 .clkr
.hw
.init
= &(struct clk_init_data
){
252 .name
= "mmss_ahb_clk_src",
253 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
255 .ops
= &clk_rcg2_ops
,
259 static struct freq_tbl ftbl_mmss_axi_clk
[] = {
260 F( 19200000, P_XO
, 1, 0, 0),
261 F( 37500000, P_GPLL0
, 16, 0, 0),
262 F( 50000000, P_GPLL0
, 12, 0, 0),
263 F( 75000000, P_GPLL0
, 8, 0, 0),
264 F(100000000, P_GPLL0
, 6, 0, 0),
265 F(150000000, P_GPLL0
, 4, 0, 0),
266 F(291750000, P_MMPLL1
, 4, 0, 0),
267 F(400000000, P_MMPLL0
, 2, 0, 0),
268 F(466800000, P_MMPLL1
, 2.5, 0, 0),
271 static struct clk_rcg2 mmss_axi_clk_src
= {
274 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
275 .freq_tbl
= ftbl_mmss_axi_clk
,
276 .clkr
.hw
.init
= &(struct clk_init_data
){
277 .name
= "mmss_axi_clk_src",
278 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
280 .ops
= &clk_rcg2_ops
,
284 static struct freq_tbl ftbl_ocmemnoc_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),
295 static struct clk_rcg2 ocmemnoc_clk_src
= {
298 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
299 .freq_tbl
= ftbl_ocmemnoc_clk
,
300 .clkr
.hw
.init
= &(struct clk_init_data
){
301 .name
= "ocmemnoc_clk_src",
302 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
304 .ops
= &clk_rcg2_ops
,
308 static struct freq_tbl ftbl_camss_csi0_3_clk
[] = {
309 F(100000000, P_GPLL0
, 6, 0, 0),
310 F(200000000, P_MMPLL0
, 4, 0, 0),
314 static struct clk_rcg2 csi0_clk_src
= {
317 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
318 .freq_tbl
= ftbl_camss_csi0_3_clk
,
319 .clkr
.hw
.init
= &(struct clk_init_data
){
320 .name
= "csi0_clk_src",
321 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
323 .ops
= &clk_rcg2_ops
,
327 static struct clk_rcg2 csi1_clk_src
= {
330 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
331 .freq_tbl
= ftbl_camss_csi0_3_clk
,
332 .clkr
.hw
.init
= &(struct clk_init_data
){
333 .name
= "csi1_clk_src",
334 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
336 .ops
= &clk_rcg2_ops
,
340 static struct clk_rcg2 csi2_clk_src
= {
343 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
344 .freq_tbl
= ftbl_camss_csi0_3_clk
,
345 .clkr
.hw
.init
= &(struct clk_init_data
){
346 .name
= "csi2_clk_src",
347 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
349 .ops
= &clk_rcg2_ops
,
353 static struct clk_rcg2 csi3_clk_src
= {
356 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
357 .freq_tbl
= ftbl_camss_csi0_3_clk
,
358 .clkr
.hw
.init
= &(struct clk_init_data
){
359 .name
= "csi3_clk_src",
360 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
362 .ops
= &clk_rcg2_ops
,
366 static struct freq_tbl ftbl_camss_vfe_vfe0_1_clk
[] = {
367 F(37500000, P_GPLL0
, 16, 0, 0),
368 F(50000000, P_GPLL0
, 12, 0, 0),
369 F(60000000, P_GPLL0
, 10, 0, 0),
370 F(80000000, P_GPLL0
, 7.5, 0, 0),
371 F(100000000, P_GPLL0
, 6, 0, 0),
372 F(109090000, P_GPLL0
, 5.5, 0, 0),
373 F(133330000, P_GPLL0
, 4.5, 0, 0),
374 F(200000000, P_GPLL0
, 3, 0, 0),
375 F(228570000, P_MMPLL0
, 3.5, 0, 0),
376 F(266670000, P_MMPLL0
, 3, 0, 0),
377 F(320000000, P_MMPLL0
, 2.5, 0, 0),
378 F(400000000, P_MMPLL0
, 2, 0, 0),
379 F(465000000, P_MMPLL3
, 2, 0, 0),
383 static struct clk_rcg2 vfe0_clk_src
= {
386 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
387 .freq_tbl
= ftbl_camss_vfe_vfe0_1_clk
,
388 .clkr
.hw
.init
= &(struct clk_init_data
){
389 .name
= "vfe0_clk_src",
390 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
392 .ops
= &clk_rcg2_ops
,
396 static struct clk_rcg2 vfe1_clk_src
= {
399 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
400 .freq_tbl
= ftbl_camss_vfe_vfe0_1_clk
,
401 .clkr
.hw
.init
= &(struct clk_init_data
){
402 .name
= "vfe1_clk_src",
403 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
405 .ops
= &clk_rcg2_ops
,
409 static struct freq_tbl ftbl_mdss_mdp_clk
[] = {
410 F(37500000, P_GPLL0
, 16, 0, 0),
411 F(60000000, P_GPLL0
, 10, 0, 0),
412 F(75000000, P_GPLL0
, 8, 0, 0),
413 F(85710000, P_GPLL0
, 7, 0, 0),
414 F(100000000, P_GPLL0
, 6, 0, 0),
415 F(133330000, P_MMPLL0
, 6, 0, 0),
416 F(160000000, P_MMPLL0
, 5, 0, 0),
417 F(200000000, P_MMPLL0
, 4, 0, 0),
418 F(228570000, P_MMPLL0
, 3.5, 0, 0),
419 F(240000000, P_GPLL0
, 2.5, 0, 0),
420 F(266670000, P_MMPLL0
, 3, 0, 0),
421 F(320000000, P_MMPLL0
, 2.5, 0, 0),
425 static struct clk_rcg2 mdp_clk_src
= {
428 .parent_map
= mmcc_xo_mmpll0_dsi_hdmi_gpll0_map
,
429 .freq_tbl
= ftbl_mdss_mdp_clk
,
430 .clkr
.hw
.init
= &(struct clk_init_data
){
431 .name
= "mdp_clk_src",
432 .parent_names
= mmcc_xo_mmpll0_dsi_hdmi_gpll0
,
434 .ops
= &clk_rcg2_ops
,
438 static struct clk_rcg2 gfx3d_clk_src
= {
441 .parent_map
= mmcc_xo_mmpll0_1_2_gpll0_map
,
442 .clkr
.hw
.init
= &(struct clk_init_data
){
443 .name
= "gfx3d_clk_src",
444 .parent_names
= mmcc_xo_mmpll0_1_2_gpll0
,
446 .ops
= &clk_rcg2_ops
,
450 static struct freq_tbl ftbl_camss_jpeg_jpeg0_2_clk
[] = {
451 F(75000000, P_GPLL0
, 8, 0, 0),
452 F(133330000, P_GPLL0
, 4.5, 0, 0),
453 F(200000000, P_GPLL0
, 3, 0, 0),
454 F(228570000, P_MMPLL0
, 3.5, 0, 0),
455 F(266670000, P_MMPLL0
, 3, 0, 0),
456 F(320000000, P_MMPLL0
, 2.5, 0, 0),
460 static struct clk_rcg2 jpeg0_clk_src
= {
463 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
464 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
465 .clkr
.hw
.init
= &(struct clk_init_data
){
466 .name
= "jpeg0_clk_src",
467 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
469 .ops
= &clk_rcg2_ops
,
473 static struct clk_rcg2 jpeg1_clk_src
= {
476 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
477 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
478 .clkr
.hw
.init
= &(struct clk_init_data
){
479 .name
= "jpeg1_clk_src",
480 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
482 .ops
= &clk_rcg2_ops
,
486 static struct clk_rcg2 jpeg2_clk_src
= {
489 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
490 .freq_tbl
= ftbl_camss_jpeg_jpeg0_2_clk
,
491 .clkr
.hw
.init
= &(struct clk_init_data
){
492 .name
= "jpeg2_clk_src",
493 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
495 .ops
= &clk_rcg2_ops
,
499 static struct freq_tbl ftbl_mdss_pclk0_clk
[] = {
500 F(125000000, P_DSI0PLL
, 2, 0, 0),
501 F(250000000, P_DSI0PLL
, 1, 0, 0),
505 static struct freq_tbl ftbl_mdss_pclk1_clk
[] = {
506 F(125000000, P_DSI1PLL
, 2, 0, 0),
507 F(250000000, P_DSI1PLL
, 1, 0, 0),
511 static struct clk_rcg2 pclk0_clk_src
= {
515 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
516 .freq_tbl
= ftbl_mdss_pclk0_clk
,
517 .clkr
.hw
.init
= &(struct clk_init_data
){
518 .name
= "pclk0_clk_src",
519 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
521 .ops
= &clk_rcg2_ops
,
525 static struct clk_rcg2 pclk1_clk_src
= {
529 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
530 .freq_tbl
= ftbl_mdss_pclk1_clk
,
531 .clkr
.hw
.init
= &(struct clk_init_data
){
532 .name
= "pclk1_clk_src",
533 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
535 .ops
= &clk_rcg2_ops
,
539 static struct freq_tbl ftbl_venus0_vcodec0_clk
[] = {
540 F(50000000, P_GPLL0
, 12, 0, 0),
541 F(100000000, P_GPLL0
, 6, 0, 0),
542 F(133330000, P_MMPLL0
, 6, 0, 0),
543 F(200000000, P_MMPLL0
, 4, 0, 0),
544 F(266670000, P_MMPLL0
, 3, 0, 0),
545 F(465000000, P_MMPLL3
, 2, 0, 0),
549 static struct clk_rcg2 vcodec0_clk_src
= {
553 .parent_map
= mmcc_xo_mmpll0_1_3_gpll0_map
,
554 .freq_tbl
= ftbl_venus0_vcodec0_clk
,
555 .clkr
.hw
.init
= &(struct clk_init_data
){
556 .name
= "vcodec0_clk_src",
557 .parent_names
= mmcc_xo_mmpll0_1_3_gpll0
,
559 .ops
= &clk_rcg2_ops
,
563 static struct freq_tbl ftbl_camss_cci_cci_clk
[] = {
564 F(19200000, P_XO
, 1, 0, 0),
568 static struct clk_rcg2 cci_clk_src
= {
571 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
572 .freq_tbl
= ftbl_camss_cci_cci_clk
,
573 .clkr
.hw
.init
= &(struct clk_init_data
){
574 .name
= "cci_clk_src",
575 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
577 .ops
= &clk_rcg2_ops
,
581 static struct freq_tbl ftbl_camss_gp0_1_clk
[] = {
582 F(10000, P_XO
, 16, 1, 120),
583 F(24000, P_XO
, 16, 1, 50),
584 F(6000000, P_GPLL0
, 10, 1, 10),
585 F(12000000, P_GPLL0
, 10, 1, 5),
586 F(13000000, P_GPLL0
, 4, 13, 150),
587 F(24000000, P_GPLL0
, 5, 1, 5),
591 static struct clk_rcg2 camss_gp0_clk_src
= {
595 .parent_map
= mmcc_xo_mmpll0_1_gpll1_0_map
,
596 .freq_tbl
= ftbl_camss_gp0_1_clk
,
597 .clkr
.hw
.init
= &(struct clk_init_data
){
598 .name
= "camss_gp0_clk_src",
599 .parent_names
= mmcc_xo_mmpll0_1_gpll1_0
,
601 .ops
= &clk_rcg2_ops
,
605 static struct clk_rcg2 camss_gp1_clk_src
= {
609 .parent_map
= mmcc_xo_mmpll0_1_gpll1_0_map
,
610 .freq_tbl
= ftbl_camss_gp0_1_clk
,
611 .clkr
.hw
.init
= &(struct clk_init_data
){
612 .name
= "camss_gp1_clk_src",
613 .parent_names
= mmcc_xo_mmpll0_1_gpll1_0
,
615 .ops
= &clk_rcg2_ops
,
619 static struct freq_tbl ftbl_camss_mclk0_3_clk
[] = {
620 F(4800000, P_XO
, 4, 0, 0),
621 F(6000000, P_GPLL0
, 10, 1, 10),
622 F(8000000, P_GPLL0
, 15, 1, 5),
623 F(9600000, P_XO
, 2, 0, 0),
624 F(16000000, P_GPLL0
, 12.5, 1, 3),
625 F(19200000, P_XO
, 1, 0, 0),
626 F(24000000, P_GPLL0
, 5, 1, 5),
627 F(32000000, P_MMPLL0
, 5, 1, 5),
628 F(48000000, P_GPLL0
, 12.5, 0, 0),
629 F(64000000, P_MMPLL0
, 12.5, 0, 0),
630 F(66670000, P_GPLL0
, 9, 0, 0),
634 static struct clk_rcg2 mclk0_clk_src
= {
637 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
638 .freq_tbl
= ftbl_camss_mclk0_3_clk
,
639 .clkr
.hw
.init
= &(struct clk_init_data
){
640 .name
= "mclk0_clk_src",
641 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
643 .ops
= &clk_rcg2_ops
,
647 static struct clk_rcg2 mclk1_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
= "mclk1_clk_src",
654 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
656 .ops
= &clk_rcg2_ops
,
660 static struct clk_rcg2 mclk2_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
= "mclk2_clk_src",
667 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
669 .ops
= &clk_rcg2_ops
,
673 static struct clk_rcg2 mclk3_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
= "mclk3_clk_src",
680 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
682 .ops
= &clk_rcg2_ops
,
686 static struct freq_tbl ftbl_camss_phy0_2_csi0_2phytimer_clk
[] = {
687 F(100000000, P_GPLL0
, 6, 0, 0),
688 F(200000000, P_MMPLL0
, 4, 0, 0),
692 static struct clk_rcg2 csi0phytimer_clk_src
= {
695 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
696 .freq_tbl
= ftbl_camss_phy0_2_csi0_2phytimer_clk
,
697 .clkr
.hw
.init
= &(struct clk_init_data
){
698 .name
= "csi0phytimer_clk_src",
699 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
701 .ops
= &clk_rcg2_ops
,
705 static struct clk_rcg2 csi1phytimer_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
= "csi1phytimer_clk_src",
712 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
714 .ops
= &clk_rcg2_ops
,
718 static struct clk_rcg2 csi2phytimer_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
= "csi2phytimer_clk_src",
725 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
727 .ops
= &clk_rcg2_ops
,
731 static struct freq_tbl ftbl_camss_vfe_cpp_clk
[] = {
732 F(133330000, P_GPLL0
, 4.5, 0, 0),
733 F(266670000, P_MMPLL0
, 3, 0, 0),
734 F(320000000, P_MMPLL0
, 2.5, 0, 0),
735 F(400000000, P_MMPLL0
, 2, 0, 0),
736 F(465000000, P_MMPLL3
, 2, 0, 0),
740 static struct clk_rcg2 cpp_clk_src
= {
743 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
744 .freq_tbl
= ftbl_camss_vfe_cpp_clk
,
745 .clkr
.hw
.init
= &(struct clk_init_data
){
746 .name
= "cpp_clk_src",
747 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
749 .ops
= &clk_rcg2_ops
,
753 static struct freq_tbl ftbl_mdss_byte0_clk
[] = {
754 F(93750000, P_DSI0PLL
, 8, 0, 0),
755 F(187500000, P_DSI0PLL
, 4, 0, 0),
759 static struct freq_tbl ftbl_mdss_byte1_clk
[] = {
760 F(93750000, P_DSI1PLL
, 8, 0, 0),
761 F(187500000, P_DSI1PLL
, 4, 0, 0),
765 static struct clk_rcg2 byte0_clk_src
= {
768 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
769 .freq_tbl
= ftbl_mdss_byte0_clk
,
770 .clkr
.hw
.init
= &(struct clk_init_data
){
771 .name
= "byte0_clk_src",
772 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
774 .ops
= &clk_rcg2_ops
,
778 static struct clk_rcg2 byte1_clk_src
= {
781 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
782 .freq_tbl
= ftbl_mdss_byte1_clk
,
783 .clkr
.hw
.init
= &(struct clk_init_data
){
784 .name
= "byte1_clk_src",
785 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
787 .ops
= &clk_rcg2_ops
,
791 static struct freq_tbl ftbl_mdss_edpaux_clk
[] = {
792 F(19200000, P_XO
, 1, 0, 0),
796 static struct clk_rcg2 edpaux_clk_src
= {
799 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
800 .freq_tbl
= ftbl_mdss_edpaux_clk
,
801 .clkr
.hw
.init
= &(struct clk_init_data
){
802 .name
= "edpaux_clk_src",
803 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
805 .ops
= &clk_rcg2_ops
,
809 static struct freq_tbl ftbl_mdss_edplink_clk
[] = {
810 F(135000000, P_EDPLINK
, 2, 0, 0),
811 F(270000000, P_EDPLINK
, 11, 0, 0),
815 static struct clk_rcg2 edplink_clk_src
= {
818 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
819 .freq_tbl
= ftbl_mdss_edplink_clk
,
820 .clkr
.hw
.init
= &(struct clk_init_data
){
821 .name
= "edplink_clk_src",
822 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
824 .ops
= &clk_rcg2_ops
,
828 static struct freq_tbl ftbl_mdss_edppixel_clk
[] = {
829 F(175000000, P_EDPVCO
, 2, 0, 0),
830 F(350000000, P_EDPVCO
, 11, 0, 0),
834 static struct clk_rcg2 edppixel_clk_src
= {
838 .parent_map
= mmcc_xo_dsi_hdmi_edp_map
,
839 .freq_tbl
= ftbl_mdss_edppixel_clk
,
840 .clkr
.hw
.init
= &(struct clk_init_data
){
841 .name
= "edppixel_clk_src",
842 .parent_names
= mmcc_xo_dsi_hdmi_edp
,
844 .ops
= &clk_rcg2_ops
,
848 static struct freq_tbl ftbl_mdss_esc0_1_clk
[] = {
849 F(19200000, P_XO
, 1, 0, 0),
853 static struct clk_rcg2 esc0_clk_src
= {
856 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
857 .freq_tbl
= ftbl_mdss_esc0_1_clk
,
858 .clkr
.hw
.init
= &(struct clk_init_data
){
859 .name
= "esc0_clk_src",
860 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
862 .ops
= &clk_rcg2_ops
,
866 static struct clk_rcg2 esc1_clk_src
= {
869 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
870 .freq_tbl
= ftbl_mdss_esc0_1_clk
,
871 .clkr
.hw
.init
= &(struct clk_init_data
){
872 .name
= "esc1_clk_src",
873 .parent_names
= mmcc_xo_dsi_hdmi_edp_gpll0
,
875 .ops
= &clk_rcg2_ops
,
879 static struct freq_tbl ftbl_mdss_extpclk_clk
[] = {
880 F(25200000, P_HDMIPLL
, 1, 0, 0),
881 F(27000000, P_HDMIPLL
, 1, 0, 0),
882 F(27030000, P_HDMIPLL
, 1, 0, 0),
883 F(65000000, P_HDMIPLL
, 1, 0, 0),
884 F(74250000, P_HDMIPLL
, 1, 0, 0),
885 F(108000000, P_HDMIPLL
, 1, 0, 0),
886 F(148500000, P_HDMIPLL
, 1, 0, 0),
887 F(268500000, P_HDMIPLL
, 1, 0, 0),
888 F(297000000, P_HDMIPLL
, 1, 0, 0),
892 static struct clk_rcg2 extpclk_clk_src
= {
895 .parent_map
= mmcc_xo_dsi_hdmi_edp_gpll0_map
,
896 .freq_tbl
= ftbl_mdss_extpclk_clk
,
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_rcg2_ops
,
905 static struct freq_tbl ftbl_mdss_hdmi_clk
[] = {
906 F(19200000, P_XO
, 1, 0, 0),
910 static struct clk_rcg2 hdmi_clk_src
= {
913 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
914 .freq_tbl
= ftbl_mdss_hdmi_clk
,
915 .clkr
.hw
.init
= &(struct clk_init_data
){
916 .name
= "hdmi_clk_src",
917 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
919 .ops
= &clk_rcg2_ops
,
923 static struct freq_tbl ftbl_mdss_vsync_clk
[] = {
924 F(19200000, P_XO
, 1, 0, 0),
928 static struct clk_rcg2 vsync_clk_src
= {
931 .parent_map
= mmcc_xo_mmpll0_mmpll1_gpll0_map
,
932 .freq_tbl
= ftbl_mdss_vsync_clk
,
933 .clkr
.hw
.init
= &(struct clk_init_data
){
934 .name
= "vsync_clk_src",
935 .parent_names
= mmcc_xo_mmpll0_mmpll1_gpll0
,
937 .ops
= &clk_rcg2_ops
,
941 static struct clk_branch camss_cci_cci_ahb_clk
= {
944 .enable_reg
= 0x3348,
945 .enable_mask
= BIT(0),
946 .hw
.init
= &(struct clk_init_data
){
947 .name
= "camss_cci_cci_ahb_clk",
948 .parent_names
= (const char *[]){
952 .ops
= &clk_branch2_ops
,
957 static struct clk_branch camss_cci_cci_clk
= {
960 .enable_reg
= 0x3344,
961 .enable_mask
= BIT(0),
962 .hw
.init
= &(struct clk_init_data
){
963 .name
= "camss_cci_cci_clk",
964 .parent_names
= (const char *[]){
968 .flags
= CLK_SET_RATE_PARENT
,
969 .ops
= &clk_branch2_ops
,
974 static struct clk_branch camss_csi0_ahb_clk
= {
977 .enable_reg
= 0x30bc,
978 .enable_mask
= BIT(0),
979 .hw
.init
= &(struct clk_init_data
){
980 .name
= "camss_csi0_ahb_clk",
981 .parent_names
= (const char *[]){
985 .ops
= &clk_branch2_ops
,
990 static struct clk_branch camss_csi0_clk
= {
993 .enable_reg
= 0x30b4,
994 .enable_mask
= BIT(0),
995 .hw
.init
= &(struct clk_init_data
){
996 .name
= "camss_csi0_clk",
997 .parent_names
= (const char *[]){
1001 .flags
= CLK_SET_RATE_PARENT
,
1002 .ops
= &clk_branch2_ops
,
1007 static struct clk_branch camss_csi0phy_clk
= {
1010 .enable_reg
= 0x30c4,
1011 .enable_mask
= BIT(0),
1012 .hw
.init
= &(struct clk_init_data
){
1013 .name
= "camss_csi0phy_clk",
1014 .parent_names
= (const char *[]){
1018 .flags
= CLK_SET_RATE_PARENT
,
1019 .ops
= &clk_branch2_ops
,
1024 static struct clk_branch camss_csi0pix_clk
= {
1027 .enable_reg
= 0x30e4,
1028 .enable_mask
= BIT(0),
1029 .hw
.init
= &(struct clk_init_data
){
1030 .name
= "camss_csi0pix_clk",
1031 .parent_names
= (const char *[]){
1035 .flags
= CLK_SET_RATE_PARENT
,
1036 .ops
= &clk_branch2_ops
,
1041 static struct clk_branch camss_csi0rdi_clk
= {
1044 .enable_reg
= 0x30d4,
1045 .enable_mask
= BIT(0),
1046 .hw
.init
= &(struct clk_init_data
){
1047 .name
= "camss_csi0rdi_clk",
1048 .parent_names
= (const char *[]){
1052 .flags
= CLK_SET_RATE_PARENT
,
1053 .ops
= &clk_branch2_ops
,
1058 static struct clk_branch camss_csi1_ahb_clk
= {
1061 .enable_reg
= 0x3128,
1062 .enable_mask
= BIT(0),
1063 .hw
.init
= &(struct clk_init_data
){
1064 .name
= "camss_csi1_ahb_clk",
1065 .parent_names
= (const char *[]){
1069 .ops
= &clk_branch2_ops
,
1074 static struct clk_branch camss_csi1_clk
= {
1077 .enable_reg
= 0x3124,
1078 .enable_mask
= BIT(0),
1079 .hw
.init
= &(struct clk_init_data
){
1080 .name
= "camss_csi1_clk",
1081 .parent_names
= (const char *[]){
1085 .flags
= CLK_SET_RATE_PARENT
,
1086 .ops
= &clk_branch2_ops
,
1091 static struct clk_branch camss_csi1phy_clk
= {
1094 .enable_reg
= 0x3134,
1095 .enable_mask
= BIT(0),
1096 .hw
.init
= &(struct clk_init_data
){
1097 .name
= "camss_csi1phy_clk",
1098 .parent_names
= (const char *[]){
1102 .flags
= CLK_SET_RATE_PARENT
,
1103 .ops
= &clk_branch2_ops
,
1108 static struct clk_branch camss_csi1pix_clk
= {
1111 .enable_reg
= 0x3154,
1112 .enable_mask
= BIT(0),
1113 .hw
.init
= &(struct clk_init_data
){
1114 .name
= "camss_csi1pix_clk",
1115 .parent_names
= (const char *[]){
1119 .flags
= CLK_SET_RATE_PARENT
,
1120 .ops
= &clk_branch2_ops
,
1125 static struct clk_branch camss_csi1rdi_clk
= {
1128 .enable_reg
= 0x3144,
1129 .enable_mask
= BIT(0),
1130 .hw
.init
= &(struct clk_init_data
){
1131 .name
= "camss_csi1rdi_clk",
1132 .parent_names
= (const char *[]){
1136 .flags
= CLK_SET_RATE_PARENT
,
1137 .ops
= &clk_branch2_ops
,
1142 static struct clk_branch camss_csi2_ahb_clk
= {
1145 .enable_reg
= 0x3188,
1146 .enable_mask
= BIT(0),
1147 .hw
.init
= &(struct clk_init_data
){
1148 .name
= "camss_csi2_ahb_clk",
1149 .parent_names
= (const char *[]){
1153 .ops
= &clk_branch2_ops
,
1158 static struct clk_branch camss_csi2_clk
= {
1161 .enable_reg
= 0x3184,
1162 .enable_mask
= BIT(0),
1163 .hw
.init
= &(struct clk_init_data
){
1164 .name
= "camss_csi2_clk",
1165 .parent_names
= (const char *[]){
1169 .flags
= CLK_SET_RATE_PARENT
,
1170 .ops
= &clk_branch2_ops
,
1175 static struct clk_branch camss_csi2phy_clk
= {
1178 .enable_reg
= 0x3194,
1179 .enable_mask
= BIT(0),
1180 .hw
.init
= &(struct clk_init_data
){
1181 .name
= "camss_csi2phy_clk",
1182 .parent_names
= (const char *[]){
1186 .flags
= CLK_SET_RATE_PARENT
,
1187 .ops
= &clk_branch2_ops
,
1192 static struct clk_branch camss_csi2pix_clk
= {
1195 .enable_reg
= 0x31b4,
1196 .enable_mask
= BIT(0),
1197 .hw
.init
= &(struct clk_init_data
){
1198 .name
= "camss_csi2pix_clk",
1199 .parent_names
= (const char *[]){
1203 .flags
= CLK_SET_RATE_PARENT
,
1204 .ops
= &clk_branch2_ops
,
1209 static struct clk_branch camss_csi2rdi_clk
= {
1212 .enable_reg
= 0x31a4,
1213 .enable_mask
= BIT(0),
1214 .hw
.init
= &(struct clk_init_data
){
1215 .name
= "camss_csi2rdi_clk",
1216 .parent_names
= (const char *[]){
1220 .flags
= CLK_SET_RATE_PARENT
,
1221 .ops
= &clk_branch2_ops
,
1226 static struct clk_branch camss_csi3_ahb_clk
= {
1229 .enable_reg
= 0x31e8,
1230 .enable_mask
= BIT(0),
1231 .hw
.init
= &(struct clk_init_data
){
1232 .name
= "camss_csi3_ahb_clk",
1233 .parent_names
= (const char *[]){
1237 .ops
= &clk_branch2_ops
,
1242 static struct clk_branch camss_csi3_clk
= {
1245 .enable_reg
= 0x31e4,
1246 .enable_mask
= BIT(0),
1247 .hw
.init
= &(struct clk_init_data
){
1248 .name
= "camss_csi3_clk",
1249 .parent_names
= (const char *[]){
1253 .flags
= CLK_SET_RATE_PARENT
,
1254 .ops
= &clk_branch2_ops
,
1259 static struct clk_branch camss_csi3phy_clk
= {
1262 .enable_reg
= 0x31f4,
1263 .enable_mask
= BIT(0),
1264 .hw
.init
= &(struct clk_init_data
){
1265 .name
= "camss_csi3phy_clk",
1266 .parent_names
= (const char *[]){
1270 .flags
= CLK_SET_RATE_PARENT
,
1271 .ops
= &clk_branch2_ops
,
1276 static struct clk_branch camss_csi3pix_clk
= {
1279 .enable_reg
= 0x3214,
1280 .enable_mask
= BIT(0),
1281 .hw
.init
= &(struct clk_init_data
){
1282 .name
= "camss_csi3pix_clk",
1283 .parent_names
= (const char *[]){
1287 .flags
= CLK_SET_RATE_PARENT
,
1288 .ops
= &clk_branch2_ops
,
1293 static struct clk_branch camss_csi3rdi_clk
= {
1296 .enable_reg
= 0x3204,
1297 .enable_mask
= BIT(0),
1298 .hw
.init
= &(struct clk_init_data
){
1299 .name
= "camss_csi3rdi_clk",
1300 .parent_names
= (const char *[]){
1304 .flags
= CLK_SET_RATE_PARENT
,
1305 .ops
= &clk_branch2_ops
,
1310 static struct clk_branch camss_csi_vfe0_clk
= {
1313 .enable_reg
= 0x3704,
1314 .enable_mask
= BIT(0),
1315 .hw
.init
= &(struct clk_init_data
){
1316 .name
= "camss_csi_vfe0_clk",
1317 .parent_names
= (const char *[]){
1321 .flags
= CLK_SET_RATE_PARENT
,
1322 .ops
= &clk_branch2_ops
,
1327 static struct clk_branch camss_csi_vfe1_clk
= {
1330 .enable_reg
= 0x3714,
1331 .enable_mask
= BIT(0),
1332 .hw
.init
= &(struct clk_init_data
){
1333 .name
= "camss_csi_vfe1_clk",
1334 .parent_names
= (const char *[]){
1338 .flags
= CLK_SET_RATE_PARENT
,
1339 .ops
= &clk_branch2_ops
,
1344 static struct clk_branch camss_gp0_clk
= {
1347 .enable_reg
= 0x3444,
1348 .enable_mask
= BIT(0),
1349 .hw
.init
= &(struct clk_init_data
){
1350 .name
= "camss_gp0_clk",
1351 .parent_names
= (const char *[]){
1352 "camss_gp0_clk_src",
1355 .flags
= CLK_SET_RATE_PARENT
,
1356 .ops
= &clk_branch2_ops
,
1361 static struct clk_branch camss_gp1_clk
= {
1364 .enable_reg
= 0x3474,
1365 .enable_mask
= BIT(0),
1366 .hw
.init
= &(struct clk_init_data
){
1367 .name
= "camss_gp1_clk",
1368 .parent_names
= (const char *[]){
1369 "camss_gp1_clk_src",
1372 .flags
= CLK_SET_RATE_PARENT
,
1373 .ops
= &clk_branch2_ops
,
1378 static struct clk_branch camss_ispif_ahb_clk
= {
1381 .enable_reg
= 0x3224,
1382 .enable_mask
= BIT(0),
1383 .hw
.init
= &(struct clk_init_data
){
1384 .name
= "camss_ispif_ahb_clk",
1385 .parent_names
= (const char *[]){
1389 .ops
= &clk_branch2_ops
,
1394 static struct clk_branch camss_jpeg_jpeg0_clk
= {
1397 .enable_reg
= 0x35a8,
1398 .enable_mask
= BIT(0),
1399 .hw
.init
= &(struct clk_init_data
){
1400 .name
= "camss_jpeg_jpeg0_clk",
1401 .parent_names
= (const char *[]){
1405 .flags
= CLK_SET_RATE_PARENT
,
1406 .ops
= &clk_branch2_ops
,
1411 static struct clk_branch camss_jpeg_jpeg1_clk
= {
1414 .enable_reg
= 0x35ac,
1415 .enable_mask
= BIT(0),
1416 .hw
.init
= &(struct clk_init_data
){
1417 .name
= "camss_jpeg_jpeg1_clk",
1418 .parent_names
= (const char *[]){
1422 .flags
= CLK_SET_RATE_PARENT
,
1423 .ops
= &clk_branch2_ops
,
1428 static struct clk_branch camss_jpeg_jpeg2_clk
= {
1431 .enable_reg
= 0x35b0,
1432 .enable_mask
= BIT(0),
1433 .hw
.init
= &(struct clk_init_data
){
1434 .name
= "camss_jpeg_jpeg2_clk",
1435 .parent_names
= (const char *[]){
1439 .flags
= CLK_SET_RATE_PARENT
,
1440 .ops
= &clk_branch2_ops
,
1445 static struct clk_branch camss_jpeg_jpeg_ahb_clk
= {
1448 .enable_reg
= 0x35b4,
1449 .enable_mask
= BIT(0),
1450 .hw
.init
= &(struct clk_init_data
){
1451 .name
= "camss_jpeg_jpeg_ahb_clk",
1452 .parent_names
= (const char *[]){
1456 .ops
= &clk_branch2_ops
,
1461 static struct clk_branch camss_jpeg_jpeg_axi_clk
= {
1464 .enable_reg
= 0x35b8,
1465 .enable_mask
= BIT(0),
1466 .hw
.init
= &(struct clk_init_data
){
1467 .name
= "camss_jpeg_jpeg_axi_clk",
1468 .parent_names
= (const char *[]){
1472 .ops
= &clk_branch2_ops
,
1477 static struct clk_branch camss_jpeg_jpeg_ocmemnoc_clk
= {
1480 .enable_reg
= 0x35bc,
1481 .enable_mask
= BIT(0),
1482 .hw
.init
= &(struct clk_init_data
){
1483 .name
= "camss_jpeg_jpeg_ocmemnoc_clk",
1484 .parent_names
= (const char *[]){
1488 .flags
= CLK_SET_RATE_PARENT
,
1489 .ops
= &clk_branch2_ops
,
1494 static struct clk_branch camss_mclk0_clk
= {
1497 .enable_reg
= 0x3384,
1498 .enable_mask
= BIT(0),
1499 .hw
.init
= &(struct clk_init_data
){
1500 .name
= "camss_mclk0_clk",
1501 .parent_names
= (const char *[]){
1505 .flags
= CLK_SET_RATE_PARENT
,
1506 .ops
= &clk_branch2_ops
,
1511 static struct clk_branch camss_mclk1_clk
= {
1514 .enable_reg
= 0x33b4,
1515 .enable_mask
= BIT(0),
1516 .hw
.init
= &(struct clk_init_data
){
1517 .name
= "camss_mclk1_clk",
1518 .parent_names
= (const char *[]){
1522 .flags
= CLK_SET_RATE_PARENT
,
1523 .ops
= &clk_branch2_ops
,
1528 static struct clk_branch camss_mclk2_clk
= {
1531 .enable_reg
= 0x33e4,
1532 .enable_mask
= BIT(0),
1533 .hw
.init
= &(struct clk_init_data
){
1534 .name
= "camss_mclk2_clk",
1535 .parent_names
= (const char *[]){
1539 .flags
= CLK_SET_RATE_PARENT
,
1540 .ops
= &clk_branch2_ops
,
1545 static struct clk_branch camss_mclk3_clk
= {
1548 .enable_reg
= 0x3414,
1549 .enable_mask
= BIT(0),
1550 .hw
.init
= &(struct clk_init_data
){
1551 .name
= "camss_mclk3_clk",
1552 .parent_names
= (const char *[]){
1556 .flags
= CLK_SET_RATE_PARENT
,
1557 .ops
= &clk_branch2_ops
,
1562 static struct clk_branch camss_micro_ahb_clk
= {
1565 .enable_reg
= 0x3494,
1566 .enable_mask
= BIT(0),
1567 .hw
.init
= &(struct clk_init_data
){
1568 .name
= "camss_micro_ahb_clk",
1569 .parent_names
= (const char *[]){
1573 .ops
= &clk_branch2_ops
,
1578 static struct clk_branch camss_phy0_csi0phytimer_clk
= {
1581 .enable_reg
= 0x3024,
1582 .enable_mask
= BIT(0),
1583 .hw
.init
= &(struct clk_init_data
){
1584 .name
= "camss_phy0_csi0phytimer_clk",
1585 .parent_names
= (const char *[]){
1586 "csi0phytimer_clk_src",
1589 .flags
= CLK_SET_RATE_PARENT
,
1590 .ops
= &clk_branch2_ops
,
1595 static struct clk_branch camss_phy1_csi1phytimer_clk
= {
1598 .enable_reg
= 0x3054,
1599 .enable_mask
= BIT(0),
1600 .hw
.init
= &(struct clk_init_data
){
1601 .name
= "camss_phy1_csi1phytimer_clk",
1602 .parent_names
= (const char *[]){
1603 "csi1phytimer_clk_src",
1606 .flags
= CLK_SET_RATE_PARENT
,
1607 .ops
= &clk_branch2_ops
,
1612 static struct clk_branch camss_phy2_csi2phytimer_clk
= {
1615 .enable_reg
= 0x3084,
1616 .enable_mask
= BIT(0),
1617 .hw
.init
= &(struct clk_init_data
){
1618 .name
= "camss_phy2_csi2phytimer_clk",
1619 .parent_names
= (const char *[]){
1620 "csi2phytimer_clk_src",
1623 .flags
= CLK_SET_RATE_PARENT
,
1624 .ops
= &clk_branch2_ops
,
1629 static struct clk_branch camss_top_ahb_clk
= {
1632 .enable_reg
= 0x3484,
1633 .enable_mask
= BIT(0),
1634 .hw
.init
= &(struct clk_init_data
){
1635 .name
= "camss_top_ahb_clk",
1636 .parent_names
= (const char *[]){
1640 .ops
= &clk_branch2_ops
,
1645 static struct clk_branch camss_vfe_cpp_ahb_clk
= {
1648 .enable_reg
= 0x36b4,
1649 .enable_mask
= BIT(0),
1650 .hw
.init
= &(struct clk_init_data
){
1651 .name
= "camss_vfe_cpp_ahb_clk",
1652 .parent_names
= (const char *[]){
1656 .ops
= &clk_branch2_ops
,
1661 static struct clk_branch camss_vfe_cpp_clk
= {
1664 .enable_reg
= 0x36b0,
1665 .enable_mask
= BIT(0),
1666 .hw
.init
= &(struct clk_init_data
){
1667 .name
= "camss_vfe_cpp_clk",
1668 .parent_names
= (const char *[]){
1672 .flags
= CLK_SET_RATE_PARENT
,
1673 .ops
= &clk_branch2_ops
,
1678 static struct clk_branch camss_vfe_vfe0_clk
= {
1681 .enable_reg
= 0x36a8,
1682 .enable_mask
= BIT(0),
1683 .hw
.init
= &(struct clk_init_data
){
1684 .name
= "camss_vfe_vfe0_clk",
1685 .parent_names
= (const char *[]){
1689 .flags
= CLK_SET_RATE_PARENT
,
1690 .ops
= &clk_branch2_ops
,
1695 static struct clk_branch camss_vfe_vfe1_clk
= {
1698 .enable_reg
= 0x36ac,
1699 .enable_mask
= BIT(0),
1700 .hw
.init
= &(struct clk_init_data
){
1701 .name
= "camss_vfe_vfe1_clk",
1702 .parent_names
= (const char *[]){
1706 .flags
= CLK_SET_RATE_PARENT
,
1707 .ops
= &clk_branch2_ops
,
1712 static struct clk_branch camss_vfe_vfe_ahb_clk
= {
1715 .enable_reg
= 0x36b8,
1716 .enable_mask
= BIT(0),
1717 .hw
.init
= &(struct clk_init_data
){
1718 .name
= "camss_vfe_vfe_ahb_clk",
1719 .parent_names
= (const char *[]){
1723 .ops
= &clk_branch2_ops
,
1728 static struct clk_branch camss_vfe_vfe_axi_clk
= {
1731 .enable_reg
= 0x36bc,
1732 .enable_mask
= BIT(0),
1733 .hw
.init
= &(struct clk_init_data
){
1734 .name
= "camss_vfe_vfe_axi_clk",
1735 .parent_names
= (const char *[]){
1739 .ops
= &clk_branch2_ops
,
1744 static struct clk_branch camss_vfe_vfe_ocmemnoc_clk
= {
1747 .enable_reg
= 0x36c0,
1748 .enable_mask
= BIT(0),
1749 .hw
.init
= &(struct clk_init_data
){
1750 .name
= "camss_vfe_vfe_ocmemnoc_clk",
1751 .parent_names
= (const char *[]){
1755 .flags
= CLK_SET_RATE_PARENT
,
1756 .ops
= &clk_branch2_ops
,
1761 static struct clk_branch mdss_ahb_clk
= {
1764 .enable_reg
= 0x2308,
1765 .enable_mask
= BIT(0),
1766 .hw
.init
= &(struct clk_init_data
){
1767 .name
= "mdss_ahb_clk",
1768 .parent_names
= (const char *[]){
1772 .ops
= &clk_branch2_ops
,
1777 static struct clk_branch mdss_axi_clk
= {
1780 .enable_reg
= 0x2310,
1781 .enable_mask
= BIT(0),
1782 .hw
.init
= &(struct clk_init_data
){
1783 .name
= "mdss_axi_clk",
1784 .parent_names
= (const char *[]){
1788 .flags
= CLK_SET_RATE_PARENT
,
1789 .ops
= &clk_branch2_ops
,
1794 static struct clk_branch mdss_byte0_clk
= {
1797 .enable_reg
= 0x233c,
1798 .enable_mask
= BIT(0),
1799 .hw
.init
= &(struct clk_init_data
){
1800 .name
= "mdss_byte0_clk",
1801 .parent_names
= (const char *[]){
1805 .flags
= CLK_SET_RATE_PARENT
,
1806 .ops
= &clk_branch2_ops
,
1811 static struct clk_branch mdss_byte1_clk
= {
1814 .enable_reg
= 0x2340,
1815 .enable_mask
= BIT(0),
1816 .hw
.init
= &(struct clk_init_data
){
1817 .name
= "mdss_byte1_clk",
1818 .parent_names
= (const char *[]){
1822 .flags
= CLK_SET_RATE_PARENT
,
1823 .ops
= &clk_branch2_ops
,
1828 static struct clk_branch mdss_edpaux_clk
= {
1831 .enable_reg
= 0x2334,
1832 .enable_mask
= BIT(0),
1833 .hw
.init
= &(struct clk_init_data
){
1834 .name
= "mdss_edpaux_clk",
1835 .parent_names
= (const char *[]){
1839 .flags
= CLK_SET_RATE_PARENT
,
1840 .ops
= &clk_branch2_ops
,
1845 static struct clk_branch mdss_edplink_clk
= {
1848 .enable_reg
= 0x2330,
1849 .enable_mask
= BIT(0),
1850 .hw
.init
= &(struct clk_init_data
){
1851 .name
= "mdss_edplink_clk",
1852 .parent_names
= (const char *[]){
1856 .flags
= CLK_SET_RATE_PARENT
,
1857 .ops
= &clk_branch2_ops
,
1862 static struct clk_branch mdss_edppixel_clk
= {
1865 .enable_reg
= 0x232c,
1866 .enable_mask
= BIT(0),
1867 .hw
.init
= &(struct clk_init_data
){
1868 .name
= "mdss_edppixel_clk",
1869 .parent_names
= (const char *[]){
1873 .flags
= CLK_SET_RATE_PARENT
,
1874 .ops
= &clk_branch2_ops
,
1879 static struct clk_branch mdss_esc0_clk
= {
1882 .enable_reg
= 0x2344,
1883 .enable_mask
= BIT(0),
1884 .hw
.init
= &(struct clk_init_data
){
1885 .name
= "mdss_esc0_clk",
1886 .parent_names
= (const char *[]){
1890 .flags
= CLK_SET_RATE_PARENT
,
1891 .ops
= &clk_branch2_ops
,
1896 static struct clk_branch mdss_esc1_clk
= {
1899 .enable_reg
= 0x2348,
1900 .enable_mask
= BIT(0),
1901 .hw
.init
= &(struct clk_init_data
){
1902 .name
= "mdss_esc1_clk",
1903 .parent_names
= (const char *[]){
1907 .flags
= CLK_SET_RATE_PARENT
,
1908 .ops
= &clk_branch2_ops
,
1913 static struct clk_branch mdss_extpclk_clk
= {
1916 .enable_reg
= 0x2324,
1917 .enable_mask
= BIT(0),
1918 .hw
.init
= &(struct clk_init_data
){
1919 .name
= "mdss_extpclk_clk",
1920 .parent_names
= (const char *[]){
1924 .flags
= CLK_SET_RATE_PARENT
,
1925 .ops
= &clk_branch2_ops
,
1930 static struct clk_branch mdss_hdmi_ahb_clk
= {
1933 .enable_reg
= 0x230c,
1934 .enable_mask
= BIT(0),
1935 .hw
.init
= &(struct clk_init_data
){
1936 .name
= "mdss_hdmi_ahb_clk",
1937 .parent_names
= (const char *[]){
1941 .ops
= &clk_branch2_ops
,
1946 static struct clk_branch mdss_hdmi_clk
= {
1949 .enable_reg
= 0x2338,
1950 .enable_mask
= BIT(0),
1951 .hw
.init
= &(struct clk_init_data
){
1952 .name
= "mdss_hdmi_clk",
1953 .parent_names
= (const char *[]){
1957 .flags
= CLK_SET_RATE_PARENT
,
1958 .ops
= &clk_branch2_ops
,
1963 static struct clk_branch mdss_mdp_clk
= {
1966 .enable_reg
= 0x231c,
1967 .enable_mask
= BIT(0),
1968 .hw
.init
= &(struct clk_init_data
){
1969 .name
= "mdss_mdp_clk",
1970 .parent_names
= (const char *[]){
1974 .flags
= CLK_SET_RATE_PARENT
,
1975 .ops
= &clk_branch2_ops
,
1980 static struct clk_branch mdss_mdp_lut_clk
= {
1983 .enable_reg
= 0x2320,
1984 .enable_mask
= BIT(0),
1985 .hw
.init
= &(struct clk_init_data
){
1986 .name
= "mdss_mdp_lut_clk",
1987 .parent_names
= (const char *[]){
1991 .flags
= CLK_SET_RATE_PARENT
,
1992 .ops
= &clk_branch2_ops
,
1997 static struct clk_branch mdss_pclk0_clk
= {
2000 .enable_reg
= 0x2314,
2001 .enable_mask
= BIT(0),
2002 .hw
.init
= &(struct clk_init_data
){
2003 .name
= "mdss_pclk0_clk",
2004 .parent_names
= (const char *[]){
2008 .flags
= CLK_SET_RATE_PARENT
,
2009 .ops
= &clk_branch2_ops
,
2014 static struct clk_branch mdss_pclk1_clk
= {
2017 .enable_reg
= 0x2318,
2018 .enable_mask
= BIT(0),
2019 .hw
.init
= &(struct clk_init_data
){
2020 .name
= "mdss_pclk1_clk",
2021 .parent_names
= (const char *[]){
2025 .flags
= CLK_SET_RATE_PARENT
,
2026 .ops
= &clk_branch2_ops
,
2031 static struct clk_branch mdss_vsync_clk
= {
2034 .enable_reg
= 0x2328,
2035 .enable_mask
= BIT(0),
2036 .hw
.init
= &(struct clk_init_data
){
2037 .name
= "mdss_vsync_clk",
2038 .parent_names
= (const char *[]){
2042 .flags
= CLK_SET_RATE_PARENT
,
2043 .ops
= &clk_branch2_ops
,
2048 static struct clk_branch mmss_misc_ahb_clk
= {
2051 .enable_reg
= 0x502c,
2052 .enable_mask
= BIT(0),
2053 .hw
.init
= &(struct clk_init_data
){
2054 .name
= "mmss_misc_ahb_clk",
2055 .parent_names
= (const char *[]){
2059 .ops
= &clk_branch2_ops
,
2064 static struct clk_branch mmss_mmssnoc_ahb_clk
= {
2067 .enable_reg
= 0x5024,
2068 .enable_mask
= BIT(0),
2069 .hw
.init
= &(struct clk_init_data
){
2070 .name
= "mmss_mmssnoc_ahb_clk",
2071 .parent_names
= (const char *[]){
2075 .ops
= &clk_branch2_ops
,
2076 .flags
= CLK_IGNORE_UNUSED
,
2081 static struct clk_branch mmss_mmssnoc_bto_ahb_clk
= {
2084 .enable_reg
= 0x5028,
2085 .enable_mask
= BIT(0),
2086 .hw
.init
= &(struct clk_init_data
){
2087 .name
= "mmss_mmssnoc_bto_ahb_clk",
2088 .parent_names
= (const char *[]){
2092 .ops
= &clk_branch2_ops
,
2093 .flags
= CLK_IGNORE_UNUSED
,
2098 static struct clk_branch mmss_mmssnoc_axi_clk
= {
2101 .enable_reg
= 0x506c,
2102 .enable_mask
= BIT(0),
2103 .hw
.init
= &(struct clk_init_data
){
2104 .name
= "mmss_mmssnoc_axi_clk",
2105 .parent_names
= (const char *[]){
2109 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2110 .ops
= &clk_branch2_ops
,
2115 static struct clk_branch mmss_s0_axi_clk
= {
2118 .enable_reg
= 0x5064,
2119 .enable_mask
= BIT(0),
2120 .hw
.init
= &(struct clk_init_data
){
2121 .name
= "mmss_s0_axi_clk",
2122 .parent_names
= (const char *[]){
2126 .ops
= &clk_branch2_ops
,
2127 .flags
= CLK_IGNORE_UNUSED
,
2132 static struct clk_branch ocmemcx_ahb_clk
= {
2135 .enable_reg
= 0x405c,
2136 .enable_mask
= BIT(0),
2137 .hw
.init
= &(struct clk_init_data
){
2138 .name
= "ocmemcx_ahb_clk",
2139 .parent_names
= (const char *[]){
2143 .ops
= &clk_branch2_ops
,
2148 static struct clk_branch ocmemcx_ocmemnoc_clk
= {
2151 .enable_reg
= 0x4058,
2152 .enable_mask
= BIT(0),
2153 .hw
.init
= &(struct clk_init_data
){
2154 .name
= "ocmemcx_ocmemnoc_clk",
2155 .parent_names
= (const char *[]){
2159 .flags
= CLK_SET_RATE_PARENT
,
2160 .ops
= &clk_branch2_ops
,
2165 static struct clk_branch oxili_ocmemgx_clk
= {
2168 .enable_reg
= 0x402c,
2169 .enable_mask
= BIT(0),
2170 .hw
.init
= &(struct clk_init_data
){
2171 .name
= "oxili_ocmemgx_clk",
2172 .parent_names
= (const char *[]){
2176 .flags
= CLK_SET_RATE_PARENT
,
2177 .ops
= &clk_branch2_ops
,
2182 static struct clk_branch ocmemnoc_clk
= {
2185 .enable_reg
= 0x50b4,
2186 .enable_mask
= BIT(0),
2187 .hw
.init
= &(struct clk_init_data
){
2188 .name
= "ocmemnoc_clk",
2189 .parent_names
= (const char *[]){
2193 .flags
= CLK_SET_RATE_PARENT
,
2194 .ops
= &clk_branch2_ops
,
2199 static struct clk_branch oxili_gfx3d_clk
= {
2202 .enable_reg
= 0x4028,
2203 .enable_mask
= BIT(0),
2204 .hw
.init
= &(struct clk_init_data
){
2205 .name
= "oxili_gfx3d_clk",
2206 .parent_names
= (const char *[]){
2210 .flags
= CLK_SET_RATE_PARENT
,
2211 .ops
= &clk_branch2_ops
,
2216 static struct clk_branch oxilicx_ahb_clk
= {
2219 .enable_reg
= 0x403c,
2220 .enable_mask
= BIT(0),
2221 .hw
.init
= &(struct clk_init_data
){
2222 .name
= "oxilicx_ahb_clk",
2223 .parent_names
= (const char *[]){
2227 .ops
= &clk_branch2_ops
,
2232 static struct clk_branch oxilicx_axi_clk
= {
2235 .enable_reg
= 0x4038,
2236 .enable_mask
= BIT(0),
2237 .hw
.init
= &(struct clk_init_data
){
2238 .name
= "oxilicx_axi_clk",
2239 .parent_names
= (const char *[]){
2243 .ops
= &clk_branch2_ops
,
2248 static struct clk_branch venus0_ahb_clk
= {
2251 .enable_reg
= 0x1030,
2252 .enable_mask
= BIT(0),
2253 .hw
.init
= &(struct clk_init_data
){
2254 .name
= "venus0_ahb_clk",
2255 .parent_names
= (const char *[]){
2259 .ops
= &clk_branch2_ops
,
2264 static struct clk_branch venus0_axi_clk
= {
2267 .enable_reg
= 0x1034,
2268 .enable_mask
= BIT(0),
2269 .hw
.init
= &(struct clk_init_data
){
2270 .name
= "venus0_axi_clk",
2271 .parent_names
= (const char *[]){
2275 .ops
= &clk_branch2_ops
,
2280 static struct clk_branch venus0_ocmemnoc_clk
= {
2283 .enable_reg
= 0x1038,
2284 .enable_mask
= BIT(0),
2285 .hw
.init
= &(struct clk_init_data
){
2286 .name
= "venus0_ocmemnoc_clk",
2287 .parent_names
= (const char *[]){
2291 .flags
= CLK_SET_RATE_PARENT
,
2292 .ops
= &clk_branch2_ops
,
2297 static struct clk_branch venus0_vcodec0_clk
= {
2300 .enable_reg
= 0x1028,
2301 .enable_mask
= BIT(0),
2302 .hw
.init
= &(struct clk_init_data
){
2303 .name
= "venus0_vcodec0_clk",
2304 .parent_names
= (const char *[]){
2308 .flags
= CLK_SET_RATE_PARENT
,
2309 .ops
= &clk_branch2_ops
,
2314 static const struct pll_config mmpll1_config
= {
2319 .vco_mask
= 0x3 << 20,
2321 .pre_div_mask
= 0x3 << 12,
2322 .post_div_val
= 0x0,
2323 .post_div_mask
= 0x3 << 8,
2324 .mn_ena_mask
= BIT(24),
2325 .main_output_mask
= BIT(0),
2328 static struct pll_config mmpll3_config
= {
2333 .vco_mask
= 0x3 << 20,
2335 .pre_div_mask
= 0x3 << 12,
2336 .post_div_val
= 0x0,
2337 .post_div_mask
= 0x3 << 8,
2338 .mn_ena_mask
= BIT(24),
2339 .main_output_mask
= BIT(0),
2340 .aux_output_mask
= BIT(1),
2343 static struct clk_regmap
*mmcc_msm8974_clocks
[] = {
2344 [MMSS_AHB_CLK_SRC
] = &mmss_ahb_clk_src
.clkr
,
2345 [MMSS_AXI_CLK_SRC
] = &mmss_axi_clk_src
.clkr
,
2346 [OCMEMNOC_CLK_SRC
] = &ocmemnoc_clk_src
.clkr
,
2347 [MMPLL0
] = &mmpll0
.clkr
,
2348 [MMPLL0_VOTE
] = &mmpll0_vote
,
2349 [MMPLL1
] = &mmpll1
.clkr
,
2350 [MMPLL1_VOTE
] = &mmpll1_vote
,
2351 [MMPLL2
] = &mmpll2
.clkr
,
2352 [MMPLL3
] = &mmpll3
.clkr
,
2353 [CSI0_CLK_SRC
] = &csi0_clk_src
.clkr
,
2354 [CSI1_CLK_SRC
] = &csi1_clk_src
.clkr
,
2355 [CSI2_CLK_SRC
] = &csi2_clk_src
.clkr
,
2356 [CSI3_CLK_SRC
] = &csi3_clk_src
.clkr
,
2357 [VFE0_CLK_SRC
] = &vfe0_clk_src
.clkr
,
2358 [VFE1_CLK_SRC
] = &vfe1_clk_src
.clkr
,
2359 [MDP_CLK_SRC
] = &mdp_clk_src
.clkr
,
2360 [GFX3D_CLK_SRC
] = &gfx3d_clk_src
.clkr
,
2361 [JPEG0_CLK_SRC
] = &jpeg0_clk_src
.clkr
,
2362 [JPEG1_CLK_SRC
] = &jpeg1_clk_src
.clkr
,
2363 [JPEG2_CLK_SRC
] = &jpeg2_clk_src
.clkr
,
2364 [PCLK0_CLK_SRC
] = &pclk0_clk_src
.clkr
,
2365 [PCLK1_CLK_SRC
] = &pclk1_clk_src
.clkr
,
2366 [VCODEC0_CLK_SRC
] = &vcodec0_clk_src
.clkr
,
2367 [CCI_CLK_SRC
] = &cci_clk_src
.clkr
,
2368 [CAMSS_GP0_CLK_SRC
] = &camss_gp0_clk_src
.clkr
,
2369 [CAMSS_GP1_CLK_SRC
] = &camss_gp1_clk_src
.clkr
,
2370 [MCLK0_CLK_SRC
] = &mclk0_clk_src
.clkr
,
2371 [MCLK1_CLK_SRC
] = &mclk1_clk_src
.clkr
,
2372 [MCLK2_CLK_SRC
] = &mclk2_clk_src
.clkr
,
2373 [MCLK3_CLK_SRC
] = &mclk3_clk_src
.clkr
,
2374 [CSI0PHYTIMER_CLK_SRC
] = &csi0phytimer_clk_src
.clkr
,
2375 [CSI1PHYTIMER_CLK_SRC
] = &csi1phytimer_clk_src
.clkr
,
2376 [CSI2PHYTIMER_CLK_SRC
] = &csi2phytimer_clk_src
.clkr
,
2377 [CPP_CLK_SRC
] = &cpp_clk_src
.clkr
,
2378 [BYTE0_CLK_SRC
] = &byte0_clk_src
.clkr
,
2379 [BYTE1_CLK_SRC
] = &byte1_clk_src
.clkr
,
2380 [EDPAUX_CLK_SRC
] = &edpaux_clk_src
.clkr
,
2381 [EDPLINK_CLK_SRC
] = &edplink_clk_src
.clkr
,
2382 [EDPPIXEL_CLK_SRC
] = &edppixel_clk_src
.clkr
,
2383 [ESC0_CLK_SRC
] = &esc0_clk_src
.clkr
,
2384 [ESC1_CLK_SRC
] = &esc1_clk_src
.clkr
,
2385 [EXTPCLK_CLK_SRC
] = &extpclk_clk_src
.clkr
,
2386 [HDMI_CLK_SRC
] = &hdmi_clk_src
.clkr
,
2387 [VSYNC_CLK_SRC
] = &vsync_clk_src
.clkr
,
2388 [CAMSS_CCI_CCI_AHB_CLK
] = &camss_cci_cci_ahb_clk
.clkr
,
2389 [CAMSS_CCI_CCI_CLK
] = &camss_cci_cci_clk
.clkr
,
2390 [CAMSS_CSI0_AHB_CLK
] = &camss_csi0_ahb_clk
.clkr
,
2391 [CAMSS_CSI0_CLK
] = &camss_csi0_clk
.clkr
,
2392 [CAMSS_CSI0PHY_CLK
] = &camss_csi0phy_clk
.clkr
,
2393 [CAMSS_CSI0PIX_CLK
] = &camss_csi0pix_clk
.clkr
,
2394 [CAMSS_CSI0RDI_CLK
] = &camss_csi0rdi_clk
.clkr
,
2395 [CAMSS_CSI1_AHB_CLK
] = &camss_csi1_ahb_clk
.clkr
,
2396 [CAMSS_CSI1_CLK
] = &camss_csi1_clk
.clkr
,
2397 [CAMSS_CSI1PHY_CLK
] = &camss_csi1phy_clk
.clkr
,
2398 [CAMSS_CSI1PIX_CLK
] = &camss_csi1pix_clk
.clkr
,
2399 [CAMSS_CSI1RDI_CLK
] = &camss_csi1rdi_clk
.clkr
,
2400 [CAMSS_CSI2_AHB_CLK
] = &camss_csi2_ahb_clk
.clkr
,
2401 [CAMSS_CSI2_CLK
] = &camss_csi2_clk
.clkr
,
2402 [CAMSS_CSI2PHY_CLK
] = &camss_csi2phy_clk
.clkr
,
2403 [CAMSS_CSI2PIX_CLK
] = &camss_csi2pix_clk
.clkr
,
2404 [CAMSS_CSI2RDI_CLK
] = &camss_csi2rdi_clk
.clkr
,
2405 [CAMSS_CSI3_AHB_CLK
] = &camss_csi3_ahb_clk
.clkr
,
2406 [CAMSS_CSI3_CLK
] = &camss_csi3_clk
.clkr
,
2407 [CAMSS_CSI3PHY_CLK
] = &camss_csi3phy_clk
.clkr
,
2408 [CAMSS_CSI3PIX_CLK
] = &camss_csi3pix_clk
.clkr
,
2409 [CAMSS_CSI3RDI_CLK
] = &camss_csi3rdi_clk
.clkr
,
2410 [CAMSS_CSI_VFE0_CLK
] = &camss_csi_vfe0_clk
.clkr
,
2411 [CAMSS_CSI_VFE1_CLK
] = &camss_csi_vfe1_clk
.clkr
,
2412 [CAMSS_GP0_CLK
] = &camss_gp0_clk
.clkr
,
2413 [CAMSS_GP1_CLK
] = &camss_gp1_clk
.clkr
,
2414 [CAMSS_ISPIF_AHB_CLK
] = &camss_ispif_ahb_clk
.clkr
,
2415 [CAMSS_JPEG_JPEG0_CLK
] = &camss_jpeg_jpeg0_clk
.clkr
,
2416 [CAMSS_JPEG_JPEG1_CLK
] = &camss_jpeg_jpeg1_clk
.clkr
,
2417 [CAMSS_JPEG_JPEG2_CLK
] = &camss_jpeg_jpeg2_clk
.clkr
,
2418 [CAMSS_JPEG_JPEG_AHB_CLK
] = &camss_jpeg_jpeg_ahb_clk
.clkr
,
2419 [CAMSS_JPEG_JPEG_AXI_CLK
] = &camss_jpeg_jpeg_axi_clk
.clkr
,
2420 [CAMSS_JPEG_JPEG_OCMEMNOC_CLK
] = &camss_jpeg_jpeg_ocmemnoc_clk
.clkr
,
2421 [CAMSS_MCLK0_CLK
] = &camss_mclk0_clk
.clkr
,
2422 [CAMSS_MCLK1_CLK
] = &camss_mclk1_clk
.clkr
,
2423 [CAMSS_MCLK2_CLK
] = &camss_mclk2_clk
.clkr
,
2424 [CAMSS_MCLK3_CLK
] = &camss_mclk3_clk
.clkr
,
2425 [CAMSS_MICRO_AHB_CLK
] = &camss_micro_ahb_clk
.clkr
,
2426 [CAMSS_PHY0_CSI0PHYTIMER_CLK
] = &camss_phy0_csi0phytimer_clk
.clkr
,
2427 [CAMSS_PHY1_CSI1PHYTIMER_CLK
] = &camss_phy1_csi1phytimer_clk
.clkr
,
2428 [CAMSS_PHY2_CSI2PHYTIMER_CLK
] = &camss_phy2_csi2phytimer_clk
.clkr
,
2429 [CAMSS_TOP_AHB_CLK
] = &camss_top_ahb_clk
.clkr
,
2430 [CAMSS_VFE_CPP_AHB_CLK
] = &camss_vfe_cpp_ahb_clk
.clkr
,
2431 [CAMSS_VFE_CPP_CLK
] = &camss_vfe_cpp_clk
.clkr
,
2432 [CAMSS_VFE_VFE0_CLK
] = &camss_vfe_vfe0_clk
.clkr
,
2433 [CAMSS_VFE_VFE1_CLK
] = &camss_vfe_vfe1_clk
.clkr
,
2434 [CAMSS_VFE_VFE_AHB_CLK
] = &camss_vfe_vfe_ahb_clk
.clkr
,
2435 [CAMSS_VFE_VFE_AXI_CLK
] = &camss_vfe_vfe_axi_clk
.clkr
,
2436 [CAMSS_VFE_VFE_OCMEMNOC_CLK
] = &camss_vfe_vfe_ocmemnoc_clk
.clkr
,
2437 [MDSS_AHB_CLK
] = &mdss_ahb_clk
.clkr
,
2438 [MDSS_AXI_CLK
] = &mdss_axi_clk
.clkr
,
2439 [MDSS_BYTE0_CLK
] = &mdss_byte0_clk
.clkr
,
2440 [MDSS_BYTE1_CLK
] = &mdss_byte1_clk
.clkr
,
2441 [MDSS_EDPAUX_CLK
] = &mdss_edpaux_clk
.clkr
,
2442 [MDSS_EDPLINK_CLK
] = &mdss_edplink_clk
.clkr
,
2443 [MDSS_EDPPIXEL_CLK
] = &mdss_edppixel_clk
.clkr
,
2444 [MDSS_ESC0_CLK
] = &mdss_esc0_clk
.clkr
,
2445 [MDSS_ESC1_CLK
] = &mdss_esc1_clk
.clkr
,
2446 [MDSS_EXTPCLK_CLK
] = &mdss_extpclk_clk
.clkr
,
2447 [MDSS_HDMI_AHB_CLK
] = &mdss_hdmi_ahb_clk
.clkr
,
2448 [MDSS_HDMI_CLK
] = &mdss_hdmi_clk
.clkr
,
2449 [MDSS_MDP_CLK
] = &mdss_mdp_clk
.clkr
,
2450 [MDSS_MDP_LUT_CLK
] = &mdss_mdp_lut_clk
.clkr
,
2451 [MDSS_PCLK0_CLK
] = &mdss_pclk0_clk
.clkr
,
2452 [MDSS_PCLK1_CLK
] = &mdss_pclk1_clk
.clkr
,
2453 [MDSS_VSYNC_CLK
] = &mdss_vsync_clk
.clkr
,
2454 [MMSS_MISC_AHB_CLK
] = &mmss_misc_ahb_clk
.clkr
,
2455 [MMSS_MMSSNOC_AHB_CLK
] = &mmss_mmssnoc_ahb_clk
.clkr
,
2456 [MMSS_MMSSNOC_BTO_AHB_CLK
] = &mmss_mmssnoc_bto_ahb_clk
.clkr
,
2457 [MMSS_MMSSNOC_AXI_CLK
] = &mmss_mmssnoc_axi_clk
.clkr
,
2458 [MMSS_S0_AXI_CLK
] = &mmss_s0_axi_clk
.clkr
,
2459 [OCMEMCX_AHB_CLK
] = &ocmemcx_ahb_clk
.clkr
,
2460 [OCMEMCX_OCMEMNOC_CLK
] = &ocmemcx_ocmemnoc_clk
.clkr
,
2461 [OXILI_OCMEMGX_CLK
] = &oxili_ocmemgx_clk
.clkr
,
2462 [OCMEMNOC_CLK
] = &ocmemnoc_clk
.clkr
,
2463 [OXILI_GFX3D_CLK
] = &oxili_gfx3d_clk
.clkr
,
2464 [OXILICX_AHB_CLK
] = &oxilicx_ahb_clk
.clkr
,
2465 [OXILICX_AXI_CLK
] = &oxilicx_axi_clk
.clkr
,
2466 [VENUS0_AHB_CLK
] = &venus0_ahb_clk
.clkr
,
2467 [VENUS0_AXI_CLK
] = &venus0_axi_clk
.clkr
,
2468 [VENUS0_OCMEMNOC_CLK
] = &venus0_ocmemnoc_clk
.clkr
,
2469 [VENUS0_VCODEC0_CLK
] = &venus0_vcodec0_clk
.clkr
,
2472 static const struct qcom_reset_map mmcc_msm8974_resets
[] = {
2473 [SPDM_RESET
] = { 0x0200 },
2474 [SPDM_RM_RESET
] = { 0x0300 },
2475 [VENUS0_RESET
] = { 0x1020 },
2476 [MDSS_RESET
] = { 0x2300 },
2477 [CAMSS_PHY0_RESET
] = { 0x3020 },
2478 [CAMSS_PHY1_RESET
] = { 0x3050 },
2479 [CAMSS_PHY2_RESET
] = { 0x3080 },
2480 [CAMSS_CSI0_RESET
] = { 0x30b0 },
2481 [CAMSS_CSI0PHY_RESET
] = { 0x30c0 },
2482 [CAMSS_CSI0RDI_RESET
] = { 0x30d0 },
2483 [CAMSS_CSI0PIX_RESET
] = { 0x30e0 },
2484 [CAMSS_CSI1_RESET
] = { 0x3120 },
2485 [CAMSS_CSI1PHY_RESET
] = { 0x3130 },
2486 [CAMSS_CSI1RDI_RESET
] = { 0x3140 },
2487 [CAMSS_CSI1PIX_RESET
] = { 0x3150 },
2488 [CAMSS_CSI2_RESET
] = { 0x3180 },
2489 [CAMSS_CSI2PHY_RESET
] = { 0x3190 },
2490 [CAMSS_CSI2RDI_RESET
] = { 0x31a0 },
2491 [CAMSS_CSI2PIX_RESET
] = { 0x31b0 },
2492 [CAMSS_CSI3_RESET
] = { 0x31e0 },
2493 [CAMSS_CSI3PHY_RESET
] = { 0x31f0 },
2494 [CAMSS_CSI3RDI_RESET
] = { 0x3200 },
2495 [CAMSS_CSI3PIX_RESET
] = { 0x3210 },
2496 [CAMSS_ISPIF_RESET
] = { 0x3220 },
2497 [CAMSS_CCI_RESET
] = { 0x3340 },
2498 [CAMSS_MCLK0_RESET
] = { 0x3380 },
2499 [CAMSS_MCLK1_RESET
] = { 0x33b0 },
2500 [CAMSS_MCLK2_RESET
] = { 0x33e0 },
2501 [CAMSS_MCLK3_RESET
] = { 0x3410 },
2502 [CAMSS_GP0_RESET
] = { 0x3440 },
2503 [CAMSS_GP1_RESET
] = { 0x3470 },
2504 [CAMSS_TOP_RESET
] = { 0x3480 },
2505 [CAMSS_MICRO_RESET
] = { 0x3490 },
2506 [CAMSS_JPEG_RESET
] = { 0x35a0 },
2507 [CAMSS_VFE_RESET
] = { 0x36a0 },
2508 [CAMSS_CSI_VFE0_RESET
] = { 0x3700 },
2509 [CAMSS_CSI_VFE1_RESET
] = { 0x3710 },
2510 [OXILI_RESET
] = { 0x4020 },
2511 [OXILICX_RESET
] = { 0x4030 },
2512 [OCMEMCX_RESET
] = { 0x4050 },
2513 [MMSS_RBCRP_RESET
] = { 0x4080 },
2514 [MMSSNOCAHB_RESET
] = { 0x5020 },
2515 [MMSSNOCAXI_RESET
] = { 0x5060 },
2516 [OCMEMNOC_RESET
] = { 0x50b0 },
2519 static const struct regmap_config mmcc_msm8974_regmap_config
= {
2523 .max_register
= 0x5104,
2527 static const struct of_device_id mmcc_msm8974_match_table
[] = {
2528 { .compatible
= "qcom,mmcc-msm8974" },
2531 MODULE_DEVICE_TABLE(of
, mmcc_msm8974_match_table
);
2534 struct qcom_reset_controller reset
;
2535 struct clk_onecell_data data
;
2539 static int mmcc_msm8974_probe(struct platform_device
*pdev
)
2542 struct resource
*res
;
2544 struct device
*dev
= &pdev
->dev
;
2546 struct clk_onecell_data
*data
;
2548 struct regmap
*regmap
;
2550 struct qcom_reset_controller
*reset
;
2553 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
2554 base
= devm_ioremap_resource(dev
, res
);
2556 return PTR_ERR(base
);
2558 regmap
= devm_regmap_init_mmio(dev
, base
, &mmcc_msm8974_regmap_config
);
2560 return PTR_ERR(regmap
);
2562 num_clks
= ARRAY_SIZE(mmcc_msm8974_clocks
);
2563 cc
= devm_kzalloc(dev
, sizeof(*cc
) + sizeof(*clks
) * num_clks
,
2571 data
->clk_num
= num_clks
;
2573 clk_pll_configure_sr_hpm_lp(&mmpll1
, regmap
, &mmpll1_config
, true);
2574 clk_pll_configure_sr_hpm_lp(&mmpll3
, regmap
, &mmpll3_config
, false);
2576 for (i
= 0; i
< num_clks
; i
++) {
2577 if (!mmcc_msm8974_clocks
[i
])
2579 clk
= devm_clk_register_regmap(dev
, mmcc_msm8974_clocks
[i
]);
2581 return PTR_ERR(clk
);
2585 ret
= of_clk_add_provider(dev
->of_node
, of_clk_src_onecell_get
, data
);
2590 reset
->rcdev
.of_node
= dev
->of_node
;
2591 reset
->rcdev
.ops
= &qcom_reset_ops
,
2592 reset
->rcdev
.owner
= THIS_MODULE
,
2593 reset
->rcdev
.nr_resets
= ARRAY_SIZE(mmcc_msm8974_resets
),
2594 reset
->regmap
= regmap
;
2595 reset
->reset_map
= mmcc_msm8974_resets
,
2596 platform_set_drvdata(pdev
, &reset
->rcdev
);
2598 ret
= reset_controller_register(&reset
->rcdev
);
2600 of_clk_del_provider(dev
->of_node
);
2605 static int mmcc_msm8974_remove(struct platform_device
*pdev
)
2607 of_clk_del_provider(pdev
->dev
.of_node
);
2608 reset_controller_unregister(platform_get_drvdata(pdev
));
2612 static struct platform_driver mmcc_msm8974_driver
= {
2613 .probe
= mmcc_msm8974_probe
,
2614 .remove
= mmcc_msm8974_remove
,
2616 .name
= "mmcc-msm8974",
2617 .owner
= THIS_MODULE
,
2618 .of_match_table
= mmcc_msm8974_match_table
,
2621 module_platform_driver(mmcc_msm8974_driver
);
2623 MODULE_DESCRIPTION("QCOM MMCC MSM8974 Driver");
2624 MODULE_LICENSE("GPL v2");
2625 MODULE_ALIAS("platform:mmcc-msm8974");