1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2016 AmLogic, Inc.
4 * Michael Turquette <mturquette@baylibre.com>
7 #include <linux/clk-provider.h>
8 #include <linux/init.h>
9 #include <linux/of_device.h>
10 #include <linux/platform_device.h>
11 #include <linux/module.h>
14 #include "clk-regmap.h"
17 #include "meson-eeclk.h"
18 #include "vid-pll-div.h"
20 static DEFINE_SPINLOCK(meson_clk_lock
);
22 static const struct pll_params_table gxbb_gp0_pll_params_table
[] = {
57 static const struct pll_params_table gxl_gp0_pll_params_table
[] = {
86 static struct clk_regmap gxbb_fixed_pll_dco
= {
87 .data
= &(struct meson_clk_pll_data
){
89 .reg_off
= HHI_MPLL_CNTL
,
94 .reg_off
= HHI_MPLL_CNTL
,
99 .reg_off
= HHI_MPLL_CNTL
,
104 .reg_off
= HHI_MPLL_CNTL2
,
109 .reg_off
= HHI_MPLL_CNTL
,
114 .reg_off
= HHI_MPLL_CNTL
,
119 .hw
.init
= &(struct clk_init_data
){
120 .name
= "fixed_pll_dco",
121 .ops
= &meson_clk_pll_ro_ops
,
122 .parent_data
= &(const struct clk_parent_data
) {
129 static struct clk_regmap gxbb_fixed_pll
= {
130 .data
= &(struct clk_regmap_div_data
){
131 .offset
= HHI_MPLL_CNTL
,
134 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
136 .hw
.init
= &(struct clk_init_data
){
138 .ops
= &clk_regmap_divider_ro_ops
,
139 .parent_hws
= (const struct clk_hw
*[]) {
140 &gxbb_fixed_pll_dco
.hw
144 * This clock won't ever change at runtime so
145 * CLK_SET_RATE_PARENT is not required
150 static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult
= {
153 .hw
.init
= &(struct clk_init_data
){
154 .name
= "hdmi_pll_pre_mult",
155 .ops
= &clk_fixed_factor_ops
,
156 .parent_data
= &(const struct clk_parent_data
) {
163 static struct clk_regmap gxbb_hdmi_pll_dco
= {
164 .data
= &(struct meson_clk_pll_data
){
166 .reg_off
= HHI_HDMI_PLL_CNTL
,
171 .reg_off
= HHI_HDMI_PLL_CNTL
,
176 .reg_off
= HHI_HDMI_PLL_CNTL
,
181 .reg_off
= HHI_HDMI_PLL_CNTL2
,
186 .reg_off
= HHI_HDMI_PLL_CNTL
,
191 .reg_off
= HHI_HDMI_PLL_CNTL
,
196 .hw
.init
= &(struct clk_init_data
){
197 .name
= "hdmi_pll_dco",
198 .ops
= &meson_clk_pll_ro_ops
,
199 .parent_hws
= (const struct clk_hw
*[]) {
200 &gxbb_hdmi_pll_pre_mult
.hw
204 * Display directly handle hdmi pll registers ATM, we need
205 * NOCACHE to keep our view of the clock as accurate as possible
207 .flags
= CLK_GET_RATE_NOCACHE
,
211 static struct clk_regmap gxl_hdmi_pll_dco
= {
212 .data
= &(struct meson_clk_pll_data
){
214 .reg_off
= HHI_HDMI_PLL_CNTL
,
219 .reg_off
= HHI_HDMI_PLL_CNTL
,
224 .reg_off
= HHI_HDMI_PLL_CNTL
,
229 * On gxl, there is a register shift due to
230 * HHI_HDMI_PLL_CNTL1 which does not exist on gxbb,
231 * so we use the HHI_HDMI_PLL_CNTL2 define from GXBB
232 * instead which is defined at the same offset.
235 .reg_off
= HHI_HDMI_PLL_CNTL2
,
240 .reg_off
= HHI_HDMI_PLL_CNTL
,
245 .reg_off
= HHI_HDMI_PLL_CNTL
,
250 .hw
.init
= &(struct clk_init_data
){
251 .name
= "hdmi_pll_dco",
252 .ops
= &meson_clk_pll_ro_ops
,
253 .parent_data
= &(const struct clk_parent_data
) {
258 * Display directly handle hdmi pll registers ATM, we need
259 * NOCACHE to keep our view of the clock as accurate as possible
261 .flags
= CLK_GET_RATE_NOCACHE
,
265 static struct clk_regmap gxbb_hdmi_pll_od
= {
266 .data
= &(struct clk_regmap_div_data
){
267 .offset
= HHI_HDMI_PLL_CNTL2
,
270 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
272 .hw
.init
= &(struct clk_init_data
){
273 .name
= "hdmi_pll_od",
274 .ops
= &clk_regmap_divider_ro_ops
,
275 .parent_hws
= (const struct clk_hw
*[]) {
276 &gxbb_hdmi_pll_dco
.hw
279 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
283 static struct clk_regmap gxbb_hdmi_pll_od2
= {
284 .data
= &(struct clk_regmap_div_data
){
285 .offset
= HHI_HDMI_PLL_CNTL2
,
288 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
290 .hw
.init
= &(struct clk_init_data
){
291 .name
= "hdmi_pll_od2",
292 .ops
= &clk_regmap_divider_ro_ops
,
293 .parent_hws
= (const struct clk_hw
*[]) {
297 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
301 static struct clk_regmap gxbb_hdmi_pll
= {
302 .data
= &(struct clk_regmap_div_data
){
303 .offset
= HHI_HDMI_PLL_CNTL2
,
306 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
308 .hw
.init
= &(struct clk_init_data
){
310 .ops
= &clk_regmap_divider_ro_ops
,
311 .parent_hws
= (const struct clk_hw
*[]) {
312 &gxbb_hdmi_pll_od2
.hw
315 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
319 static struct clk_regmap gxl_hdmi_pll_od
= {
320 .data
= &(struct clk_regmap_div_data
){
321 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
324 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
326 .hw
.init
= &(struct clk_init_data
){
327 .name
= "hdmi_pll_od",
328 .ops
= &clk_regmap_divider_ro_ops
,
329 .parent_hws
= (const struct clk_hw
*[]) {
333 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
337 static struct clk_regmap gxl_hdmi_pll_od2
= {
338 .data
= &(struct clk_regmap_div_data
){
339 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
342 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
344 .hw
.init
= &(struct clk_init_data
){
345 .name
= "hdmi_pll_od2",
346 .ops
= &clk_regmap_divider_ro_ops
,
347 .parent_hws
= (const struct clk_hw
*[]) {
351 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
355 static struct clk_regmap gxl_hdmi_pll
= {
356 .data
= &(struct clk_regmap_div_data
){
357 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
360 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
362 .hw
.init
= &(struct clk_init_data
){
364 .ops
= &clk_regmap_divider_ro_ops
,
365 .parent_hws
= (const struct clk_hw
*[]) {
369 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
373 static struct clk_regmap gxbb_sys_pll_dco
= {
374 .data
= &(struct meson_clk_pll_data
){
376 .reg_off
= HHI_SYS_PLL_CNTL
,
381 .reg_off
= HHI_SYS_PLL_CNTL
,
386 .reg_off
= HHI_SYS_PLL_CNTL
,
391 .reg_off
= HHI_SYS_PLL_CNTL
,
396 .reg_off
= HHI_SYS_PLL_CNTL
,
401 .hw
.init
= &(struct clk_init_data
){
402 .name
= "sys_pll_dco",
403 .ops
= &meson_clk_pll_ro_ops
,
404 .parent_data
= &(const struct clk_parent_data
) {
411 static struct clk_regmap gxbb_sys_pll
= {
412 .data
= &(struct clk_regmap_div_data
){
413 .offset
= HHI_SYS_PLL_CNTL
,
416 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
418 .hw
.init
= &(struct clk_init_data
){
420 .ops
= &clk_regmap_divider_ro_ops
,
421 .parent_hws
= (const struct clk_hw
*[]) {
425 .flags
= CLK_SET_RATE_PARENT
,
429 static const struct reg_sequence gxbb_gp0_init_regs
[] = {
430 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0x69c80000 },
431 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x0a5590c4 },
432 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0x0000500d },
435 static struct clk_regmap gxbb_gp0_pll_dco
= {
436 .data
= &(struct meson_clk_pll_data
){
438 .reg_off
= HHI_GP0_PLL_CNTL
,
443 .reg_off
= HHI_GP0_PLL_CNTL
,
448 .reg_off
= HHI_GP0_PLL_CNTL
,
453 .reg_off
= HHI_GP0_PLL_CNTL
,
458 .reg_off
= HHI_GP0_PLL_CNTL
,
462 .table
= gxbb_gp0_pll_params_table
,
463 .init_regs
= gxbb_gp0_init_regs
,
464 .init_count
= ARRAY_SIZE(gxbb_gp0_init_regs
),
466 .hw
.init
= &(struct clk_init_data
){
467 .name
= "gp0_pll_dco",
468 .ops
= &meson_clk_pll_ops
,
469 .parent_data
= &(const struct clk_parent_data
) {
476 static const struct reg_sequence gxl_gp0_init_regs
[] = {
477 { .reg
= HHI_GP0_PLL_CNTL1
, .def
= 0xc084b000 },
478 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0xb75020be },
479 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x0a59a288 },
480 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0xc000004d },
481 { .reg
= HHI_GP0_PLL_CNTL5
, .def
= 0x00078000 },
484 static struct clk_regmap gxl_gp0_pll_dco
= {
485 .data
= &(struct meson_clk_pll_data
){
487 .reg_off
= HHI_GP0_PLL_CNTL
,
492 .reg_off
= HHI_GP0_PLL_CNTL
,
497 .reg_off
= HHI_GP0_PLL_CNTL
,
502 .reg_off
= HHI_GP0_PLL_CNTL1
,
507 .reg_off
= HHI_GP0_PLL_CNTL
,
512 .reg_off
= HHI_GP0_PLL_CNTL
,
516 .table
= gxl_gp0_pll_params_table
,
517 .init_regs
= gxl_gp0_init_regs
,
518 .init_count
= ARRAY_SIZE(gxl_gp0_init_regs
),
520 .hw
.init
= &(struct clk_init_data
){
521 .name
= "gp0_pll_dco",
522 .ops
= &meson_clk_pll_ops
,
523 .parent_data
= &(const struct clk_parent_data
) {
530 static struct clk_regmap gxbb_gp0_pll
= {
531 .data
= &(struct clk_regmap_div_data
){
532 .offset
= HHI_GP0_PLL_CNTL
,
535 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
537 .hw
.init
= &(struct clk_init_data
){
539 .ops
= &clk_regmap_divider_ops
,
540 .parent_data
= &(const struct clk_parent_data
) {
543 * GXL and GXBB have different gp0_pll_dco (with
544 * different struct clk_hw). We fallback to the global
545 * naming string mechanism so gp0_pll picks up the
548 .name
= "gp0_pll_dco",
552 .flags
= CLK_SET_RATE_PARENT
,
556 static struct clk_fixed_factor gxbb_fclk_div2_div
= {
559 .hw
.init
= &(struct clk_init_data
){
560 .name
= "fclk_div2_div",
561 .ops
= &clk_fixed_factor_ops
,
562 .parent_hws
= (const struct clk_hw
*[]) {
569 static struct clk_regmap gxbb_fclk_div2
= {
570 .data
= &(struct clk_regmap_gate_data
){
571 .offset
= HHI_MPLL_CNTL6
,
574 .hw
.init
= &(struct clk_init_data
){
576 .ops
= &clk_regmap_gate_ops
,
577 .parent_hws
= (const struct clk_hw
*[]) {
578 &gxbb_fclk_div2_div
.hw
581 .flags
= CLK_IS_CRITICAL
,
585 static struct clk_fixed_factor gxbb_fclk_div3_div
= {
588 .hw
.init
= &(struct clk_init_data
){
589 .name
= "fclk_div3_div",
590 .ops
= &clk_fixed_factor_ops
,
591 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
596 static struct clk_regmap gxbb_fclk_div3
= {
597 .data
= &(struct clk_regmap_gate_data
){
598 .offset
= HHI_MPLL_CNTL6
,
601 .hw
.init
= &(struct clk_init_data
){
603 .ops
= &clk_regmap_gate_ops
,
604 .parent_hws
= (const struct clk_hw
*[]) {
605 &gxbb_fclk_div3_div
.hw
610 * This clock, as fdiv2, is used by the SCPI FW and is required
611 * by the platform to operate correctly.
612 * Until the following condition are met, we need this clock to
613 * be marked as critical:
614 * a) The SCPI generic driver claims and enable all the clocks
616 * b) CCF has a clock hand-off mechanism to make the sure the
617 * clock stays on until the proper driver comes along
619 .flags
= CLK_IS_CRITICAL
,
623 static struct clk_fixed_factor gxbb_fclk_div4_div
= {
626 .hw
.init
= &(struct clk_init_data
){
627 .name
= "fclk_div4_div",
628 .ops
= &clk_fixed_factor_ops
,
629 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
634 static struct clk_regmap gxbb_fclk_div4
= {
635 .data
= &(struct clk_regmap_gate_data
){
636 .offset
= HHI_MPLL_CNTL6
,
639 .hw
.init
= &(struct clk_init_data
){
641 .ops
= &clk_regmap_gate_ops
,
642 .parent_hws
= (const struct clk_hw
*[]) {
643 &gxbb_fclk_div4_div
.hw
649 static struct clk_fixed_factor gxbb_fclk_div5_div
= {
652 .hw
.init
= &(struct clk_init_data
){
653 .name
= "fclk_div5_div",
654 .ops
= &clk_fixed_factor_ops
,
655 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
660 static struct clk_regmap gxbb_fclk_div5
= {
661 .data
= &(struct clk_regmap_gate_data
){
662 .offset
= HHI_MPLL_CNTL6
,
665 .hw
.init
= &(struct clk_init_data
){
667 .ops
= &clk_regmap_gate_ops
,
668 .parent_hws
= (const struct clk_hw
*[]) {
669 &gxbb_fclk_div5_div
.hw
675 static struct clk_fixed_factor gxbb_fclk_div7_div
= {
678 .hw
.init
= &(struct clk_init_data
){
679 .name
= "fclk_div7_div",
680 .ops
= &clk_fixed_factor_ops
,
681 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
686 static struct clk_regmap gxbb_fclk_div7
= {
687 .data
= &(struct clk_regmap_gate_data
){
688 .offset
= HHI_MPLL_CNTL6
,
691 .hw
.init
= &(struct clk_init_data
){
693 .ops
= &clk_regmap_gate_ops
,
694 .parent_hws
= (const struct clk_hw
*[]) {
695 &gxbb_fclk_div7_div
.hw
701 static struct clk_regmap gxbb_mpll_prediv
= {
702 .data
= &(struct clk_regmap_div_data
){
703 .offset
= HHI_MPLL_CNTL5
,
707 .hw
.init
= &(struct clk_init_data
){
708 .name
= "mpll_prediv",
709 .ops
= &clk_regmap_divider_ro_ops
,
710 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
715 static struct clk_regmap gxbb_mpll0_div
= {
716 .data
= &(struct meson_clk_mpll_data
){
718 .reg_off
= HHI_MPLL_CNTL7
,
723 .reg_off
= HHI_MPLL_CNTL7
,
728 .reg_off
= HHI_MPLL_CNTL7
,
732 .lock
= &meson_clk_lock
,
734 .hw
.init
= &(struct clk_init_data
){
736 .ops
= &meson_clk_mpll_ops
,
737 .parent_hws
= (const struct clk_hw
*[]) {
744 static struct clk_regmap gxbb_mpll0
= {
745 .data
= &(struct clk_regmap_gate_data
){
746 .offset
= HHI_MPLL_CNTL7
,
749 .hw
.init
= &(struct clk_init_data
){
751 .ops
= &clk_regmap_gate_ops
,
752 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_mpll0_div
.hw
},
754 .flags
= CLK_SET_RATE_PARENT
,
758 static struct clk_regmap gxbb_mpll1_div
= {
759 .data
= &(struct meson_clk_mpll_data
){
761 .reg_off
= HHI_MPLL_CNTL8
,
766 .reg_off
= HHI_MPLL_CNTL8
,
771 .reg_off
= HHI_MPLL_CNTL8
,
775 .lock
= &meson_clk_lock
,
777 .hw
.init
= &(struct clk_init_data
){
779 .ops
= &meson_clk_mpll_ops
,
780 .parent_hws
= (const struct clk_hw
*[]) {
787 static struct clk_regmap gxbb_mpll1
= {
788 .data
= &(struct clk_regmap_gate_data
){
789 .offset
= HHI_MPLL_CNTL8
,
792 .hw
.init
= &(struct clk_init_data
){
794 .ops
= &clk_regmap_gate_ops
,
795 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_mpll1_div
.hw
},
797 .flags
= CLK_SET_RATE_PARENT
,
801 static struct clk_regmap gxbb_mpll2_div
= {
802 .data
= &(struct meson_clk_mpll_data
){
804 .reg_off
= HHI_MPLL_CNTL9
,
809 .reg_off
= HHI_MPLL_CNTL9
,
814 .reg_off
= HHI_MPLL_CNTL9
,
818 .lock
= &meson_clk_lock
,
820 .hw
.init
= &(struct clk_init_data
){
822 .ops
= &meson_clk_mpll_ops
,
823 .parent_hws
= (const struct clk_hw
*[]) {
830 static struct clk_regmap gxbb_mpll2
= {
831 .data
= &(struct clk_regmap_gate_data
){
832 .offset
= HHI_MPLL_CNTL9
,
835 .hw
.init
= &(struct clk_init_data
){
837 .ops
= &clk_regmap_gate_ops
,
838 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_mpll2_div
.hw
},
840 .flags
= CLK_SET_RATE_PARENT
,
844 static u32 mux_table_clk81
[] = { 0, 2, 3, 4, 5, 6, 7 };
845 static const struct clk_parent_data clk81_parent_data
[] = {
846 { .fw_name
= "xtal", },
847 { .hw
= &gxbb_fclk_div7
.hw
},
848 { .hw
= &gxbb_mpll1
.hw
},
849 { .hw
= &gxbb_mpll2
.hw
},
850 { .hw
= &gxbb_fclk_div4
.hw
},
851 { .hw
= &gxbb_fclk_div3
.hw
},
852 { .hw
= &gxbb_fclk_div5
.hw
},
855 static struct clk_regmap gxbb_mpeg_clk_sel
= {
856 .data
= &(struct clk_regmap_mux_data
){
857 .offset
= HHI_MPEG_CLK_CNTL
,
860 .table
= mux_table_clk81
,
862 .hw
.init
= &(struct clk_init_data
){
863 .name
= "mpeg_clk_sel",
864 .ops
= &clk_regmap_mux_ro_ops
,
866 * bits 14:12 selects from 8 possible parents:
867 * xtal, 1'b0 (wtf), fclk_div7, mpll_clkout1, mpll_clkout2,
868 * fclk_div4, fclk_div3, fclk_div5
870 .parent_data
= clk81_parent_data
,
871 .num_parents
= ARRAY_SIZE(clk81_parent_data
),
875 static struct clk_regmap gxbb_mpeg_clk_div
= {
876 .data
= &(struct clk_regmap_div_data
){
877 .offset
= HHI_MPEG_CLK_CNTL
,
881 .hw
.init
= &(struct clk_init_data
){
882 .name
= "mpeg_clk_div",
883 .ops
= &clk_regmap_divider_ro_ops
,
884 .parent_hws
= (const struct clk_hw
*[]) {
885 &gxbb_mpeg_clk_sel
.hw
891 /* the mother of dragons gates */
892 static struct clk_regmap gxbb_clk81
= {
893 .data
= &(struct clk_regmap_gate_data
){
894 .offset
= HHI_MPEG_CLK_CNTL
,
897 .hw
.init
= &(struct clk_init_data
){
899 .ops
= &clk_regmap_gate_ops
,
900 .parent_hws
= (const struct clk_hw
*[]) {
901 &gxbb_mpeg_clk_div
.hw
904 .flags
= CLK_IS_CRITICAL
,
908 static struct clk_regmap gxbb_sar_adc_clk_sel
= {
909 .data
= &(struct clk_regmap_mux_data
){
910 .offset
= HHI_SAR_CLK_CNTL
,
914 .hw
.init
= &(struct clk_init_data
){
915 .name
= "sar_adc_clk_sel",
916 .ops
= &clk_regmap_mux_ops
,
917 /* NOTE: The datasheet doesn't list the parents for bit 10 */
918 .parent_data
= (const struct clk_parent_data
[]) {
919 { .fw_name
= "xtal", },
920 { .hw
= &gxbb_clk81
.hw
},
926 static struct clk_regmap gxbb_sar_adc_clk_div
= {
927 .data
= &(struct clk_regmap_div_data
){
928 .offset
= HHI_SAR_CLK_CNTL
,
932 .hw
.init
= &(struct clk_init_data
){
933 .name
= "sar_adc_clk_div",
934 .ops
= &clk_regmap_divider_ops
,
935 .parent_hws
= (const struct clk_hw
*[]) {
936 &gxbb_sar_adc_clk_sel
.hw
939 .flags
= CLK_SET_RATE_PARENT
,
943 static struct clk_regmap gxbb_sar_adc_clk
= {
944 .data
= &(struct clk_regmap_gate_data
){
945 .offset
= HHI_SAR_CLK_CNTL
,
948 .hw
.init
= &(struct clk_init_data
){
949 .name
= "sar_adc_clk",
950 .ops
= &clk_regmap_gate_ops
,
951 .parent_hws
= (const struct clk_hw
*[]) {
952 &gxbb_sar_adc_clk_div
.hw
955 .flags
= CLK_SET_RATE_PARENT
,
960 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
961 * muxed by a glitch-free switch. The CCF can manage this glitch-free
962 * mux because it does top-to-bottom updates the each clock tree and
963 * switches to the "inactive" one when CLK_SET_RATE_GATE is set.
966 static const struct clk_parent_data gxbb_mali_0_1_parent_data
[] = {
967 { .fw_name
= "xtal", },
968 { .hw
= &gxbb_gp0_pll
.hw
},
969 { .hw
= &gxbb_mpll2
.hw
},
970 { .hw
= &gxbb_mpll1
.hw
},
971 { .hw
= &gxbb_fclk_div7
.hw
},
972 { .hw
= &gxbb_fclk_div4
.hw
},
973 { .hw
= &gxbb_fclk_div3
.hw
},
974 { .hw
= &gxbb_fclk_div5
.hw
},
977 static struct clk_regmap gxbb_mali_0_sel
= {
978 .data
= &(struct clk_regmap_mux_data
){
979 .offset
= HHI_MALI_CLK_CNTL
,
983 .hw
.init
= &(struct clk_init_data
){
984 .name
= "mali_0_sel",
985 .ops
= &clk_regmap_mux_ops
,
986 .parent_data
= gxbb_mali_0_1_parent_data
,
989 * Don't request the parent to change the rate because
990 * all GPU frequencies can be derived from the fclk_*
991 * clocks and one special GP0_PLL setting. This is
992 * important because we need the MPLL clocks for audio.
998 static struct clk_regmap gxbb_mali_0_div
= {
999 .data
= &(struct clk_regmap_div_data
){
1000 .offset
= HHI_MALI_CLK_CNTL
,
1004 .hw
.init
= &(struct clk_init_data
){
1005 .name
= "mali_0_div",
1006 .ops
= &clk_regmap_divider_ops
,
1007 .parent_hws
= (const struct clk_hw
*[]) {
1011 .flags
= CLK_SET_RATE_PARENT
,
1015 static struct clk_regmap gxbb_mali_0
= {
1016 .data
= &(struct clk_regmap_gate_data
){
1017 .offset
= HHI_MALI_CLK_CNTL
,
1020 .hw
.init
= &(struct clk_init_data
){
1022 .ops
= &clk_regmap_gate_ops
,
1023 .parent_hws
= (const struct clk_hw
*[]) {
1027 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1031 static struct clk_regmap gxbb_mali_1_sel
= {
1032 .data
= &(struct clk_regmap_mux_data
){
1033 .offset
= HHI_MALI_CLK_CNTL
,
1037 .hw
.init
= &(struct clk_init_data
){
1038 .name
= "mali_1_sel",
1039 .ops
= &clk_regmap_mux_ops
,
1040 .parent_data
= gxbb_mali_0_1_parent_data
,
1043 * Don't request the parent to change the rate because
1044 * all GPU frequencies can be derived from the fclk_*
1045 * clocks and one special GP0_PLL setting. This is
1046 * important because we need the MPLL clocks for audio.
1052 static struct clk_regmap gxbb_mali_1_div
= {
1053 .data
= &(struct clk_regmap_div_data
){
1054 .offset
= HHI_MALI_CLK_CNTL
,
1058 .hw
.init
= &(struct clk_init_data
){
1059 .name
= "mali_1_div",
1060 .ops
= &clk_regmap_divider_ops
,
1061 .parent_hws
= (const struct clk_hw
*[]) {
1065 .flags
= CLK_SET_RATE_PARENT
,
1069 static struct clk_regmap gxbb_mali_1
= {
1070 .data
= &(struct clk_regmap_gate_data
){
1071 .offset
= HHI_MALI_CLK_CNTL
,
1074 .hw
.init
= &(struct clk_init_data
){
1076 .ops
= &clk_regmap_gate_ops
,
1077 .parent_hws
= (const struct clk_hw
*[]) {
1081 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1085 static const struct clk_hw
*gxbb_mali_parent_hws
[] = {
1090 static struct clk_regmap gxbb_mali
= {
1091 .data
= &(struct clk_regmap_mux_data
){
1092 .offset
= HHI_MALI_CLK_CNTL
,
1096 .hw
.init
= &(struct clk_init_data
){
1098 .ops
= &clk_regmap_mux_ops
,
1099 .parent_hws
= gxbb_mali_parent_hws
,
1101 .flags
= CLK_SET_RATE_PARENT
,
1105 static struct clk_regmap gxbb_cts_amclk_sel
= {
1106 .data
= &(struct clk_regmap_mux_data
){
1107 .offset
= HHI_AUD_CLK_CNTL
,
1110 .table
= (u32
[]){ 1, 2, 3 },
1111 .flags
= CLK_MUX_ROUND_CLOSEST
,
1113 .hw
.init
= &(struct clk_init_data
){
1114 .name
= "cts_amclk_sel",
1115 .ops
= &clk_regmap_mux_ops
,
1116 .parent_hws
= (const struct clk_hw
*[]) {
1125 static struct clk_regmap gxbb_cts_amclk_div
= {
1126 .data
= &(struct clk_regmap_div_data
) {
1127 .offset
= HHI_AUD_CLK_CNTL
,
1130 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1132 .hw
.init
= &(struct clk_init_data
){
1133 .name
= "cts_amclk_div",
1134 .ops
= &clk_regmap_divider_ops
,
1135 .parent_hws
= (const struct clk_hw
*[]) {
1136 &gxbb_cts_amclk_sel
.hw
1139 .flags
= CLK_SET_RATE_PARENT
,
1143 static struct clk_regmap gxbb_cts_amclk
= {
1144 .data
= &(struct clk_regmap_gate_data
){
1145 .offset
= HHI_AUD_CLK_CNTL
,
1148 .hw
.init
= &(struct clk_init_data
){
1149 .name
= "cts_amclk",
1150 .ops
= &clk_regmap_gate_ops
,
1151 .parent_hws
= (const struct clk_hw
*[]) {
1152 &gxbb_cts_amclk_div
.hw
1155 .flags
= CLK_SET_RATE_PARENT
,
1159 static struct clk_regmap gxbb_cts_mclk_i958_sel
= {
1160 .data
= &(struct clk_regmap_mux_data
){
1161 .offset
= HHI_AUD_CLK_CNTL2
,
1164 .table
= (u32
[]){ 1, 2, 3 },
1165 .flags
= CLK_MUX_ROUND_CLOSEST
,
1167 .hw
.init
= &(struct clk_init_data
) {
1168 .name
= "cts_mclk_i958_sel",
1169 .ops
= &clk_regmap_mux_ops
,
1170 .parent_hws
= (const struct clk_hw
*[]) {
1179 static struct clk_regmap gxbb_cts_mclk_i958_div
= {
1180 .data
= &(struct clk_regmap_div_data
){
1181 .offset
= HHI_AUD_CLK_CNTL2
,
1184 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1186 .hw
.init
= &(struct clk_init_data
) {
1187 .name
= "cts_mclk_i958_div",
1188 .ops
= &clk_regmap_divider_ops
,
1189 .parent_hws
= (const struct clk_hw
*[]) {
1190 &gxbb_cts_mclk_i958_sel
.hw
1193 .flags
= CLK_SET_RATE_PARENT
,
1197 static struct clk_regmap gxbb_cts_mclk_i958
= {
1198 .data
= &(struct clk_regmap_gate_data
){
1199 .offset
= HHI_AUD_CLK_CNTL2
,
1202 .hw
.init
= &(struct clk_init_data
){
1203 .name
= "cts_mclk_i958",
1204 .ops
= &clk_regmap_gate_ops
,
1205 .parent_hws
= (const struct clk_hw
*[]) {
1206 &gxbb_cts_mclk_i958_div
.hw
1209 .flags
= CLK_SET_RATE_PARENT
,
1213 static struct clk_regmap gxbb_cts_i958
= {
1214 .data
= &(struct clk_regmap_mux_data
){
1215 .offset
= HHI_AUD_CLK_CNTL2
,
1219 .hw
.init
= &(struct clk_init_data
){
1221 .ops
= &clk_regmap_mux_ops
,
1222 .parent_hws
= (const struct clk_hw
*[]) {
1224 &gxbb_cts_mclk_i958
.hw
1228 *The parent is specific to origin of the audio data. Let the
1229 * consumer choose the appropriate parent
1231 .flags
= CLK_SET_RATE_PARENT
| CLK_SET_RATE_NO_REPARENT
,
1235 static const struct clk_parent_data gxbb_32k_clk_parent_data
[] = {
1236 { .fw_name
= "xtal", },
1238 * FIXME: This clock is provided by the ao clock controller but the
1239 * clock is not yet part of the binding of this controller, so string
1240 * name must be use to set this parent.
1242 { .name
= "cts_slow_oscin", .index
= -1 },
1243 { .hw
= &gxbb_fclk_div3
.hw
},
1244 { .hw
= &gxbb_fclk_div5
.hw
},
1247 static struct clk_regmap gxbb_32k_clk_sel
= {
1248 .data
= &(struct clk_regmap_mux_data
){
1249 .offset
= HHI_32K_CLK_CNTL
,
1253 .hw
.init
= &(struct clk_init_data
){
1254 .name
= "32k_clk_sel",
1255 .ops
= &clk_regmap_mux_ops
,
1256 .parent_data
= gxbb_32k_clk_parent_data
,
1258 .flags
= CLK_SET_RATE_PARENT
,
1262 static struct clk_regmap gxbb_32k_clk_div
= {
1263 .data
= &(struct clk_regmap_div_data
){
1264 .offset
= HHI_32K_CLK_CNTL
,
1268 .hw
.init
= &(struct clk_init_data
){
1269 .name
= "32k_clk_div",
1270 .ops
= &clk_regmap_divider_ops
,
1271 .parent_hws
= (const struct clk_hw
*[]) {
1272 &gxbb_32k_clk_sel
.hw
1275 .flags
= CLK_SET_RATE_PARENT
| CLK_DIVIDER_ROUND_CLOSEST
,
1279 static struct clk_regmap gxbb_32k_clk
= {
1280 .data
= &(struct clk_regmap_gate_data
){
1281 .offset
= HHI_32K_CLK_CNTL
,
1284 .hw
.init
= &(struct clk_init_data
){
1286 .ops
= &clk_regmap_gate_ops
,
1287 .parent_hws
= (const struct clk_hw
*[]) {
1288 &gxbb_32k_clk_div
.hw
1291 .flags
= CLK_SET_RATE_PARENT
,
1295 static const struct clk_parent_data gxbb_sd_emmc_clk0_parent_data
[] = {
1296 { .fw_name
= "xtal", },
1297 { .hw
= &gxbb_fclk_div2
.hw
},
1298 { .hw
= &gxbb_fclk_div3
.hw
},
1299 { .hw
= &gxbb_fclk_div5
.hw
},
1300 { .hw
= &gxbb_fclk_div7
.hw
},
1302 * Following these parent clocks, we should also have had mpll2, mpll3
1303 * and gp0_pll but these clocks are too precious to be used here. All
1304 * the necessary rates for MMC and NAND operation can be acheived using
1305 * xtal or fclk_div clocks
1310 static struct clk_regmap gxbb_sd_emmc_a_clk0_sel
= {
1311 .data
= &(struct clk_regmap_mux_data
){
1312 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1316 .hw
.init
= &(struct clk_init_data
) {
1317 .name
= "sd_emmc_a_clk0_sel",
1318 .ops
= &clk_regmap_mux_ops
,
1319 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1320 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1321 .flags
= CLK_SET_RATE_PARENT
,
1325 static struct clk_regmap gxbb_sd_emmc_a_clk0_div
= {
1326 .data
= &(struct clk_regmap_div_data
){
1327 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1330 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1332 .hw
.init
= &(struct clk_init_data
) {
1333 .name
= "sd_emmc_a_clk0_div",
1334 .ops
= &clk_regmap_divider_ops
,
1335 .parent_hws
= (const struct clk_hw
*[]) {
1336 &gxbb_sd_emmc_a_clk0_sel
.hw
1339 .flags
= CLK_SET_RATE_PARENT
,
1343 static struct clk_regmap gxbb_sd_emmc_a_clk0
= {
1344 .data
= &(struct clk_regmap_gate_data
){
1345 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1348 .hw
.init
= &(struct clk_init_data
){
1349 .name
= "sd_emmc_a_clk0",
1350 .ops
= &clk_regmap_gate_ops
,
1351 .parent_hws
= (const struct clk_hw
*[]) {
1352 &gxbb_sd_emmc_a_clk0_div
.hw
1355 .flags
= CLK_SET_RATE_PARENT
,
1360 static struct clk_regmap gxbb_sd_emmc_b_clk0_sel
= {
1361 .data
= &(struct clk_regmap_mux_data
){
1362 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1366 .hw
.init
= &(struct clk_init_data
) {
1367 .name
= "sd_emmc_b_clk0_sel",
1368 .ops
= &clk_regmap_mux_ops
,
1369 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1370 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1371 .flags
= CLK_SET_RATE_PARENT
,
1375 static struct clk_regmap gxbb_sd_emmc_b_clk0_div
= {
1376 .data
= &(struct clk_regmap_div_data
){
1377 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1380 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1382 .hw
.init
= &(struct clk_init_data
) {
1383 .name
= "sd_emmc_b_clk0_div",
1384 .ops
= &clk_regmap_divider_ops
,
1385 .parent_hws
= (const struct clk_hw
*[]) {
1386 &gxbb_sd_emmc_b_clk0_sel
.hw
1389 .flags
= CLK_SET_RATE_PARENT
,
1393 static struct clk_regmap gxbb_sd_emmc_b_clk0
= {
1394 .data
= &(struct clk_regmap_gate_data
){
1395 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1398 .hw
.init
= &(struct clk_init_data
){
1399 .name
= "sd_emmc_b_clk0",
1400 .ops
= &clk_regmap_gate_ops
,
1401 .parent_hws
= (const struct clk_hw
*[]) {
1402 &gxbb_sd_emmc_b_clk0_div
.hw
1405 .flags
= CLK_SET_RATE_PARENT
,
1409 /* EMMC/NAND clock */
1410 static struct clk_regmap gxbb_sd_emmc_c_clk0_sel
= {
1411 .data
= &(struct clk_regmap_mux_data
){
1412 .offset
= HHI_NAND_CLK_CNTL
,
1416 .hw
.init
= &(struct clk_init_data
) {
1417 .name
= "sd_emmc_c_clk0_sel",
1418 .ops
= &clk_regmap_mux_ops
,
1419 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1420 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1421 .flags
= CLK_SET_RATE_PARENT
,
1425 static struct clk_regmap gxbb_sd_emmc_c_clk0_div
= {
1426 .data
= &(struct clk_regmap_div_data
){
1427 .offset
= HHI_NAND_CLK_CNTL
,
1430 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1432 .hw
.init
= &(struct clk_init_data
) {
1433 .name
= "sd_emmc_c_clk0_div",
1434 .ops
= &clk_regmap_divider_ops
,
1435 .parent_hws
= (const struct clk_hw
*[]) {
1436 &gxbb_sd_emmc_c_clk0_sel
.hw
1439 .flags
= CLK_SET_RATE_PARENT
,
1443 static struct clk_regmap gxbb_sd_emmc_c_clk0
= {
1444 .data
= &(struct clk_regmap_gate_data
){
1445 .offset
= HHI_NAND_CLK_CNTL
,
1448 .hw
.init
= &(struct clk_init_data
){
1449 .name
= "sd_emmc_c_clk0",
1450 .ops
= &clk_regmap_gate_ops
,
1451 .parent_hws
= (const struct clk_hw
*[]) {
1452 &gxbb_sd_emmc_c_clk0_div
.hw
1455 .flags
= CLK_SET_RATE_PARENT
,
1461 static const struct clk_hw
*gxbb_vpu_parent_hws
[] = {
1468 static struct clk_regmap gxbb_vpu_0_sel
= {
1469 .data
= &(struct clk_regmap_mux_data
){
1470 .offset
= HHI_VPU_CLK_CNTL
,
1474 .hw
.init
= &(struct clk_init_data
){
1475 .name
= "vpu_0_sel",
1476 .ops
= &clk_regmap_mux_ops
,
1478 * bits 9:10 selects from 4 possible parents:
1479 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1481 .parent_hws
= gxbb_vpu_parent_hws
,
1482 .num_parents
= ARRAY_SIZE(gxbb_vpu_parent_hws
),
1483 .flags
= CLK_SET_RATE_NO_REPARENT
,
1487 static struct clk_regmap gxbb_vpu_0_div
= {
1488 .data
= &(struct clk_regmap_div_data
){
1489 .offset
= HHI_VPU_CLK_CNTL
,
1493 .hw
.init
= &(struct clk_init_data
){
1494 .name
= "vpu_0_div",
1495 .ops
= &clk_regmap_divider_ops
,
1496 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_0_sel
.hw
},
1498 .flags
= CLK_SET_RATE_PARENT
,
1502 static struct clk_regmap gxbb_vpu_0
= {
1503 .data
= &(struct clk_regmap_gate_data
){
1504 .offset
= HHI_VPU_CLK_CNTL
,
1507 .hw
.init
= &(struct clk_init_data
) {
1509 .ops
= &clk_regmap_gate_ops
,
1510 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_0_div
.hw
},
1512 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1516 static struct clk_regmap gxbb_vpu_1_sel
= {
1517 .data
= &(struct clk_regmap_mux_data
){
1518 .offset
= HHI_VPU_CLK_CNTL
,
1522 .hw
.init
= &(struct clk_init_data
){
1523 .name
= "vpu_1_sel",
1524 .ops
= &clk_regmap_mux_ops
,
1526 * bits 25:26 selects from 4 possible parents:
1527 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1529 .parent_hws
= gxbb_vpu_parent_hws
,
1530 .num_parents
= ARRAY_SIZE(gxbb_vpu_parent_hws
),
1531 .flags
= CLK_SET_RATE_NO_REPARENT
,
1535 static struct clk_regmap gxbb_vpu_1_div
= {
1536 .data
= &(struct clk_regmap_div_data
){
1537 .offset
= HHI_VPU_CLK_CNTL
,
1541 .hw
.init
= &(struct clk_init_data
){
1542 .name
= "vpu_1_div",
1543 .ops
= &clk_regmap_divider_ops
,
1544 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_1_sel
.hw
},
1546 .flags
= CLK_SET_RATE_PARENT
,
1550 static struct clk_regmap gxbb_vpu_1
= {
1551 .data
= &(struct clk_regmap_gate_data
){
1552 .offset
= HHI_VPU_CLK_CNTL
,
1555 .hw
.init
= &(struct clk_init_data
) {
1557 .ops
= &clk_regmap_gate_ops
,
1558 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_1_div
.hw
},
1560 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1564 static struct clk_regmap gxbb_vpu
= {
1565 .data
= &(struct clk_regmap_mux_data
){
1566 .offset
= HHI_VPU_CLK_CNTL
,
1570 .hw
.init
= &(struct clk_init_data
){
1572 .ops
= &clk_regmap_mux_ops
,
1574 * bit 31 selects from 2 possible parents:
1577 .parent_hws
= (const struct clk_hw
*[]) {
1582 .flags
= CLK_SET_RATE_NO_REPARENT
,
1588 static const struct clk_hw
*gxbb_vapb_parent_hws
[] = {
1595 static struct clk_regmap gxbb_vapb_0_sel
= {
1596 .data
= &(struct clk_regmap_mux_data
){
1597 .offset
= HHI_VAPBCLK_CNTL
,
1601 .hw
.init
= &(struct clk_init_data
){
1602 .name
= "vapb_0_sel",
1603 .ops
= &clk_regmap_mux_ops
,
1605 * bits 9:10 selects from 4 possible parents:
1606 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1608 .parent_hws
= gxbb_vapb_parent_hws
,
1609 .num_parents
= ARRAY_SIZE(gxbb_vapb_parent_hws
),
1610 .flags
= CLK_SET_RATE_NO_REPARENT
,
1614 static struct clk_regmap gxbb_vapb_0_div
= {
1615 .data
= &(struct clk_regmap_div_data
){
1616 .offset
= HHI_VAPBCLK_CNTL
,
1620 .hw
.init
= &(struct clk_init_data
){
1621 .name
= "vapb_0_div",
1622 .ops
= &clk_regmap_divider_ops
,
1623 .parent_hws
= (const struct clk_hw
*[]) {
1627 .flags
= CLK_SET_RATE_PARENT
,
1631 static struct clk_regmap gxbb_vapb_0
= {
1632 .data
= &(struct clk_regmap_gate_data
){
1633 .offset
= HHI_VAPBCLK_CNTL
,
1636 .hw
.init
= &(struct clk_init_data
) {
1638 .ops
= &clk_regmap_gate_ops
,
1639 .parent_hws
= (const struct clk_hw
*[]) {
1643 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1647 static struct clk_regmap gxbb_vapb_1_sel
= {
1648 .data
= &(struct clk_regmap_mux_data
){
1649 .offset
= HHI_VAPBCLK_CNTL
,
1653 .hw
.init
= &(struct clk_init_data
){
1654 .name
= "vapb_1_sel",
1655 .ops
= &clk_regmap_mux_ops
,
1657 * bits 25:26 selects from 4 possible parents:
1658 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1660 .parent_hws
= gxbb_vapb_parent_hws
,
1661 .num_parents
= ARRAY_SIZE(gxbb_vapb_parent_hws
),
1662 .flags
= CLK_SET_RATE_NO_REPARENT
,
1666 static struct clk_regmap gxbb_vapb_1_div
= {
1667 .data
= &(struct clk_regmap_div_data
){
1668 .offset
= HHI_VAPBCLK_CNTL
,
1672 .hw
.init
= &(struct clk_init_data
){
1673 .name
= "vapb_1_div",
1674 .ops
= &clk_regmap_divider_ops
,
1675 .parent_hws
= (const struct clk_hw
*[]) {
1679 .flags
= CLK_SET_RATE_PARENT
,
1683 static struct clk_regmap gxbb_vapb_1
= {
1684 .data
= &(struct clk_regmap_gate_data
){
1685 .offset
= HHI_VAPBCLK_CNTL
,
1688 .hw
.init
= &(struct clk_init_data
) {
1690 .ops
= &clk_regmap_gate_ops
,
1691 .parent_hws
= (const struct clk_hw
*[]) {
1695 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1699 static struct clk_regmap gxbb_vapb_sel
= {
1700 .data
= &(struct clk_regmap_mux_data
){
1701 .offset
= HHI_VAPBCLK_CNTL
,
1705 .hw
.init
= &(struct clk_init_data
){
1707 .ops
= &clk_regmap_mux_ops
,
1709 * bit 31 selects from 2 possible parents:
1712 .parent_hws
= (const struct clk_hw
*[]) {
1717 .flags
= CLK_SET_RATE_NO_REPARENT
,
1721 static struct clk_regmap gxbb_vapb
= {
1722 .data
= &(struct clk_regmap_gate_data
){
1723 .offset
= HHI_VAPBCLK_CNTL
,
1726 .hw
.init
= &(struct clk_init_data
) {
1728 .ops
= &clk_regmap_gate_ops
,
1729 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vapb_sel
.hw
},
1731 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1737 static struct clk_regmap gxbb_vid_pll_div
= {
1738 .data
= &(struct meson_vid_pll_div_data
){
1740 .reg_off
= HHI_VID_PLL_CLK_DIV
,
1745 .reg_off
= HHI_VID_PLL_CLK_DIV
,
1750 .hw
.init
= &(struct clk_init_data
) {
1751 .name
= "vid_pll_div",
1752 .ops
= &meson_vid_pll_div_ro_ops
,
1753 .parent_data
= &(const struct clk_parent_data
) {
1756 * GXL and GXBB have different hdmi_plls (with
1757 * different struct clk_hw). We fallback to the global
1758 * naming string mechanism so vid_pll_div picks up the
1765 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
1769 static const struct clk_parent_data gxbb_vid_pll_parent_data
[] = {
1770 { .hw
= &gxbb_vid_pll_div
.hw
},
1773 * GXL and GXBB have different hdmi_plls (with
1774 * different struct clk_hw). We fallback to the global
1775 * naming string mechanism so vid_pll_div picks up the
1778 { .name
= "hdmi_pll", .index
= -1 },
1781 static struct clk_regmap gxbb_vid_pll_sel
= {
1782 .data
= &(struct clk_regmap_mux_data
){
1783 .offset
= HHI_VID_PLL_CLK_DIV
,
1787 .hw
.init
= &(struct clk_init_data
){
1788 .name
= "vid_pll_sel",
1789 .ops
= &clk_regmap_mux_ops
,
1791 * bit 18 selects from 2 possible parents:
1792 * vid_pll_div or hdmi_pll
1794 .parent_data
= gxbb_vid_pll_parent_data
,
1795 .num_parents
= ARRAY_SIZE(gxbb_vid_pll_parent_data
),
1796 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1800 static struct clk_regmap gxbb_vid_pll
= {
1801 .data
= &(struct clk_regmap_gate_data
){
1802 .offset
= HHI_VID_PLL_CLK_DIV
,
1805 .hw
.init
= &(struct clk_init_data
) {
1807 .ops
= &clk_regmap_gate_ops
,
1808 .parent_hws
= (const struct clk_hw
*[]) {
1809 &gxbb_vid_pll_sel
.hw
1812 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1816 static const struct clk_hw
*gxbb_vclk_parent_hws
[] = {
1826 static struct clk_regmap gxbb_vclk_sel
= {
1827 .data
= &(struct clk_regmap_mux_data
){
1828 .offset
= HHI_VID_CLK_CNTL
,
1832 .hw
.init
= &(struct clk_init_data
){
1834 .ops
= &clk_regmap_mux_ops
,
1836 * bits 16:18 selects from 8 possible parents:
1837 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1838 * vid_pll, fclk_div7, mp1
1840 .parent_hws
= gxbb_vclk_parent_hws
,
1841 .num_parents
= ARRAY_SIZE(gxbb_vclk_parent_hws
),
1842 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1846 static struct clk_regmap gxbb_vclk2_sel
= {
1847 .data
= &(struct clk_regmap_mux_data
){
1848 .offset
= HHI_VIID_CLK_CNTL
,
1852 .hw
.init
= &(struct clk_init_data
){
1853 .name
= "vclk2_sel",
1854 .ops
= &clk_regmap_mux_ops
,
1856 * bits 16:18 selects from 8 possible parents:
1857 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1858 * vid_pll, fclk_div7, mp1
1860 .parent_hws
= gxbb_vclk_parent_hws
,
1861 .num_parents
= ARRAY_SIZE(gxbb_vclk_parent_hws
),
1862 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1866 static struct clk_regmap gxbb_vclk_input
= {
1867 .data
= &(struct clk_regmap_gate_data
){
1868 .offset
= HHI_VID_CLK_DIV
,
1871 .hw
.init
= &(struct clk_init_data
) {
1872 .name
= "vclk_input",
1873 .ops
= &clk_regmap_gate_ops
,
1874 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk_sel
.hw
},
1876 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1880 static struct clk_regmap gxbb_vclk2_input
= {
1881 .data
= &(struct clk_regmap_gate_data
){
1882 .offset
= HHI_VIID_CLK_DIV
,
1885 .hw
.init
= &(struct clk_init_data
) {
1886 .name
= "vclk2_input",
1887 .ops
= &clk_regmap_gate_ops
,
1888 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2_sel
.hw
},
1890 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1894 static struct clk_regmap gxbb_vclk_div
= {
1895 .data
= &(struct clk_regmap_div_data
){
1896 .offset
= HHI_VID_CLK_DIV
,
1900 .hw
.init
= &(struct clk_init_data
){
1902 .ops
= &clk_regmap_divider_ops
,
1903 .parent_hws
= (const struct clk_hw
*[]) {
1907 .flags
= CLK_GET_RATE_NOCACHE
,
1911 static struct clk_regmap gxbb_vclk2_div
= {
1912 .data
= &(struct clk_regmap_div_data
){
1913 .offset
= HHI_VIID_CLK_DIV
,
1917 .hw
.init
= &(struct clk_init_data
){
1918 .name
= "vclk2_div",
1919 .ops
= &clk_regmap_divider_ops
,
1920 .parent_hws
= (const struct clk_hw
*[]) {
1921 &gxbb_vclk2_input
.hw
1924 .flags
= CLK_GET_RATE_NOCACHE
,
1928 static struct clk_regmap gxbb_vclk
= {
1929 .data
= &(struct clk_regmap_gate_data
){
1930 .offset
= HHI_VID_CLK_CNTL
,
1933 .hw
.init
= &(struct clk_init_data
) {
1935 .ops
= &clk_regmap_gate_ops
,
1936 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk_div
.hw
},
1938 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1942 static struct clk_regmap gxbb_vclk2
= {
1943 .data
= &(struct clk_regmap_gate_data
){
1944 .offset
= HHI_VIID_CLK_CNTL
,
1947 .hw
.init
= &(struct clk_init_data
) {
1949 .ops
= &clk_regmap_gate_ops
,
1950 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2_div
.hw
},
1952 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1956 static struct clk_regmap gxbb_vclk_div1
= {
1957 .data
= &(struct clk_regmap_gate_data
){
1958 .offset
= HHI_VID_CLK_CNTL
,
1961 .hw
.init
= &(struct clk_init_data
) {
1962 .name
= "vclk_div1",
1963 .ops
= &clk_regmap_gate_ops
,
1964 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
1966 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1970 static struct clk_regmap gxbb_vclk_div2_en
= {
1971 .data
= &(struct clk_regmap_gate_data
){
1972 .offset
= HHI_VID_CLK_CNTL
,
1975 .hw
.init
= &(struct clk_init_data
) {
1976 .name
= "vclk_div2_en",
1977 .ops
= &clk_regmap_gate_ops
,
1978 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
1980 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1984 static struct clk_regmap gxbb_vclk_div4_en
= {
1985 .data
= &(struct clk_regmap_gate_data
){
1986 .offset
= HHI_VID_CLK_CNTL
,
1989 .hw
.init
= &(struct clk_init_data
) {
1990 .name
= "vclk_div4_en",
1991 .ops
= &clk_regmap_gate_ops
,
1992 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
1994 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1998 static struct clk_regmap gxbb_vclk_div6_en
= {
1999 .data
= &(struct clk_regmap_gate_data
){
2000 .offset
= HHI_VID_CLK_CNTL
,
2003 .hw
.init
= &(struct clk_init_data
) {
2004 .name
= "vclk_div6_en",
2005 .ops
= &clk_regmap_gate_ops
,
2006 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2008 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2012 static struct clk_regmap gxbb_vclk_div12_en
= {
2013 .data
= &(struct clk_regmap_gate_data
){
2014 .offset
= HHI_VID_CLK_CNTL
,
2017 .hw
.init
= &(struct clk_init_data
) {
2018 .name
= "vclk_div12_en",
2019 .ops
= &clk_regmap_gate_ops
,
2020 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2022 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2026 static struct clk_regmap gxbb_vclk2_div1
= {
2027 .data
= &(struct clk_regmap_gate_data
){
2028 .offset
= HHI_VIID_CLK_CNTL
,
2031 .hw
.init
= &(struct clk_init_data
) {
2032 .name
= "vclk2_div1",
2033 .ops
= &clk_regmap_gate_ops
,
2034 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2036 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2040 static struct clk_regmap gxbb_vclk2_div2_en
= {
2041 .data
= &(struct clk_regmap_gate_data
){
2042 .offset
= HHI_VIID_CLK_CNTL
,
2045 .hw
.init
= &(struct clk_init_data
) {
2046 .name
= "vclk2_div2_en",
2047 .ops
= &clk_regmap_gate_ops
,
2048 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2050 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2054 static struct clk_regmap gxbb_vclk2_div4_en
= {
2055 .data
= &(struct clk_regmap_gate_data
){
2056 .offset
= HHI_VIID_CLK_CNTL
,
2059 .hw
.init
= &(struct clk_init_data
) {
2060 .name
= "vclk2_div4_en",
2061 .ops
= &clk_regmap_gate_ops
,
2062 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2064 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2068 static struct clk_regmap gxbb_vclk2_div6_en
= {
2069 .data
= &(struct clk_regmap_gate_data
){
2070 .offset
= HHI_VIID_CLK_CNTL
,
2073 .hw
.init
= &(struct clk_init_data
) {
2074 .name
= "vclk2_div6_en",
2075 .ops
= &clk_regmap_gate_ops
,
2076 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2078 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2082 static struct clk_regmap gxbb_vclk2_div12_en
= {
2083 .data
= &(struct clk_regmap_gate_data
){
2084 .offset
= HHI_VIID_CLK_CNTL
,
2087 .hw
.init
= &(struct clk_init_data
) {
2088 .name
= "vclk2_div12_en",
2089 .ops
= &clk_regmap_gate_ops
,
2090 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2092 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2096 static struct clk_fixed_factor gxbb_vclk_div2
= {
2099 .hw
.init
= &(struct clk_init_data
){
2100 .name
= "vclk_div2",
2101 .ops
= &clk_fixed_factor_ops
,
2102 .parent_hws
= (const struct clk_hw
*[]) {
2103 &gxbb_vclk_div2_en
.hw
2109 static struct clk_fixed_factor gxbb_vclk_div4
= {
2112 .hw
.init
= &(struct clk_init_data
){
2113 .name
= "vclk_div4",
2114 .ops
= &clk_fixed_factor_ops
,
2115 .parent_hws
= (const struct clk_hw
*[]) {
2116 &gxbb_vclk_div4_en
.hw
2122 static struct clk_fixed_factor gxbb_vclk_div6
= {
2125 .hw
.init
= &(struct clk_init_data
){
2126 .name
= "vclk_div6",
2127 .ops
= &clk_fixed_factor_ops
,
2128 .parent_hws
= (const struct clk_hw
*[]) {
2129 &gxbb_vclk_div6_en
.hw
2135 static struct clk_fixed_factor gxbb_vclk_div12
= {
2138 .hw
.init
= &(struct clk_init_data
){
2139 .name
= "vclk_div12",
2140 .ops
= &clk_fixed_factor_ops
,
2141 .parent_hws
= (const struct clk_hw
*[]) {
2142 &gxbb_vclk_div12_en
.hw
2148 static struct clk_fixed_factor gxbb_vclk2_div2
= {
2151 .hw
.init
= &(struct clk_init_data
){
2152 .name
= "vclk2_div2",
2153 .ops
= &clk_fixed_factor_ops
,
2154 .parent_hws
= (const struct clk_hw
*[]) {
2155 &gxbb_vclk2_div2_en
.hw
2161 static struct clk_fixed_factor gxbb_vclk2_div4
= {
2164 .hw
.init
= &(struct clk_init_data
){
2165 .name
= "vclk2_div4",
2166 .ops
= &clk_fixed_factor_ops
,
2167 .parent_hws
= (const struct clk_hw
*[]) {
2168 &gxbb_vclk2_div4_en
.hw
2174 static struct clk_fixed_factor gxbb_vclk2_div6
= {
2177 .hw
.init
= &(struct clk_init_data
){
2178 .name
= "vclk2_div6",
2179 .ops
= &clk_fixed_factor_ops
,
2180 .parent_hws
= (const struct clk_hw
*[]) {
2181 &gxbb_vclk2_div6_en
.hw
2187 static struct clk_fixed_factor gxbb_vclk2_div12
= {
2190 .hw
.init
= &(struct clk_init_data
){
2191 .name
= "vclk2_div12",
2192 .ops
= &clk_fixed_factor_ops
,
2193 .parent_hws
= (const struct clk_hw
*[]) {
2194 &gxbb_vclk2_div12_en
.hw
2200 static u32 mux_table_cts_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2201 static const struct clk_hw
*gxbb_cts_parent_hws
[] = {
2206 &gxbb_vclk_div12
.hw
,
2207 &gxbb_vclk2_div1
.hw
,
2208 &gxbb_vclk2_div2
.hw
,
2209 &gxbb_vclk2_div4
.hw
,
2210 &gxbb_vclk2_div6
.hw
,
2211 &gxbb_vclk2_div12
.hw
,
2214 static struct clk_regmap gxbb_cts_enci_sel
= {
2215 .data
= &(struct clk_regmap_mux_data
){
2216 .offset
= HHI_VID_CLK_DIV
,
2219 .table
= mux_table_cts_sel
,
2221 .hw
.init
= &(struct clk_init_data
){
2222 .name
= "cts_enci_sel",
2223 .ops
= &clk_regmap_mux_ops
,
2224 .parent_hws
= gxbb_cts_parent_hws
,
2225 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2226 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2230 static struct clk_regmap gxbb_cts_encp_sel
= {
2231 .data
= &(struct clk_regmap_mux_data
){
2232 .offset
= HHI_VID_CLK_DIV
,
2235 .table
= mux_table_cts_sel
,
2237 .hw
.init
= &(struct clk_init_data
){
2238 .name
= "cts_encp_sel",
2239 .ops
= &clk_regmap_mux_ops
,
2240 .parent_hws
= gxbb_cts_parent_hws
,
2241 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2242 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2246 static struct clk_regmap gxbb_cts_vdac_sel
= {
2247 .data
= &(struct clk_regmap_mux_data
){
2248 .offset
= HHI_VIID_CLK_DIV
,
2251 .table
= mux_table_cts_sel
,
2253 .hw
.init
= &(struct clk_init_data
){
2254 .name
= "cts_vdac_sel",
2255 .ops
= &clk_regmap_mux_ops
,
2256 .parent_hws
= gxbb_cts_parent_hws
,
2257 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2258 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2262 /* TOFIX: add support for cts_tcon */
2263 static u32 mux_table_hdmi_tx_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2264 static const struct clk_hw
*gxbb_cts_hdmi_tx_parent_hws
[] = {
2269 &gxbb_vclk_div12
.hw
,
2270 &gxbb_vclk2_div1
.hw
,
2271 &gxbb_vclk2_div2
.hw
,
2272 &gxbb_vclk2_div4
.hw
,
2273 &gxbb_vclk2_div6
.hw
,
2274 &gxbb_vclk2_div12
.hw
,
2277 static struct clk_regmap gxbb_hdmi_tx_sel
= {
2278 .data
= &(struct clk_regmap_mux_data
){
2279 .offset
= HHI_HDMI_CLK_CNTL
,
2282 .table
= mux_table_hdmi_tx_sel
,
2284 .hw
.init
= &(struct clk_init_data
){
2285 .name
= "hdmi_tx_sel",
2286 .ops
= &clk_regmap_mux_ops
,
2288 * bits 31:28 selects from 12 possible parents:
2289 * vclk_div1, vclk_div2, vclk_div4, vclk_div6, vclk_div12
2290 * vclk2_div1, vclk2_div2, vclk2_div4, vclk2_div6, vclk2_div12,
2293 .parent_hws
= gxbb_cts_hdmi_tx_parent_hws
,
2294 .num_parents
= ARRAY_SIZE(gxbb_cts_hdmi_tx_parent_hws
),
2295 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2299 static struct clk_regmap gxbb_cts_enci
= {
2300 .data
= &(struct clk_regmap_gate_data
){
2301 .offset
= HHI_VID_CLK_CNTL2
,
2304 .hw
.init
= &(struct clk_init_data
) {
2306 .ops
= &clk_regmap_gate_ops
,
2307 .parent_hws
= (const struct clk_hw
*[]) {
2308 &gxbb_cts_enci_sel
.hw
2311 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2315 static struct clk_regmap gxbb_cts_encp
= {
2316 .data
= &(struct clk_regmap_gate_data
){
2317 .offset
= HHI_VID_CLK_CNTL2
,
2320 .hw
.init
= &(struct clk_init_data
) {
2322 .ops
= &clk_regmap_gate_ops
,
2323 .parent_hws
= (const struct clk_hw
*[]) {
2324 &gxbb_cts_encp_sel
.hw
2327 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2331 static struct clk_regmap gxbb_cts_vdac
= {
2332 .data
= &(struct clk_regmap_gate_data
){
2333 .offset
= HHI_VID_CLK_CNTL2
,
2336 .hw
.init
= &(struct clk_init_data
) {
2338 .ops
= &clk_regmap_gate_ops
,
2339 .parent_hws
= (const struct clk_hw
*[]) {
2340 &gxbb_cts_vdac_sel
.hw
2343 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2347 static struct clk_regmap gxbb_hdmi_tx
= {
2348 .data
= &(struct clk_regmap_gate_data
){
2349 .offset
= HHI_VID_CLK_CNTL2
,
2352 .hw
.init
= &(struct clk_init_data
) {
2354 .ops
= &clk_regmap_gate_ops
,
2355 .parent_hws
= (const struct clk_hw
*[]) {
2356 &gxbb_hdmi_tx_sel
.hw
2359 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2365 static const struct clk_parent_data gxbb_hdmi_parent_data
[] = {
2366 { .fw_name
= "xtal", },
2367 { .hw
= &gxbb_fclk_div4
.hw
},
2368 { .hw
= &gxbb_fclk_div3
.hw
},
2369 { .hw
= &gxbb_fclk_div5
.hw
},
2372 static struct clk_regmap gxbb_hdmi_sel
= {
2373 .data
= &(struct clk_regmap_mux_data
){
2374 .offset
= HHI_HDMI_CLK_CNTL
,
2377 .flags
= CLK_MUX_ROUND_CLOSEST
,
2379 .hw
.init
= &(struct clk_init_data
){
2381 .ops
= &clk_regmap_mux_ops
,
2382 .parent_data
= gxbb_hdmi_parent_data
,
2383 .num_parents
= ARRAY_SIZE(gxbb_hdmi_parent_data
),
2384 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2388 static struct clk_regmap gxbb_hdmi_div
= {
2389 .data
= &(struct clk_regmap_div_data
){
2390 .offset
= HHI_HDMI_CLK_CNTL
,
2394 .hw
.init
= &(struct clk_init_data
){
2396 .ops
= &clk_regmap_divider_ops
,
2397 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_hdmi_sel
.hw
},
2399 .flags
= CLK_GET_RATE_NOCACHE
,
2403 static struct clk_regmap gxbb_hdmi
= {
2404 .data
= &(struct clk_regmap_gate_data
){
2405 .offset
= HHI_HDMI_CLK_CNTL
,
2408 .hw
.init
= &(struct clk_init_data
) {
2410 .ops
= &clk_regmap_gate_ops
,
2411 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_hdmi_div
.hw
},
2413 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2419 static const struct clk_hw
*gxbb_vdec_parent_hws
[] = {
2426 static struct clk_regmap gxbb_vdec_1_sel
= {
2427 .data
= &(struct clk_regmap_mux_data
){
2428 .offset
= HHI_VDEC_CLK_CNTL
,
2431 .flags
= CLK_MUX_ROUND_CLOSEST
,
2433 .hw
.init
= &(struct clk_init_data
){
2434 .name
= "vdec_1_sel",
2435 .ops
= &clk_regmap_mux_ops
,
2436 .parent_hws
= gxbb_vdec_parent_hws
,
2437 .num_parents
= ARRAY_SIZE(gxbb_vdec_parent_hws
),
2438 .flags
= CLK_SET_RATE_PARENT
,
2442 static struct clk_regmap gxbb_vdec_1_div
= {
2443 .data
= &(struct clk_regmap_div_data
){
2444 .offset
= HHI_VDEC_CLK_CNTL
,
2447 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2449 .hw
.init
= &(struct clk_init_data
){
2450 .name
= "vdec_1_div",
2451 .ops
= &clk_regmap_divider_ops
,
2452 .parent_hws
= (const struct clk_hw
*[]) {
2456 .flags
= CLK_SET_RATE_PARENT
,
2460 static struct clk_regmap gxbb_vdec_1
= {
2461 .data
= &(struct clk_regmap_gate_data
){
2462 .offset
= HHI_VDEC_CLK_CNTL
,
2465 .hw
.init
= &(struct clk_init_data
) {
2467 .ops
= &clk_regmap_gate_ops
,
2468 .parent_hws
= (const struct clk_hw
*[]) {
2472 .flags
= CLK_SET_RATE_PARENT
,
2476 static struct clk_regmap gxbb_vdec_hevc_sel
= {
2477 .data
= &(struct clk_regmap_mux_data
){
2478 .offset
= HHI_VDEC2_CLK_CNTL
,
2481 .flags
= CLK_MUX_ROUND_CLOSEST
,
2483 .hw
.init
= &(struct clk_init_data
){
2484 .name
= "vdec_hevc_sel",
2485 .ops
= &clk_regmap_mux_ops
,
2486 .parent_hws
= gxbb_vdec_parent_hws
,
2487 .num_parents
= ARRAY_SIZE(gxbb_vdec_parent_hws
),
2488 .flags
= CLK_SET_RATE_PARENT
,
2492 static struct clk_regmap gxbb_vdec_hevc_div
= {
2493 .data
= &(struct clk_regmap_div_data
){
2494 .offset
= HHI_VDEC2_CLK_CNTL
,
2497 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2499 .hw
.init
= &(struct clk_init_data
){
2500 .name
= "vdec_hevc_div",
2501 .ops
= &clk_regmap_divider_ops
,
2502 .parent_hws
= (const struct clk_hw
*[]) {
2503 &gxbb_vdec_hevc_sel
.hw
2506 .flags
= CLK_SET_RATE_PARENT
,
2510 static struct clk_regmap gxbb_vdec_hevc
= {
2511 .data
= &(struct clk_regmap_gate_data
){
2512 .offset
= HHI_VDEC2_CLK_CNTL
,
2515 .hw
.init
= &(struct clk_init_data
) {
2516 .name
= "vdec_hevc",
2517 .ops
= &clk_regmap_gate_ops
,
2518 .parent_hws
= (const struct clk_hw
*[]) {
2519 &gxbb_vdec_hevc_div
.hw
2522 .flags
= CLK_SET_RATE_PARENT
,
2526 static u32 mux_table_gen_clk
[] = { 0, 4, 5, 6, 7, 8,
2527 9, 10, 11, 13, 14, };
2528 static const struct clk_parent_data gen_clk_parent_data
[] = {
2529 { .fw_name
= "xtal", },
2530 { .hw
= &gxbb_vdec_1
.hw
},
2531 { .hw
= &gxbb_vdec_hevc
.hw
},
2532 { .hw
= &gxbb_mpll0
.hw
},
2533 { .hw
= &gxbb_mpll1
.hw
},
2534 { .hw
= &gxbb_mpll2
.hw
},
2535 { .hw
= &gxbb_fclk_div4
.hw
},
2536 { .hw
= &gxbb_fclk_div3
.hw
},
2537 { .hw
= &gxbb_fclk_div5
.hw
},
2538 { .hw
= &gxbb_fclk_div7
.hw
},
2539 { .hw
= &gxbb_gp0_pll
.hw
},
2542 static struct clk_regmap gxbb_gen_clk_sel
= {
2543 .data
= &(struct clk_regmap_mux_data
){
2544 .offset
= HHI_GEN_CLK_CNTL
,
2547 .table
= mux_table_gen_clk
,
2549 .hw
.init
= &(struct clk_init_data
){
2550 .name
= "gen_clk_sel",
2551 .ops
= &clk_regmap_mux_ops
,
2553 * bits 15:12 selects from 14 possible parents:
2554 * xtal, [rtc_oscin_i], [sys_cpu_div16], [ddr_dpll_pt],
2555 * vid_pll, vid2_pll (hevc), mpll0, mpll1, mpll2, fdiv4,
2556 * fdiv3, fdiv5, [cts_msr_clk], fdiv7, gp0_pll
2558 .parent_data
= gen_clk_parent_data
,
2559 .num_parents
= ARRAY_SIZE(gen_clk_parent_data
),
2563 static struct clk_regmap gxbb_gen_clk_div
= {
2564 .data
= &(struct clk_regmap_div_data
){
2565 .offset
= HHI_GEN_CLK_CNTL
,
2569 .hw
.init
= &(struct clk_init_data
){
2570 .name
= "gen_clk_div",
2571 .ops
= &clk_regmap_divider_ops
,
2572 .parent_hws
= (const struct clk_hw
*[]) {
2573 &gxbb_gen_clk_sel
.hw
2576 .flags
= CLK_SET_RATE_PARENT
,
2580 static struct clk_regmap gxbb_gen_clk
= {
2581 .data
= &(struct clk_regmap_gate_data
){
2582 .offset
= HHI_GEN_CLK_CNTL
,
2585 .hw
.init
= &(struct clk_init_data
){
2587 .ops
= &clk_regmap_gate_ops
,
2588 .parent_hws
= (const struct clk_hw
*[]) {
2589 &gxbb_gen_clk_div
.hw
2592 .flags
= CLK_SET_RATE_PARENT
,
2596 #define MESON_GATE(_name, _reg, _bit) \
2597 MESON_PCLK(_name, _reg, _bit, &gxbb_clk81.hw)
2599 /* Everything Else (EE) domain gates */
2600 static MESON_GATE(gxbb_ddr
, HHI_GCLK_MPEG0
, 0);
2601 static MESON_GATE(gxbb_dos
, HHI_GCLK_MPEG0
, 1);
2602 static MESON_GATE(gxbb_isa
, HHI_GCLK_MPEG0
, 5);
2603 static MESON_GATE(gxbb_pl301
, HHI_GCLK_MPEG0
, 6);
2604 static MESON_GATE(gxbb_periphs
, HHI_GCLK_MPEG0
, 7);
2605 static MESON_GATE(gxbb_spicc
, HHI_GCLK_MPEG0
, 8);
2606 static MESON_GATE(gxbb_i2c
, HHI_GCLK_MPEG0
, 9);
2607 static MESON_GATE(gxbb_sana
, HHI_GCLK_MPEG0
, 10);
2608 static MESON_GATE(gxbb_smart_card
, HHI_GCLK_MPEG0
, 11);
2609 static MESON_GATE(gxbb_rng0
, HHI_GCLK_MPEG0
, 12);
2610 static MESON_GATE(gxbb_uart0
, HHI_GCLK_MPEG0
, 13);
2611 static MESON_GATE(gxbb_sdhc
, HHI_GCLK_MPEG0
, 14);
2612 static MESON_GATE(gxbb_stream
, HHI_GCLK_MPEG0
, 15);
2613 static MESON_GATE(gxbb_async_fifo
, HHI_GCLK_MPEG0
, 16);
2614 static MESON_GATE(gxbb_sdio
, HHI_GCLK_MPEG0
, 17);
2615 static MESON_GATE(gxbb_abuf
, HHI_GCLK_MPEG0
, 18);
2616 static MESON_GATE(gxbb_hiu_iface
, HHI_GCLK_MPEG0
, 19);
2617 static MESON_GATE(gxbb_assist_misc
, HHI_GCLK_MPEG0
, 23);
2618 static MESON_GATE(gxbb_emmc_a
, HHI_GCLK_MPEG0
, 24);
2619 static MESON_GATE(gxbb_emmc_b
, HHI_GCLK_MPEG0
, 25);
2620 static MESON_GATE(gxbb_emmc_c
, HHI_GCLK_MPEG0
, 26);
2621 static MESON_GATE(gxl_acodec
, HHI_GCLK_MPEG0
, 28);
2622 static MESON_GATE(gxbb_spi
, HHI_GCLK_MPEG0
, 30);
2624 static MESON_GATE(gxbb_i2s_spdif
, HHI_GCLK_MPEG1
, 2);
2625 static MESON_GATE(gxbb_eth
, HHI_GCLK_MPEG1
, 3);
2626 static MESON_GATE(gxbb_demux
, HHI_GCLK_MPEG1
, 4);
2627 static MESON_GATE(gxbb_blkmv
, HHI_GCLK_MPEG1
, 14);
2628 static MESON_GATE(gxbb_aiu
, HHI_GCLK_MPEG1
, 15);
2629 static MESON_GATE(gxbb_uart1
, HHI_GCLK_MPEG1
, 16);
2630 static MESON_GATE(gxbb_g2d
, HHI_GCLK_MPEG1
, 20);
2631 static MESON_GATE(gxbb_usb0
, HHI_GCLK_MPEG1
, 21);
2632 static MESON_GATE(gxbb_usb1
, HHI_GCLK_MPEG1
, 22);
2633 static MESON_GATE(gxbb_reset
, HHI_GCLK_MPEG1
, 23);
2634 static MESON_GATE(gxbb_nand
, HHI_GCLK_MPEG1
, 24);
2635 static MESON_GATE(gxbb_dos_parser
, HHI_GCLK_MPEG1
, 25);
2636 static MESON_GATE(gxbb_usb
, HHI_GCLK_MPEG1
, 26);
2637 static MESON_GATE(gxbb_vdin1
, HHI_GCLK_MPEG1
, 28);
2638 static MESON_GATE(gxbb_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
2639 static MESON_GATE(gxbb_efuse
, HHI_GCLK_MPEG1
, 30);
2640 static MESON_GATE(gxbb_boot_rom
, HHI_GCLK_MPEG1
, 31);
2642 static MESON_GATE(gxbb_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
2643 static MESON_GATE(gxbb_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
2644 static MESON_GATE(gxbb_hdmi_intr_sync
, HHI_GCLK_MPEG2
, 3);
2645 static MESON_GATE(gxbb_hdmi_pclk
, HHI_GCLK_MPEG2
, 4);
2646 static MESON_GATE(gxbb_usb1_ddr_bridge
, HHI_GCLK_MPEG2
, 8);
2647 static MESON_GATE(gxbb_usb0_ddr_bridge
, HHI_GCLK_MPEG2
, 9);
2648 static MESON_GATE(gxbb_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
2649 static MESON_GATE(gxbb_dvin
, HHI_GCLK_MPEG2
, 12);
2650 static MESON_GATE(gxbb_uart2
, HHI_GCLK_MPEG2
, 15);
2651 static MESON_GATE(gxbb_sar_adc
, HHI_GCLK_MPEG2
, 22);
2652 static MESON_GATE(gxbb_vpu_intr
, HHI_GCLK_MPEG2
, 25);
2653 static MESON_GATE(gxbb_sec_ahb_ahb3_bridge
, HHI_GCLK_MPEG2
, 26);
2654 static MESON_GATE(gxbb_clk81_a53
, HHI_GCLK_MPEG2
, 29);
2656 static MESON_GATE(gxbb_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
2657 static MESON_GATE(gxbb_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
2658 static MESON_GATE(gxbb_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
2659 static MESON_GATE(gxbb_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
2660 static MESON_GATE(gxbb_gclk_venci_int0
, HHI_GCLK_OTHER
, 8);
2661 static MESON_GATE(gxbb_gclk_vencp_int
, HHI_GCLK_OTHER
, 9);
2662 static MESON_GATE(gxbb_dac_clk
, HHI_GCLK_OTHER
, 10);
2663 static MESON_GATE(gxbb_aoclk_gate
, HHI_GCLK_OTHER
, 14);
2664 static MESON_GATE(gxbb_iec958_gate
, HHI_GCLK_OTHER
, 16);
2665 static MESON_GATE(gxbb_enc480p
, HHI_GCLK_OTHER
, 20);
2666 static MESON_GATE(gxbb_rng1
, HHI_GCLK_OTHER
, 21);
2667 static MESON_GATE(gxbb_gclk_venci_int1
, HHI_GCLK_OTHER
, 22);
2668 static MESON_GATE(gxbb_vclk2_venclmcc
, HHI_GCLK_OTHER
, 24);
2669 static MESON_GATE(gxbb_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
2670 static MESON_GATE(gxbb_vclk_other
, HHI_GCLK_OTHER
, 26);
2671 static MESON_GATE(gxbb_edp
, HHI_GCLK_OTHER
, 31);
2673 /* Always On (AO) domain gates */
2675 static MESON_GATE(gxbb_ao_media_cpu
, HHI_GCLK_AO
, 0);
2676 static MESON_GATE(gxbb_ao_ahb_sram
, HHI_GCLK_AO
, 1);
2677 static MESON_GATE(gxbb_ao_ahb_bus
, HHI_GCLK_AO
, 2);
2678 static MESON_GATE(gxbb_ao_iface
, HHI_GCLK_AO
, 3);
2679 static MESON_GATE(gxbb_ao_i2c
, HHI_GCLK_AO
, 4);
2682 static MESON_PCLK(gxbb_aiu_glue
, HHI_GCLK_MPEG1
, 6, &gxbb_aiu
.hw
);
2683 static MESON_PCLK(gxbb_iec958
, HHI_GCLK_MPEG1
, 7, &gxbb_aiu_glue
.hw
);
2684 static MESON_PCLK(gxbb_i2s_out
, HHI_GCLK_MPEG1
, 8, &gxbb_aiu_glue
.hw
);
2685 static MESON_PCLK(gxbb_amclk
, HHI_GCLK_MPEG1
, 9, &gxbb_aiu_glue
.hw
);
2686 static MESON_PCLK(gxbb_aififo2
, HHI_GCLK_MPEG1
, 10, &gxbb_aiu_glue
.hw
);
2687 static MESON_PCLK(gxbb_mixer
, HHI_GCLK_MPEG1
, 11, &gxbb_aiu_glue
.hw
);
2688 static MESON_PCLK(gxbb_mixer_iface
, HHI_GCLK_MPEG1
, 12, &gxbb_aiu_glue
.hw
);
2689 static MESON_PCLK(gxbb_adc
, HHI_GCLK_MPEG1
, 13, &gxbb_aiu_glue
.hw
);
2691 /* Array of all clocks provided by this provider */
2693 static struct clk_hw_onecell_data gxbb_hw_onecell_data
= {
2695 [CLKID_SYS_PLL
] = &gxbb_sys_pll
.hw
,
2696 [CLKID_HDMI_PLL
] = &gxbb_hdmi_pll
.hw
,
2697 [CLKID_FIXED_PLL
] = &gxbb_fixed_pll
.hw
,
2698 [CLKID_FCLK_DIV2
] = &gxbb_fclk_div2
.hw
,
2699 [CLKID_FCLK_DIV3
] = &gxbb_fclk_div3
.hw
,
2700 [CLKID_FCLK_DIV4
] = &gxbb_fclk_div4
.hw
,
2701 [CLKID_FCLK_DIV5
] = &gxbb_fclk_div5
.hw
,
2702 [CLKID_FCLK_DIV7
] = &gxbb_fclk_div7
.hw
,
2703 [CLKID_GP0_PLL
] = &gxbb_gp0_pll
.hw
,
2704 [CLKID_MPEG_SEL
] = &gxbb_mpeg_clk_sel
.hw
,
2705 [CLKID_MPEG_DIV
] = &gxbb_mpeg_clk_div
.hw
,
2706 [CLKID_CLK81
] = &gxbb_clk81
.hw
,
2707 [CLKID_MPLL0
] = &gxbb_mpll0
.hw
,
2708 [CLKID_MPLL1
] = &gxbb_mpll1
.hw
,
2709 [CLKID_MPLL2
] = &gxbb_mpll2
.hw
,
2710 [CLKID_DDR
] = &gxbb_ddr
.hw
,
2711 [CLKID_DOS
] = &gxbb_dos
.hw
,
2712 [CLKID_ISA
] = &gxbb_isa
.hw
,
2713 [CLKID_PL301
] = &gxbb_pl301
.hw
,
2714 [CLKID_PERIPHS
] = &gxbb_periphs
.hw
,
2715 [CLKID_SPICC
] = &gxbb_spicc
.hw
,
2716 [CLKID_I2C
] = &gxbb_i2c
.hw
,
2717 [CLKID_SAR_ADC
] = &gxbb_sar_adc
.hw
,
2718 [CLKID_SMART_CARD
] = &gxbb_smart_card
.hw
,
2719 [CLKID_RNG0
] = &gxbb_rng0
.hw
,
2720 [CLKID_UART0
] = &gxbb_uart0
.hw
,
2721 [CLKID_SDHC
] = &gxbb_sdhc
.hw
,
2722 [CLKID_STREAM
] = &gxbb_stream
.hw
,
2723 [CLKID_ASYNC_FIFO
] = &gxbb_async_fifo
.hw
,
2724 [CLKID_SDIO
] = &gxbb_sdio
.hw
,
2725 [CLKID_ABUF
] = &gxbb_abuf
.hw
,
2726 [CLKID_HIU_IFACE
] = &gxbb_hiu_iface
.hw
,
2727 [CLKID_ASSIST_MISC
] = &gxbb_assist_misc
.hw
,
2728 [CLKID_SPI
] = &gxbb_spi
.hw
,
2729 [CLKID_I2S_SPDIF
] = &gxbb_i2s_spdif
.hw
,
2730 [CLKID_ETH
] = &gxbb_eth
.hw
,
2731 [CLKID_DEMUX
] = &gxbb_demux
.hw
,
2732 [CLKID_AIU_GLUE
] = &gxbb_aiu_glue
.hw
,
2733 [CLKID_IEC958
] = &gxbb_iec958
.hw
,
2734 [CLKID_I2S_OUT
] = &gxbb_i2s_out
.hw
,
2735 [CLKID_AMCLK
] = &gxbb_amclk
.hw
,
2736 [CLKID_AIFIFO2
] = &gxbb_aififo2
.hw
,
2737 [CLKID_MIXER
] = &gxbb_mixer
.hw
,
2738 [CLKID_MIXER_IFACE
] = &gxbb_mixer_iface
.hw
,
2739 [CLKID_ADC
] = &gxbb_adc
.hw
,
2740 [CLKID_BLKMV
] = &gxbb_blkmv
.hw
,
2741 [CLKID_AIU
] = &gxbb_aiu
.hw
,
2742 [CLKID_UART1
] = &gxbb_uart1
.hw
,
2743 [CLKID_G2D
] = &gxbb_g2d
.hw
,
2744 [CLKID_USB0
] = &gxbb_usb0
.hw
,
2745 [CLKID_USB1
] = &gxbb_usb1
.hw
,
2746 [CLKID_RESET
] = &gxbb_reset
.hw
,
2747 [CLKID_NAND
] = &gxbb_nand
.hw
,
2748 [CLKID_DOS_PARSER
] = &gxbb_dos_parser
.hw
,
2749 [CLKID_USB
] = &gxbb_usb
.hw
,
2750 [CLKID_VDIN1
] = &gxbb_vdin1
.hw
,
2751 [CLKID_AHB_ARB0
] = &gxbb_ahb_arb0
.hw
,
2752 [CLKID_EFUSE
] = &gxbb_efuse
.hw
,
2753 [CLKID_BOOT_ROM
] = &gxbb_boot_rom
.hw
,
2754 [CLKID_AHB_DATA_BUS
] = &gxbb_ahb_data_bus
.hw
,
2755 [CLKID_AHB_CTRL_BUS
] = &gxbb_ahb_ctrl_bus
.hw
,
2756 [CLKID_HDMI_INTR_SYNC
] = &gxbb_hdmi_intr_sync
.hw
,
2757 [CLKID_HDMI_PCLK
] = &gxbb_hdmi_pclk
.hw
,
2758 [CLKID_USB1_DDR_BRIDGE
] = &gxbb_usb1_ddr_bridge
.hw
,
2759 [CLKID_USB0_DDR_BRIDGE
] = &gxbb_usb0_ddr_bridge
.hw
,
2760 [CLKID_MMC_PCLK
] = &gxbb_mmc_pclk
.hw
,
2761 [CLKID_DVIN
] = &gxbb_dvin
.hw
,
2762 [CLKID_UART2
] = &gxbb_uart2
.hw
,
2763 [CLKID_SANA
] = &gxbb_sana
.hw
,
2764 [CLKID_VPU_INTR
] = &gxbb_vpu_intr
.hw
,
2765 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &gxbb_sec_ahb_ahb3_bridge
.hw
,
2766 [CLKID_CLK81_A53
] = &gxbb_clk81_a53
.hw
,
2767 [CLKID_VCLK2_VENCI0
] = &gxbb_vclk2_venci0
.hw
,
2768 [CLKID_VCLK2_VENCI1
] = &gxbb_vclk2_venci1
.hw
,
2769 [CLKID_VCLK2_VENCP0
] = &gxbb_vclk2_vencp0
.hw
,
2770 [CLKID_VCLK2_VENCP1
] = &gxbb_vclk2_vencp1
.hw
,
2771 [CLKID_GCLK_VENCI_INT0
] = &gxbb_gclk_venci_int0
.hw
,
2772 [CLKID_GCLK_VENCI_INT
] = &gxbb_gclk_vencp_int
.hw
,
2773 [CLKID_DAC_CLK
] = &gxbb_dac_clk
.hw
,
2774 [CLKID_AOCLK_GATE
] = &gxbb_aoclk_gate
.hw
,
2775 [CLKID_IEC958_GATE
] = &gxbb_iec958_gate
.hw
,
2776 [CLKID_ENC480P
] = &gxbb_enc480p
.hw
,
2777 [CLKID_RNG1
] = &gxbb_rng1
.hw
,
2778 [CLKID_GCLK_VENCI_INT1
] = &gxbb_gclk_venci_int1
.hw
,
2779 [CLKID_VCLK2_VENCLMCC
] = &gxbb_vclk2_venclmcc
.hw
,
2780 [CLKID_VCLK2_VENCL
] = &gxbb_vclk2_vencl
.hw
,
2781 [CLKID_VCLK_OTHER
] = &gxbb_vclk_other
.hw
,
2782 [CLKID_EDP
] = &gxbb_edp
.hw
,
2783 [CLKID_AO_MEDIA_CPU
] = &gxbb_ao_media_cpu
.hw
,
2784 [CLKID_AO_AHB_SRAM
] = &gxbb_ao_ahb_sram
.hw
,
2785 [CLKID_AO_AHB_BUS
] = &gxbb_ao_ahb_bus
.hw
,
2786 [CLKID_AO_IFACE
] = &gxbb_ao_iface
.hw
,
2787 [CLKID_AO_I2C
] = &gxbb_ao_i2c
.hw
,
2788 [CLKID_SD_EMMC_A
] = &gxbb_emmc_a
.hw
,
2789 [CLKID_SD_EMMC_B
] = &gxbb_emmc_b
.hw
,
2790 [CLKID_SD_EMMC_C
] = &gxbb_emmc_c
.hw
,
2791 [CLKID_SAR_ADC_CLK
] = &gxbb_sar_adc_clk
.hw
,
2792 [CLKID_SAR_ADC_SEL
] = &gxbb_sar_adc_clk_sel
.hw
,
2793 [CLKID_SAR_ADC_DIV
] = &gxbb_sar_adc_clk_div
.hw
,
2794 [CLKID_MALI_0_SEL
] = &gxbb_mali_0_sel
.hw
,
2795 [CLKID_MALI_0_DIV
] = &gxbb_mali_0_div
.hw
,
2796 [CLKID_MALI_0
] = &gxbb_mali_0
.hw
,
2797 [CLKID_MALI_1_SEL
] = &gxbb_mali_1_sel
.hw
,
2798 [CLKID_MALI_1_DIV
] = &gxbb_mali_1_div
.hw
,
2799 [CLKID_MALI_1
] = &gxbb_mali_1
.hw
,
2800 [CLKID_MALI
] = &gxbb_mali
.hw
,
2801 [CLKID_CTS_AMCLK
] = &gxbb_cts_amclk
.hw
,
2802 [CLKID_CTS_AMCLK_SEL
] = &gxbb_cts_amclk_sel
.hw
,
2803 [CLKID_CTS_AMCLK_DIV
] = &gxbb_cts_amclk_div
.hw
,
2804 [CLKID_CTS_MCLK_I958
] = &gxbb_cts_mclk_i958
.hw
,
2805 [CLKID_CTS_MCLK_I958_SEL
] = &gxbb_cts_mclk_i958_sel
.hw
,
2806 [CLKID_CTS_MCLK_I958_DIV
] = &gxbb_cts_mclk_i958_div
.hw
,
2807 [CLKID_CTS_I958
] = &gxbb_cts_i958
.hw
,
2808 [CLKID_32K_CLK
] = &gxbb_32k_clk
.hw
,
2809 [CLKID_32K_CLK_SEL
] = &gxbb_32k_clk_sel
.hw
,
2810 [CLKID_32K_CLK_DIV
] = &gxbb_32k_clk_div
.hw
,
2811 [CLKID_SD_EMMC_A_CLK0_SEL
] = &gxbb_sd_emmc_a_clk0_sel
.hw
,
2812 [CLKID_SD_EMMC_A_CLK0_DIV
] = &gxbb_sd_emmc_a_clk0_div
.hw
,
2813 [CLKID_SD_EMMC_A_CLK0
] = &gxbb_sd_emmc_a_clk0
.hw
,
2814 [CLKID_SD_EMMC_B_CLK0_SEL
] = &gxbb_sd_emmc_b_clk0_sel
.hw
,
2815 [CLKID_SD_EMMC_B_CLK0_DIV
] = &gxbb_sd_emmc_b_clk0_div
.hw
,
2816 [CLKID_SD_EMMC_B_CLK0
] = &gxbb_sd_emmc_b_clk0
.hw
,
2817 [CLKID_SD_EMMC_C_CLK0_SEL
] = &gxbb_sd_emmc_c_clk0_sel
.hw
,
2818 [CLKID_SD_EMMC_C_CLK0_DIV
] = &gxbb_sd_emmc_c_clk0_div
.hw
,
2819 [CLKID_SD_EMMC_C_CLK0
] = &gxbb_sd_emmc_c_clk0
.hw
,
2820 [CLKID_VPU_0_SEL
] = &gxbb_vpu_0_sel
.hw
,
2821 [CLKID_VPU_0_DIV
] = &gxbb_vpu_0_div
.hw
,
2822 [CLKID_VPU_0
] = &gxbb_vpu_0
.hw
,
2823 [CLKID_VPU_1_SEL
] = &gxbb_vpu_1_sel
.hw
,
2824 [CLKID_VPU_1_DIV
] = &gxbb_vpu_1_div
.hw
,
2825 [CLKID_VPU_1
] = &gxbb_vpu_1
.hw
,
2826 [CLKID_VPU
] = &gxbb_vpu
.hw
,
2827 [CLKID_VAPB_0_SEL
] = &gxbb_vapb_0_sel
.hw
,
2828 [CLKID_VAPB_0_DIV
] = &gxbb_vapb_0_div
.hw
,
2829 [CLKID_VAPB_0
] = &gxbb_vapb_0
.hw
,
2830 [CLKID_VAPB_1_SEL
] = &gxbb_vapb_1_sel
.hw
,
2831 [CLKID_VAPB_1_DIV
] = &gxbb_vapb_1_div
.hw
,
2832 [CLKID_VAPB_1
] = &gxbb_vapb_1
.hw
,
2833 [CLKID_VAPB_SEL
] = &gxbb_vapb_sel
.hw
,
2834 [CLKID_VAPB
] = &gxbb_vapb
.hw
,
2835 [CLKID_HDMI_PLL_PRE_MULT
] = &gxbb_hdmi_pll_pre_mult
.hw
,
2836 [CLKID_MPLL0_DIV
] = &gxbb_mpll0_div
.hw
,
2837 [CLKID_MPLL1_DIV
] = &gxbb_mpll1_div
.hw
,
2838 [CLKID_MPLL2_DIV
] = &gxbb_mpll2_div
.hw
,
2839 [CLKID_MPLL_PREDIV
] = &gxbb_mpll_prediv
.hw
,
2840 [CLKID_FCLK_DIV2_DIV
] = &gxbb_fclk_div2_div
.hw
,
2841 [CLKID_FCLK_DIV3_DIV
] = &gxbb_fclk_div3_div
.hw
,
2842 [CLKID_FCLK_DIV4_DIV
] = &gxbb_fclk_div4_div
.hw
,
2843 [CLKID_FCLK_DIV5_DIV
] = &gxbb_fclk_div5_div
.hw
,
2844 [CLKID_FCLK_DIV7_DIV
] = &gxbb_fclk_div7_div
.hw
,
2845 [CLKID_VDEC_1_SEL
] = &gxbb_vdec_1_sel
.hw
,
2846 [CLKID_VDEC_1_DIV
] = &gxbb_vdec_1_div
.hw
,
2847 [CLKID_VDEC_1
] = &gxbb_vdec_1
.hw
,
2848 [CLKID_VDEC_HEVC_SEL
] = &gxbb_vdec_hevc_sel
.hw
,
2849 [CLKID_VDEC_HEVC_DIV
] = &gxbb_vdec_hevc_div
.hw
,
2850 [CLKID_VDEC_HEVC
] = &gxbb_vdec_hevc
.hw
,
2851 [CLKID_GEN_CLK_SEL
] = &gxbb_gen_clk_sel
.hw
,
2852 [CLKID_GEN_CLK_DIV
] = &gxbb_gen_clk_div
.hw
,
2853 [CLKID_GEN_CLK
] = &gxbb_gen_clk
.hw
,
2854 [CLKID_FIXED_PLL_DCO
] = &gxbb_fixed_pll_dco
.hw
,
2855 [CLKID_HDMI_PLL_DCO
] = &gxbb_hdmi_pll_dco
.hw
,
2856 [CLKID_HDMI_PLL_OD
] = &gxbb_hdmi_pll_od
.hw
,
2857 [CLKID_HDMI_PLL_OD2
] = &gxbb_hdmi_pll_od2
.hw
,
2858 [CLKID_SYS_PLL_DCO
] = &gxbb_sys_pll_dco
.hw
,
2859 [CLKID_GP0_PLL_DCO
] = &gxbb_gp0_pll_dco
.hw
,
2860 [CLKID_VID_PLL_DIV
] = &gxbb_vid_pll_div
.hw
,
2861 [CLKID_VID_PLL_SEL
] = &gxbb_vid_pll_sel
.hw
,
2862 [CLKID_VID_PLL
] = &gxbb_vid_pll
.hw
,
2863 [CLKID_VCLK_SEL
] = &gxbb_vclk_sel
.hw
,
2864 [CLKID_VCLK2_SEL
] = &gxbb_vclk2_sel
.hw
,
2865 [CLKID_VCLK_INPUT
] = &gxbb_vclk_input
.hw
,
2866 [CLKID_VCLK2_INPUT
] = &gxbb_vclk2_input
.hw
,
2867 [CLKID_VCLK_DIV
] = &gxbb_vclk_div
.hw
,
2868 [CLKID_VCLK2_DIV
] = &gxbb_vclk2_div
.hw
,
2869 [CLKID_VCLK
] = &gxbb_vclk
.hw
,
2870 [CLKID_VCLK2
] = &gxbb_vclk2
.hw
,
2871 [CLKID_VCLK_DIV1
] = &gxbb_vclk_div1
.hw
,
2872 [CLKID_VCLK_DIV2_EN
] = &gxbb_vclk_div2_en
.hw
,
2873 [CLKID_VCLK_DIV2
] = &gxbb_vclk_div2
.hw
,
2874 [CLKID_VCLK_DIV4_EN
] = &gxbb_vclk_div4_en
.hw
,
2875 [CLKID_VCLK_DIV4
] = &gxbb_vclk_div4
.hw
,
2876 [CLKID_VCLK_DIV6_EN
] = &gxbb_vclk_div6_en
.hw
,
2877 [CLKID_VCLK_DIV6
] = &gxbb_vclk_div6
.hw
,
2878 [CLKID_VCLK_DIV12_EN
] = &gxbb_vclk_div12_en
.hw
,
2879 [CLKID_VCLK_DIV12
] = &gxbb_vclk_div12
.hw
,
2880 [CLKID_VCLK2_DIV1
] = &gxbb_vclk2_div1
.hw
,
2881 [CLKID_VCLK2_DIV2_EN
] = &gxbb_vclk2_div2_en
.hw
,
2882 [CLKID_VCLK2_DIV2
] = &gxbb_vclk2_div2
.hw
,
2883 [CLKID_VCLK2_DIV4_EN
] = &gxbb_vclk2_div4_en
.hw
,
2884 [CLKID_VCLK2_DIV4
] = &gxbb_vclk2_div4
.hw
,
2885 [CLKID_VCLK2_DIV6_EN
] = &gxbb_vclk2_div6_en
.hw
,
2886 [CLKID_VCLK2_DIV6
] = &gxbb_vclk2_div6
.hw
,
2887 [CLKID_VCLK2_DIV12_EN
] = &gxbb_vclk2_div12_en
.hw
,
2888 [CLKID_VCLK2_DIV12
] = &gxbb_vclk2_div12
.hw
,
2889 [CLKID_CTS_ENCI_SEL
] = &gxbb_cts_enci_sel
.hw
,
2890 [CLKID_CTS_ENCP_SEL
] = &gxbb_cts_encp_sel
.hw
,
2891 [CLKID_CTS_VDAC_SEL
] = &gxbb_cts_vdac_sel
.hw
,
2892 [CLKID_HDMI_TX_SEL
] = &gxbb_hdmi_tx_sel
.hw
,
2893 [CLKID_CTS_ENCI
] = &gxbb_cts_enci
.hw
,
2894 [CLKID_CTS_ENCP
] = &gxbb_cts_encp
.hw
,
2895 [CLKID_CTS_VDAC
] = &gxbb_cts_vdac
.hw
,
2896 [CLKID_HDMI_TX
] = &gxbb_hdmi_tx
.hw
,
2897 [CLKID_HDMI_SEL
] = &gxbb_hdmi_sel
.hw
,
2898 [CLKID_HDMI_DIV
] = &gxbb_hdmi_div
.hw
,
2899 [CLKID_HDMI
] = &gxbb_hdmi
.hw
,
2905 static struct clk_hw_onecell_data gxl_hw_onecell_data
= {
2907 [CLKID_SYS_PLL
] = &gxbb_sys_pll
.hw
,
2908 [CLKID_HDMI_PLL
] = &gxl_hdmi_pll
.hw
,
2909 [CLKID_FIXED_PLL
] = &gxbb_fixed_pll
.hw
,
2910 [CLKID_FCLK_DIV2
] = &gxbb_fclk_div2
.hw
,
2911 [CLKID_FCLK_DIV3
] = &gxbb_fclk_div3
.hw
,
2912 [CLKID_FCLK_DIV4
] = &gxbb_fclk_div4
.hw
,
2913 [CLKID_FCLK_DIV5
] = &gxbb_fclk_div5
.hw
,
2914 [CLKID_FCLK_DIV7
] = &gxbb_fclk_div7
.hw
,
2915 [CLKID_GP0_PLL
] = &gxbb_gp0_pll
.hw
,
2916 [CLKID_MPEG_SEL
] = &gxbb_mpeg_clk_sel
.hw
,
2917 [CLKID_MPEG_DIV
] = &gxbb_mpeg_clk_div
.hw
,
2918 [CLKID_CLK81
] = &gxbb_clk81
.hw
,
2919 [CLKID_MPLL0
] = &gxbb_mpll0
.hw
,
2920 [CLKID_MPLL1
] = &gxbb_mpll1
.hw
,
2921 [CLKID_MPLL2
] = &gxbb_mpll2
.hw
,
2922 [CLKID_DDR
] = &gxbb_ddr
.hw
,
2923 [CLKID_DOS
] = &gxbb_dos
.hw
,
2924 [CLKID_ISA
] = &gxbb_isa
.hw
,
2925 [CLKID_PL301
] = &gxbb_pl301
.hw
,
2926 [CLKID_PERIPHS
] = &gxbb_periphs
.hw
,
2927 [CLKID_SPICC
] = &gxbb_spicc
.hw
,
2928 [CLKID_I2C
] = &gxbb_i2c
.hw
,
2929 [CLKID_SAR_ADC
] = &gxbb_sar_adc
.hw
,
2930 [CLKID_SMART_CARD
] = &gxbb_smart_card
.hw
,
2931 [CLKID_RNG0
] = &gxbb_rng0
.hw
,
2932 [CLKID_UART0
] = &gxbb_uart0
.hw
,
2933 [CLKID_SDHC
] = &gxbb_sdhc
.hw
,
2934 [CLKID_STREAM
] = &gxbb_stream
.hw
,
2935 [CLKID_ASYNC_FIFO
] = &gxbb_async_fifo
.hw
,
2936 [CLKID_SDIO
] = &gxbb_sdio
.hw
,
2937 [CLKID_ABUF
] = &gxbb_abuf
.hw
,
2938 [CLKID_HIU_IFACE
] = &gxbb_hiu_iface
.hw
,
2939 [CLKID_ASSIST_MISC
] = &gxbb_assist_misc
.hw
,
2940 [CLKID_SPI
] = &gxbb_spi
.hw
,
2941 [CLKID_I2S_SPDIF
] = &gxbb_i2s_spdif
.hw
,
2942 [CLKID_ETH
] = &gxbb_eth
.hw
,
2943 [CLKID_DEMUX
] = &gxbb_demux
.hw
,
2944 [CLKID_AIU_GLUE
] = &gxbb_aiu_glue
.hw
,
2945 [CLKID_IEC958
] = &gxbb_iec958
.hw
,
2946 [CLKID_I2S_OUT
] = &gxbb_i2s_out
.hw
,
2947 [CLKID_AMCLK
] = &gxbb_amclk
.hw
,
2948 [CLKID_AIFIFO2
] = &gxbb_aififo2
.hw
,
2949 [CLKID_MIXER
] = &gxbb_mixer
.hw
,
2950 [CLKID_MIXER_IFACE
] = &gxbb_mixer_iface
.hw
,
2951 [CLKID_ADC
] = &gxbb_adc
.hw
,
2952 [CLKID_BLKMV
] = &gxbb_blkmv
.hw
,
2953 [CLKID_AIU
] = &gxbb_aiu
.hw
,
2954 [CLKID_UART1
] = &gxbb_uart1
.hw
,
2955 [CLKID_G2D
] = &gxbb_g2d
.hw
,
2956 [CLKID_USB0
] = &gxbb_usb0
.hw
,
2957 [CLKID_USB1
] = &gxbb_usb1
.hw
,
2958 [CLKID_RESET
] = &gxbb_reset
.hw
,
2959 [CLKID_NAND
] = &gxbb_nand
.hw
,
2960 [CLKID_DOS_PARSER
] = &gxbb_dos_parser
.hw
,
2961 [CLKID_USB
] = &gxbb_usb
.hw
,
2962 [CLKID_VDIN1
] = &gxbb_vdin1
.hw
,
2963 [CLKID_AHB_ARB0
] = &gxbb_ahb_arb0
.hw
,
2964 [CLKID_EFUSE
] = &gxbb_efuse
.hw
,
2965 [CLKID_BOOT_ROM
] = &gxbb_boot_rom
.hw
,
2966 [CLKID_AHB_DATA_BUS
] = &gxbb_ahb_data_bus
.hw
,
2967 [CLKID_AHB_CTRL_BUS
] = &gxbb_ahb_ctrl_bus
.hw
,
2968 [CLKID_HDMI_INTR_SYNC
] = &gxbb_hdmi_intr_sync
.hw
,
2969 [CLKID_HDMI_PCLK
] = &gxbb_hdmi_pclk
.hw
,
2970 [CLKID_USB1_DDR_BRIDGE
] = &gxbb_usb1_ddr_bridge
.hw
,
2971 [CLKID_USB0_DDR_BRIDGE
] = &gxbb_usb0_ddr_bridge
.hw
,
2972 [CLKID_MMC_PCLK
] = &gxbb_mmc_pclk
.hw
,
2973 [CLKID_DVIN
] = &gxbb_dvin
.hw
,
2974 [CLKID_UART2
] = &gxbb_uart2
.hw
,
2975 [CLKID_SANA
] = &gxbb_sana
.hw
,
2976 [CLKID_VPU_INTR
] = &gxbb_vpu_intr
.hw
,
2977 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &gxbb_sec_ahb_ahb3_bridge
.hw
,
2978 [CLKID_CLK81_A53
] = &gxbb_clk81_a53
.hw
,
2979 [CLKID_VCLK2_VENCI0
] = &gxbb_vclk2_venci0
.hw
,
2980 [CLKID_VCLK2_VENCI1
] = &gxbb_vclk2_venci1
.hw
,
2981 [CLKID_VCLK2_VENCP0
] = &gxbb_vclk2_vencp0
.hw
,
2982 [CLKID_VCLK2_VENCP1
] = &gxbb_vclk2_vencp1
.hw
,
2983 [CLKID_GCLK_VENCI_INT0
] = &gxbb_gclk_venci_int0
.hw
,
2984 [CLKID_GCLK_VENCI_INT
] = &gxbb_gclk_vencp_int
.hw
,
2985 [CLKID_DAC_CLK
] = &gxbb_dac_clk
.hw
,
2986 [CLKID_AOCLK_GATE
] = &gxbb_aoclk_gate
.hw
,
2987 [CLKID_IEC958_GATE
] = &gxbb_iec958_gate
.hw
,
2988 [CLKID_ENC480P
] = &gxbb_enc480p
.hw
,
2989 [CLKID_RNG1
] = &gxbb_rng1
.hw
,
2990 [CLKID_GCLK_VENCI_INT1
] = &gxbb_gclk_venci_int1
.hw
,
2991 [CLKID_VCLK2_VENCLMCC
] = &gxbb_vclk2_venclmcc
.hw
,
2992 [CLKID_VCLK2_VENCL
] = &gxbb_vclk2_vencl
.hw
,
2993 [CLKID_VCLK_OTHER
] = &gxbb_vclk_other
.hw
,
2994 [CLKID_EDP
] = &gxbb_edp
.hw
,
2995 [CLKID_AO_MEDIA_CPU
] = &gxbb_ao_media_cpu
.hw
,
2996 [CLKID_AO_AHB_SRAM
] = &gxbb_ao_ahb_sram
.hw
,
2997 [CLKID_AO_AHB_BUS
] = &gxbb_ao_ahb_bus
.hw
,
2998 [CLKID_AO_IFACE
] = &gxbb_ao_iface
.hw
,
2999 [CLKID_AO_I2C
] = &gxbb_ao_i2c
.hw
,
3000 [CLKID_SD_EMMC_A
] = &gxbb_emmc_a
.hw
,
3001 [CLKID_SD_EMMC_B
] = &gxbb_emmc_b
.hw
,
3002 [CLKID_SD_EMMC_C
] = &gxbb_emmc_c
.hw
,
3003 [CLKID_SAR_ADC_CLK
] = &gxbb_sar_adc_clk
.hw
,
3004 [CLKID_SAR_ADC_SEL
] = &gxbb_sar_adc_clk_sel
.hw
,
3005 [CLKID_SAR_ADC_DIV
] = &gxbb_sar_adc_clk_div
.hw
,
3006 [CLKID_MALI_0_SEL
] = &gxbb_mali_0_sel
.hw
,
3007 [CLKID_MALI_0_DIV
] = &gxbb_mali_0_div
.hw
,
3008 [CLKID_MALI_0
] = &gxbb_mali_0
.hw
,
3009 [CLKID_MALI_1_SEL
] = &gxbb_mali_1_sel
.hw
,
3010 [CLKID_MALI_1_DIV
] = &gxbb_mali_1_div
.hw
,
3011 [CLKID_MALI_1
] = &gxbb_mali_1
.hw
,
3012 [CLKID_MALI
] = &gxbb_mali
.hw
,
3013 [CLKID_CTS_AMCLK
] = &gxbb_cts_amclk
.hw
,
3014 [CLKID_CTS_AMCLK_SEL
] = &gxbb_cts_amclk_sel
.hw
,
3015 [CLKID_CTS_AMCLK_DIV
] = &gxbb_cts_amclk_div
.hw
,
3016 [CLKID_CTS_MCLK_I958
] = &gxbb_cts_mclk_i958
.hw
,
3017 [CLKID_CTS_MCLK_I958_SEL
] = &gxbb_cts_mclk_i958_sel
.hw
,
3018 [CLKID_CTS_MCLK_I958_DIV
] = &gxbb_cts_mclk_i958_div
.hw
,
3019 [CLKID_CTS_I958
] = &gxbb_cts_i958
.hw
,
3020 [CLKID_32K_CLK
] = &gxbb_32k_clk
.hw
,
3021 [CLKID_32K_CLK_SEL
] = &gxbb_32k_clk_sel
.hw
,
3022 [CLKID_32K_CLK_DIV
] = &gxbb_32k_clk_div
.hw
,
3023 [CLKID_SD_EMMC_A_CLK0_SEL
] = &gxbb_sd_emmc_a_clk0_sel
.hw
,
3024 [CLKID_SD_EMMC_A_CLK0_DIV
] = &gxbb_sd_emmc_a_clk0_div
.hw
,
3025 [CLKID_SD_EMMC_A_CLK0
] = &gxbb_sd_emmc_a_clk0
.hw
,
3026 [CLKID_SD_EMMC_B_CLK0_SEL
] = &gxbb_sd_emmc_b_clk0_sel
.hw
,
3027 [CLKID_SD_EMMC_B_CLK0_DIV
] = &gxbb_sd_emmc_b_clk0_div
.hw
,
3028 [CLKID_SD_EMMC_B_CLK0
] = &gxbb_sd_emmc_b_clk0
.hw
,
3029 [CLKID_SD_EMMC_C_CLK0_SEL
] = &gxbb_sd_emmc_c_clk0_sel
.hw
,
3030 [CLKID_SD_EMMC_C_CLK0_DIV
] = &gxbb_sd_emmc_c_clk0_div
.hw
,
3031 [CLKID_SD_EMMC_C_CLK0
] = &gxbb_sd_emmc_c_clk0
.hw
,
3032 [CLKID_VPU_0_SEL
] = &gxbb_vpu_0_sel
.hw
,
3033 [CLKID_VPU_0_DIV
] = &gxbb_vpu_0_div
.hw
,
3034 [CLKID_VPU_0
] = &gxbb_vpu_0
.hw
,
3035 [CLKID_VPU_1_SEL
] = &gxbb_vpu_1_sel
.hw
,
3036 [CLKID_VPU_1_DIV
] = &gxbb_vpu_1_div
.hw
,
3037 [CLKID_VPU_1
] = &gxbb_vpu_1
.hw
,
3038 [CLKID_VPU
] = &gxbb_vpu
.hw
,
3039 [CLKID_VAPB_0_SEL
] = &gxbb_vapb_0_sel
.hw
,
3040 [CLKID_VAPB_0_DIV
] = &gxbb_vapb_0_div
.hw
,
3041 [CLKID_VAPB_0
] = &gxbb_vapb_0
.hw
,
3042 [CLKID_VAPB_1_SEL
] = &gxbb_vapb_1_sel
.hw
,
3043 [CLKID_VAPB_1_DIV
] = &gxbb_vapb_1_div
.hw
,
3044 [CLKID_VAPB_1
] = &gxbb_vapb_1
.hw
,
3045 [CLKID_VAPB_SEL
] = &gxbb_vapb_sel
.hw
,
3046 [CLKID_VAPB
] = &gxbb_vapb
.hw
,
3047 [CLKID_MPLL0_DIV
] = &gxbb_mpll0_div
.hw
,
3048 [CLKID_MPLL1_DIV
] = &gxbb_mpll1_div
.hw
,
3049 [CLKID_MPLL2_DIV
] = &gxbb_mpll2_div
.hw
,
3050 [CLKID_MPLL_PREDIV
] = &gxbb_mpll_prediv
.hw
,
3051 [CLKID_FCLK_DIV2_DIV
] = &gxbb_fclk_div2_div
.hw
,
3052 [CLKID_FCLK_DIV3_DIV
] = &gxbb_fclk_div3_div
.hw
,
3053 [CLKID_FCLK_DIV4_DIV
] = &gxbb_fclk_div4_div
.hw
,
3054 [CLKID_FCLK_DIV5_DIV
] = &gxbb_fclk_div5_div
.hw
,
3055 [CLKID_FCLK_DIV7_DIV
] = &gxbb_fclk_div7_div
.hw
,
3056 [CLKID_VDEC_1_SEL
] = &gxbb_vdec_1_sel
.hw
,
3057 [CLKID_VDEC_1_DIV
] = &gxbb_vdec_1_div
.hw
,
3058 [CLKID_VDEC_1
] = &gxbb_vdec_1
.hw
,
3059 [CLKID_VDEC_HEVC_SEL
] = &gxbb_vdec_hevc_sel
.hw
,
3060 [CLKID_VDEC_HEVC_DIV
] = &gxbb_vdec_hevc_div
.hw
,
3061 [CLKID_VDEC_HEVC
] = &gxbb_vdec_hevc
.hw
,
3062 [CLKID_GEN_CLK_SEL
] = &gxbb_gen_clk_sel
.hw
,
3063 [CLKID_GEN_CLK_DIV
] = &gxbb_gen_clk_div
.hw
,
3064 [CLKID_GEN_CLK
] = &gxbb_gen_clk
.hw
,
3065 [CLKID_FIXED_PLL_DCO
] = &gxbb_fixed_pll_dco
.hw
,
3066 [CLKID_HDMI_PLL_DCO
] = &gxl_hdmi_pll_dco
.hw
,
3067 [CLKID_HDMI_PLL_OD
] = &gxl_hdmi_pll_od
.hw
,
3068 [CLKID_HDMI_PLL_OD2
] = &gxl_hdmi_pll_od2
.hw
,
3069 [CLKID_SYS_PLL_DCO
] = &gxbb_sys_pll_dco
.hw
,
3070 [CLKID_GP0_PLL_DCO
] = &gxl_gp0_pll_dco
.hw
,
3071 [CLKID_VID_PLL_DIV
] = &gxbb_vid_pll_div
.hw
,
3072 [CLKID_VID_PLL_SEL
] = &gxbb_vid_pll_sel
.hw
,
3073 [CLKID_VID_PLL
] = &gxbb_vid_pll
.hw
,
3074 [CLKID_VCLK_SEL
] = &gxbb_vclk_sel
.hw
,
3075 [CLKID_VCLK2_SEL
] = &gxbb_vclk2_sel
.hw
,
3076 [CLKID_VCLK_INPUT
] = &gxbb_vclk_input
.hw
,
3077 [CLKID_VCLK2_INPUT
] = &gxbb_vclk2_input
.hw
,
3078 [CLKID_VCLK_DIV
] = &gxbb_vclk_div
.hw
,
3079 [CLKID_VCLK2_DIV
] = &gxbb_vclk2_div
.hw
,
3080 [CLKID_VCLK
] = &gxbb_vclk
.hw
,
3081 [CLKID_VCLK2
] = &gxbb_vclk2
.hw
,
3082 [CLKID_VCLK_DIV1
] = &gxbb_vclk_div1
.hw
,
3083 [CLKID_VCLK_DIV2_EN
] = &gxbb_vclk_div2_en
.hw
,
3084 [CLKID_VCLK_DIV2
] = &gxbb_vclk_div2
.hw
,
3085 [CLKID_VCLK_DIV4_EN
] = &gxbb_vclk_div4_en
.hw
,
3086 [CLKID_VCLK_DIV4
] = &gxbb_vclk_div4
.hw
,
3087 [CLKID_VCLK_DIV6_EN
] = &gxbb_vclk_div6_en
.hw
,
3088 [CLKID_VCLK_DIV6
] = &gxbb_vclk_div6
.hw
,
3089 [CLKID_VCLK_DIV12_EN
] = &gxbb_vclk_div12_en
.hw
,
3090 [CLKID_VCLK_DIV12
] = &gxbb_vclk_div12
.hw
,
3091 [CLKID_VCLK2_DIV1
] = &gxbb_vclk2_div1
.hw
,
3092 [CLKID_VCLK2_DIV2_EN
] = &gxbb_vclk2_div2_en
.hw
,
3093 [CLKID_VCLK2_DIV2
] = &gxbb_vclk2_div2
.hw
,
3094 [CLKID_VCLK2_DIV4_EN
] = &gxbb_vclk2_div4_en
.hw
,
3095 [CLKID_VCLK2_DIV4
] = &gxbb_vclk2_div4
.hw
,
3096 [CLKID_VCLK2_DIV6_EN
] = &gxbb_vclk2_div6_en
.hw
,
3097 [CLKID_VCLK2_DIV6
] = &gxbb_vclk2_div6
.hw
,
3098 [CLKID_VCLK2_DIV12_EN
] = &gxbb_vclk2_div12_en
.hw
,
3099 [CLKID_VCLK2_DIV12
] = &gxbb_vclk2_div12
.hw
,
3100 [CLKID_CTS_ENCI_SEL
] = &gxbb_cts_enci_sel
.hw
,
3101 [CLKID_CTS_ENCP_SEL
] = &gxbb_cts_encp_sel
.hw
,
3102 [CLKID_CTS_VDAC_SEL
] = &gxbb_cts_vdac_sel
.hw
,
3103 [CLKID_HDMI_TX_SEL
] = &gxbb_hdmi_tx_sel
.hw
,
3104 [CLKID_CTS_ENCI
] = &gxbb_cts_enci
.hw
,
3105 [CLKID_CTS_ENCP
] = &gxbb_cts_encp
.hw
,
3106 [CLKID_CTS_VDAC
] = &gxbb_cts_vdac
.hw
,
3107 [CLKID_HDMI_TX
] = &gxbb_hdmi_tx
.hw
,
3108 [CLKID_HDMI_SEL
] = &gxbb_hdmi_sel
.hw
,
3109 [CLKID_HDMI_DIV
] = &gxbb_hdmi_div
.hw
,
3110 [CLKID_HDMI
] = &gxbb_hdmi
.hw
,
3111 [CLKID_ACODEC
] = &gxl_acodec
.hw
,
3117 static struct clk_regmap
*const gxbb_clk_regmaps
[] = {
3165 &gxbb_hdmi_intr_sync
,
3167 &gxbb_usb1_ddr_bridge
,
3168 &gxbb_usb0_ddr_bridge
,
3174 &gxbb_sec_ahb_ahb3_bridge
,
3180 &gxbb_gclk_venci_int0
,
3181 &gxbb_gclk_vencp_int
,
3187 &gxbb_gclk_venci_int1
,
3188 &gxbb_vclk2_venclmcc
,
3204 &gxbb_cts_mclk_i958
,
3206 &gxbb_sd_emmc_a_clk0
,
3207 &gxbb_sd_emmc_b_clk0
,
3208 &gxbb_sd_emmc_c_clk0
,
3215 &gxbb_sar_adc_clk_div
,
3218 &gxbb_cts_mclk_i958_div
,
3220 &gxbb_sd_emmc_a_clk0_div
,
3221 &gxbb_sd_emmc_b_clk0_div
,
3222 &gxbb_sd_emmc_c_clk0_div
,
3228 &gxbb_sar_adc_clk_sel
,
3232 &gxbb_cts_amclk_sel
,
3233 &gxbb_cts_mclk_i958_sel
,
3236 &gxbb_sd_emmc_a_clk0_sel
,
3237 &gxbb_sd_emmc_b_clk0_sel
,
3238 &gxbb_sd_emmc_c_clk0_sel
,
3251 &gxbb_cts_amclk_div
,
3263 &gxbb_vdec_hevc_sel
,
3264 &gxbb_vdec_hevc_div
,
3269 &gxbb_fixed_pll_dco
,
3283 &gxbb_vclk_div12_en
,
3289 &gxbb_vclk2_div2_en
,
3290 &gxbb_vclk2_div4_en
,
3291 &gxbb_vclk2_div6_en
,
3292 &gxbb_vclk2_div12_en
,
3311 static struct clk_regmap
*const gxl_clk_regmaps
[] = {
3359 &gxbb_hdmi_intr_sync
,
3361 &gxbb_usb1_ddr_bridge
,
3362 &gxbb_usb0_ddr_bridge
,
3368 &gxbb_sec_ahb_ahb3_bridge
,
3374 &gxbb_gclk_venci_int0
,
3375 &gxbb_gclk_vencp_int
,
3381 &gxbb_gclk_venci_int1
,
3382 &gxbb_vclk2_venclmcc
,
3398 &gxbb_cts_mclk_i958
,
3400 &gxbb_sd_emmc_a_clk0
,
3401 &gxbb_sd_emmc_b_clk0
,
3402 &gxbb_sd_emmc_c_clk0
,
3409 &gxbb_sar_adc_clk_div
,
3412 &gxbb_cts_mclk_i958_div
,
3414 &gxbb_sd_emmc_a_clk0_div
,
3415 &gxbb_sd_emmc_b_clk0_div
,
3416 &gxbb_sd_emmc_c_clk0_div
,
3422 &gxbb_sar_adc_clk_sel
,
3426 &gxbb_cts_amclk_sel
,
3427 &gxbb_cts_mclk_i958_sel
,
3430 &gxbb_sd_emmc_a_clk0_sel
,
3431 &gxbb_sd_emmc_b_clk0_sel
,
3432 &gxbb_sd_emmc_c_clk0_sel
,
3445 &gxbb_cts_amclk_div
,
3457 &gxbb_vdec_hevc_sel
,
3458 &gxbb_vdec_hevc_div
,
3463 &gxbb_fixed_pll_dco
,
3477 &gxbb_vclk_div12_en
,
3483 &gxbb_vclk2_div2_en
,
3484 &gxbb_vclk2_div4_en
,
3485 &gxbb_vclk2_div6_en
,
3486 &gxbb_vclk2_div12_en
,
3506 static const struct meson_eeclkc_data gxbb_clkc_data
= {
3507 .regmap_clks
= gxbb_clk_regmaps
,
3508 .regmap_clk_num
= ARRAY_SIZE(gxbb_clk_regmaps
),
3509 .hw_onecell_data
= &gxbb_hw_onecell_data
,
3512 static const struct meson_eeclkc_data gxl_clkc_data
= {
3513 .regmap_clks
= gxl_clk_regmaps
,
3514 .regmap_clk_num
= ARRAY_SIZE(gxl_clk_regmaps
),
3515 .hw_onecell_data
= &gxl_hw_onecell_data
,
3518 static const struct of_device_id clkc_match_table
[] = {
3519 { .compatible
= "amlogic,gxbb-clkc", .data
= &gxbb_clkc_data
},
3520 { .compatible
= "amlogic,gxl-clkc", .data
= &gxl_clkc_data
},
3523 MODULE_DEVICE_TABLE(of
, clkc_match_table
);
3525 static struct platform_driver gxbb_driver
= {
3526 .probe
= meson_eeclkc_probe
,
3528 .name
= "gxbb-clkc",
3529 .of_match_table
= clkc_match_table
,
3533 module_platform_driver(gxbb_driver
);
3534 MODULE_LICENSE("GPL v2");