xref: /linux/drivers/clk/qcom/dispcc-sm6125.c (revision 9f93a0a4)
16e87c8f0SMartin Botka // SPDX-License-Identifier: GPL-2.0-only
26e87c8f0SMartin Botka /*
36e87c8f0SMartin Botka  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
46e87c8f0SMartin Botka  */
56e87c8f0SMartin Botka 
66e87c8f0SMartin Botka #include <linux/clk-provider.h>
76e87c8f0SMartin Botka #include <linux/module.h>
86e87c8f0SMartin Botka #include <linux/platform_device.h>
96e87c8f0SMartin Botka #include <linux/regmap.h>
106e87c8f0SMartin Botka 
116e87c8f0SMartin Botka #include <dt-bindings/clock/qcom,dispcc-sm6125.h>
126e87c8f0SMartin Botka 
136e87c8f0SMartin Botka #include "clk-alpha-pll.h"
146e87c8f0SMartin Botka #include "clk-branch.h"
156e87c8f0SMartin Botka #include "clk-rcg.h"
166e87c8f0SMartin Botka #include "clk-regmap.h"
176e87c8f0SMartin Botka #include "common.h"
186e87c8f0SMartin Botka #include "gdsc.h"
196e87c8f0SMartin Botka 
206e87c8f0SMartin Botka enum {
216e87c8f0SMartin Botka 	P_BI_TCXO,
226e87c8f0SMartin Botka 	P_DISP_CC_PLL0_OUT_MAIN,
236e87c8f0SMartin Botka 	P_DP_PHY_PLL_LINK_CLK,
246e87c8f0SMartin Botka 	P_DP_PHY_PLL_VCO_DIV_CLK,
256e87c8f0SMartin Botka 	P_DSI0_PHY_PLL_OUT_BYTECLK,
266e87c8f0SMartin Botka 	P_DSI0_PHY_PLL_OUT_DSICLK,
276e87c8f0SMartin Botka 	P_DSI1_PHY_PLL_OUT_DSICLK,
286e87c8f0SMartin Botka 	P_GPLL0_OUT_MAIN,
296e87c8f0SMartin Botka };
306e87c8f0SMartin Botka 
31fcd9354cSChristophe JAILLET static const struct pll_vco disp_cc_pll_vco[] = {
326e87c8f0SMartin Botka 	{ 500000000, 1000000000, 2 },
336e87c8f0SMartin Botka };
346e87c8f0SMartin Botka 
356e87c8f0SMartin Botka static struct clk_alpha_pll disp_cc_pll0 = {
366e87c8f0SMartin Botka 	.offset = 0x0,
376e87c8f0SMartin Botka 	.vco_table = disp_cc_pll_vco,
386e87c8f0SMartin Botka 	.num_vco = ARRAY_SIZE(disp_cc_pll_vco),
396e87c8f0SMartin Botka 	.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
406e87c8f0SMartin Botka 	.flags = SUPPORTS_DYNAMIC_UPDATE,
416e87c8f0SMartin Botka 	.clkr = {
426e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
436e87c8f0SMartin Botka 			.name = "disp_cc_pll0",
446e87c8f0SMartin Botka 			.parent_data = &(const struct clk_parent_data){
456e87c8f0SMartin Botka 				.fw_name = "bi_tcxo",
466e87c8f0SMartin Botka 			},
476e87c8f0SMartin Botka 			.num_parents = 1,
486e87c8f0SMartin Botka 			.ops = &clk_alpha_pll_ops,
496e87c8f0SMartin Botka 		},
506e87c8f0SMartin Botka 	},
516e87c8f0SMartin Botka };
526e87c8f0SMartin Botka 
536e87c8f0SMartin Botka /* 768MHz configuration */
546e87c8f0SMartin Botka static const struct alpha_pll_config disp_cc_pll0_config = {
556e87c8f0SMartin Botka 	.l = 0x28,
566e87c8f0SMartin Botka 	.vco_val = 0x2 << 20,
576e87c8f0SMartin Botka 	.vco_mask = 0x3 << 20,
586e87c8f0SMartin Botka 	.main_output_mask = BIT(0),
596e87c8f0SMartin Botka 	.config_ctl_val = 0x4001055b,
606e87c8f0SMartin Botka };
616e87c8f0SMartin Botka 
626e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_0[] = {
636e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
646e87c8f0SMartin Botka };
656e87c8f0SMartin Botka 
666e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_0[] = {
676e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
686e87c8f0SMartin Botka };
696e87c8f0SMartin Botka 
706e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_1[] = {
716e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
726e87c8f0SMartin Botka 	{ P_DP_PHY_PLL_LINK_CLK, 1 },
736e87c8f0SMartin Botka 	{ P_DP_PHY_PLL_VCO_DIV_CLK, 2 },
746e87c8f0SMartin Botka };
756e87c8f0SMartin Botka 
766e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_1[] = {
776e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
786e87c8f0SMartin Botka 	{ .fw_name = "dp_phy_pll_link_clk" },
796e87c8f0SMartin Botka 	{ .fw_name = "dp_phy_pll_vco_div_clk" },
806e87c8f0SMartin Botka };
816e87c8f0SMartin Botka 
826e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_2[] = {
836e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
846e87c8f0SMartin Botka 	{ P_DSI0_PHY_PLL_OUT_BYTECLK, 1 },
856e87c8f0SMartin Botka };
866e87c8f0SMartin Botka 
876e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_2[] = {
886e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
896e87c8f0SMartin Botka 	{ .fw_name = "dsi0_phy_pll_out_byteclk" },
906e87c8f0SMartin Botka };
916e87c8f0SMartin Botka 
926e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_3[] = {
936e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
946e87c8f0SMartin Botka 	{ P_DISP_CC_PLL0_OUT_MAIN, 1 },
956e87c8f0SMartin Botka 	{ P_GPLL0_OUT_MAIN, 4 },
966e87c8f0SMartin Botka };
976e87c8f0SMartin Botka 
986e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_3[] = {
996e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
1006e87c8f0SMartin Botka 	{ .hw = &disp_cc_pll0.clkr.hw },
1016e87c8f0SMartin Botka 	{ .fw_name = "gcc_disp_gpll0_div_clk_src" },
1026e87c8f0SMartin Botka };
1036e87c8f0SMartin Botka 
1046e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_4[] = {
1056e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
1066e87c8f0SMartin Botka 	{ P_GPLL0_OUT_MAIN, 4 },
1076e87c8f0SMartin Botka };
1086e87c8f0SMartin Botka 
1096e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_4[] = {
1106e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
1116e87c8f0SMartin Botka 	{ .fw_name = "gcc_disp_gpll0_div_clk_src" },
1126e87c8f0SMartin Botka };
1136e87c8f0SMartin Botka 
1146e87c8f0SMartin Botka static const struct parent_map disp_cc_parent_map_5[] = {
1156e87c8f0SMartin Botka 	{ P_BI_TCXO, 0 },
1166e87c8f0SMartin Botka 	{ P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
1176e87c8f0SMartin Botka 	{ P_DSI1_PHY_PLL_OUT_DSICLK, 2 },
1186e87c8f0SMartin Botka };
1196e87c8f0SMartin Botka 
1206e87c8f0SMartin Botka static const struct clk_parent_data disp_cc_parent_data_5[] = {
1216e87c8f0SMartin Botka 	{ .fw_name = "bi_tcxo" },
1226e87c8f0SMartin Botka 	{ .fw_name = "dsi0_phy_pll_out_dsiclk" },
1236e87c8f0SMartin Botka 	{ .fw_name = "dsi1_phy_pll_out_dsiclk" },
1246e87c8f0SMartin Botka };
1256e87c8f0SMartin Botka 
1266e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
1276e87c8f0SMartin Botka 	F(19200000, P_BI_TCXO, 1, 0, 0),
1286e87c8f0SMartin Botka 	F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
1296e87c8f0SMartin Botka 	F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
1306e87c8f0SMartin Botka 	{ }
1316e87c8f0SMartin Botka };
1326e87c8f0SMartin Botka 
1336e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
1346e87c8f0SMartin Botka 	.cmd_rcgr = 0x2154,
1356e87c8f0SMartin Botka 	.mnd_width = 0,
1366e87c8f0SMartin Botka 	.hid_width = 5,
1376e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_4,
1386e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
1396e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
1406e87c8f0SMartin Botka 		.name = "disp_cc_mdss_ahb_clk_src",
1416e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_4,
1426e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
1436e87c8f0SMartin Botka 		.ops = &clk_rcg2_shared_ops,
1446e87c8f0SMartin Botka 	},
1456e87c8f0SMartin Botka };
1466e87c8f0SMartin Botka 
1476e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
1486e87c8f0SMartin Botka 	.cmd_rcgr = 0x20bc,
1496e87c8f0SMartin Botka 	.mnd_width = 0,
1506e87c8f0SMartin Botka 	.hid_width = 5,
1516e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_2,
1526e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
1536e87c8f0SMartin Botka 		.name = "disp_cc_mdss_byte0_clk_src",
1546e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_2,
1556e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
1566e87c8f0SMartin Botka 		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
1576e87c8f0SMartin Botka 		.ops = &clk_byte2_ops,
1586e87c8f0SMartin Botka 	},
1596e87c8f0SMartin Botka };
1606e87c8f0SMartin Botka 
1616e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux1_clk_src[] = {
1626e87c8f0SMartin Botka 	F(19200000, P_BI_TCXO, 1, 0, 0),
1636e87c8f0SMartin Botka 	{ }
1646e87c8f0SMartin Botka };
1656e87c8f0SMartin Botka 
1666e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = {
1676e87c8f0SMartin Botka 	.cmd_rcgr = 0x213c,
1686e87c8f0SMartin Botka 	.mnd_width = 0,
1696e87c8f0SMartin Botka 	.hid_width = 5,
1706e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_0,
1716e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src,
1726e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
1736e87c8f0SMartin Botka 		.name = "disp_cc_mdss_dp_aux_clk_src",
1746e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_0,
1756e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
1766e87c8f0SMartin Botka 		.ops = &clk_rcg2_ops,
1776e87c8f0SMartin Botka 	},
1786e87c8f0SMartin Botka };
1796e87c8f0SMartin Botka 
1806e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_dp_crypto_clk_src[] = {
1816e87c8f0SMartin Botka 	F( 180000, P_DP_PHY_PLL_LINK_CLK,   1.5,   0,   0),
1826e87c8f0SMartin Botka 	F( 360000, P_DP_PHY_PLL_LINK_CLK,   1.5,   0,   0),
1836e87c8f0SMartin Botka 	{ }
1846e87c8f0SMartin Botka };
1856e87c8f0SMartin Botka 
1866e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = {
1876e87c8f0SMartin Botka 	.cmd_rcgr = 0x210c,
1886e87c8f0SMartin Botka 	.mnd_width = 0,
1896e87c8f0SMartin Botka 	.hid_width = 5,
1906e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_1,
1916e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_dp_crypto_clk_src,
1926e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
1936e87c8f0SMartin Botka 		.name = "disp_cc_mdss_dp_crypto_clk_src",
1946e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_1,
1956e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
1966e87c8f0SMartin Botka 		.flags = CLK_GET_RATE_NOCACHE,
1976e87c8f0SMartin Botka 		.ops = &clk_rcg2_ops,
1986e87c8f0SMartin Botka 	},
1996e87c8f0SMartin Botka };
2006e87c8f0SMartin Botka 
2016e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_dp_link_clk_src[] = {
2026e87c8f0SMartin Botka 	F( 162000, P_DP_PHY_PLL_LINK_CLK,   1,   0,   0),
2036e87c8f0SMartin Botka 	F( 270000, P_DP_PHY_PLL_LINK_CLK,   1,   0,   0),
2046e87c8f0SMartin Botka 	F( 540000, P_DP_PHY_PLL_LINK_CLK,   1,   0,   0),
2056e87c8f0SMartin Botka 	{ }
2066e87c8f0SMartin Botka };
2076e87c8f0SMartin Botka 
2086e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = {
2096e87c8f0SMartin Botka 	.cmd_rcgr = 0x20f0,
2106e87c8f0SMartin Botka 	.mnd_width = 0,
2116e87c8f0SMartin Botka 	.hid_width = 5,
2126e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_1,
2136e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_dp_link_clk_src,
2146e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
2156e87c8f0SMartin Botka 		.name = "disp_cc_mdss_dp_link_clk_src",
2166e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_1,
2176e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
2186e87c8f0SMartin Botka 		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
2196e87c8f0SMartin Botka 		.ops = &clk_rcg2_ops,
2206e87c8f0SMartin Botka 	},
2216e87c8f0SMartin Botka };
2226e87c8f0SMartin Botka 
2236e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src = {
2246e87c8f0SMartin Botka 	.cmd_rcgr = 0x2124,
2256e87c8f0SMartin Botka 	.mnd_width = 16,
2266e87c8f0SMartin Botka 	.hid_width = 5,
2276e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_1,
2286e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
2296e87c8f0SMartin Botka 		.name = "disp_cc_mdss_dp_pixel_clk_src",
2306e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_1,
2316e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
2326e87c8f0SMartin Botka 		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
2336e87c8f0SMartin Botka 		.ops = &clk_dp_ops,
2346e87c8f0SMartin Botka 	},
2356e87c8f0SMartin Botka };
2366e87c8f0SMartin Botka 
2376e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
2386e87c8f0SMartin Botka 	.cmd_rcgr = 0x20d8,
2396e87c8f0SMartin Botka 	.mnd_width = 0,
2406e87c8f0SMartin Botka 	.hid_width = 5,
2416e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_2,
2426e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src,
2436e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
2446e87c8f0SMartin Botka 		.name = "disp_cc_mdss_esc0_clk_src",
2456e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_2,
2466e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
2476e87c8f0SMartin Botka 		.ops = &clk_rcg2_ops,
2486e87c8f0SMartin Botka 	},
2496e87c8f0SMartin Botka };
2506e87c8f0SMartin Botka 
2516e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
2526e87c8f0SMartin Botka 	F(19200000, P_BI_TCXO, 1, 0, 0),
2536e87c8f0SMartin Botka 	F(192000000, P_DISP_CC_PLL0_OUT_MAIN, 4, 0, 0),
2546e87c8f0SMartin Botka 	F(256000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
2556e87c8f0SMartin Botka 	F(307200000, P_DISP_CC_PLL0_OUT_MAIN, 2.5, 0, 0),
2566e87c8f0SMartin Botka 	F(384000000, P_DISP_CC_PLL0_OUT_MAIN, 2, 0, 0),
2576e87c8f0SMartin Botka 	F(400000000, P_GPLL0_OUT_MAIN, 1.5, 0, 0),
2586e87c8f0SMartin Botka 	{ }
2596e87c8f0SMartin Botka };
2606e87c8f0SMartin Botka 
2616e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
2626e87c8f0SMartin Botka 	.cmd_rcgr = 0x2074,
2636e87c8f0SMartin Botka 	.mnd_width = 0,
2646e87c8f0SMartin Botka 	.hid_width = 5,
2656e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_3,
2666e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
2676e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
2686e87c8f0SMartin Botka 		.name = "disp_cc_mdss_mdp_clk_src",
2696e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_3,
2706e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
2716e87c8f0SMartin Botka 		.ops = &clk_rcg2_shared_ops,
2726e87c8f0SMartin Botka 	},
2736e87c8f0SMartin Botka };
2746e87c8f0SMartin Botka 
2756e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
2766e87c8f0SMartin Botka 	.cmd_rcgr = 0x205c,
2776e87c8f0SMartin Botka 	.mnd_width = 8,
2786e87c8f0SMartin Botka 	.hid_width = 5,
2796e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_5,
2806e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
2816e87c8f0SMartin Botka 		.name = "disp_cc_mdss_pclk0_clk_src",
2826e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_5,
2836e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
2846e87c8f0SMartin Botka 		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
2856e87c8f0SMartin Botka 		.ops = &clk_pixel_ops,
2866e87c8f0SMartin Botka 	},
2876e87c8f0SMartin Botka };
2886e87c8f0SMartin Botka 
2896e87c8f0SMartin Botka static const struct freq_tbl ftbl_disp_cc_mdss_rot_clk_src[] = {
2906e87c8f0SMartin Botka 	F(19200000, P_BI_TCXO, 1, 0, 0),
2916e87c8f0SMartin Botka 	F(192000000, P_DISP_CC_PLL0_OUT_MAIN, 4, 0, 0),
2926e87c8f0SMartin Botka 	F(256000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
2936e87c8f0SMartin Botka 	F(307200000, P_DISP_CC_PLL0_OUT_MAIN, 2.5, 0, 0),
2946e87c8f0SMartin Botka 	{ }
2956e87c8f0SMartin Botka };
2966e87c8f0SMartin Botka 
2976e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_rot_clk_src = {
2986e87c8f0SMartin Botka 	.cmd_rcgr = 0x208c,
2996e87c8f0SMartin Botka 	.mnd_width = 0,
3006e87c8f0SMartin Botka 	.hid_width = 5,
3016e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_3,
3026e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_rot_clk_src,
3036e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
3046e87c8f0SMartin Botka 		.name = "disp_cc_mdss_rot_clk_src",
3056e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_3,
3066e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
3076e87c8f0SMartin Botka 		.flags = CLK_SET_RATE_PARENT,
3086e87c8f0SMartin Botka 		.ops = &clk_rcg2_shared_ops,
3096e87c8f0SMartin Botka 	},
3106e87c8f0SMartin Botka };
3116e87c8f0SMartin Botka 
3126e87c8f0SMartin Botka static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
3136e87c8f0SMartin Botka 	.cmd_rcgr = 0x20a4,
3146e87c8f0SMartin Botka 	.mnd_width = 0,
3156e87c8f0SMartin Botka 	.hid_width = 5,
3166e87c8f0SMartin Botka 	.parent_map = disp_cc_parent_map_0,
3176e87c8f0SMartin Botka 	.freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src,
3186e87c8f0SMartin Botka 	.clkr.hw.init = &(struct clk_init_data){
3196e87c8f0SMartin Botka 		.name = "disp_cc_mdss_vsync_clk_src",
3206e87c8f0SMartin Botka 		.parent_data = disp_cc_parent_data_0,
3216e87c8f0SMartin Botka 		.num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
3226e87c8f0SMartin Botka 		.ops = &clk_rcg2_ops,
3236e87c8f0SMartin Botka 	},
3246e87c8f0SMartin Botka };
3256e87c8f0SMartin Botka 
3266e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_ahb_clk = {
3276e87c8f0SMartin Botka 	.halt_reg = 0x2044,
3286e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
3296e87c8f0SMartin Botka 	.clkr = {
3306e87c8f0SMartin Botka 		.enable_reg = 0x2044,
3316e87c8f0SMartin Botka 		.enable_mask = BIT(0),
3326e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
3336e87c8f0SMartin Botka 			.name = "disp_cc_mdss_ahb_clk",
3346e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
3356e87c8f0SMartin Botka 				&disp_cc_mdss_ahb_clk_src.clkr.hw,
3366e87c8f0SMartin Botka 			},
3376e87c8f0SMartin Botka 			.num_parents = 1,
3386e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
3396e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
3406e87c8f0SMartin Botka 		},
3416e87c8f0SMartin Botka 	},
3426e87c8f0SMartin Botka };
3436e87c8f0SMartin Botka 
3446e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_byte0_clk = {
3456e87c8f0SMartin Botka 	.halt_reg = 0x2024,
3466e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
3476e87c8f0SMartin Botka 	.clkr = {
3486e87c8f0SMartin Botka 		.enable_reg = 0x2024,
3496e87c8f0SMartin Botka 		.enable_mask = BIT(0),
3506e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
3516e87c8f0SMartin Botka 			.name = "disp_cc_mdss_byte0_clk",
3526e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
3536e87c8f0SMartin Botka 				&disp_cc_mdss_byte0_clk_src.clkr.hw,
3546e87c8f0SMartin Botka 			},
3556e87c8f0SMartin Botka 			.num_parents = 1,
3566e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
3576e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
3586e87c8f0SMartin Botka 		},
3596e87c8f0SMartin Botka 	},
3606e87c8f0SMartin Botka };
3616e87c8f0SMartin Botka 
3626e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
3636e87c8f0SMartin Botka 	.halt_reg = 0x2028,
3646e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
3656e87c8f0SMartin Botka 	.clkr = {
3666e87c8f0SMartin Botka 		.enable_reg = 0x2028,
3676e87c8f0SMartin Botka 		.enable_mask = BIT(0),
3686e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
3696e87c8f0SMartin Botka 			.name = "disp_cc_mdss_byte0_intf_clk",
3706e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
3716e87c8f0SMartin Botka 				&disp_cc_mdss_byte0_clk_src.clkr.hw,
3726e87c8f0SMartin Botka 			},
3736e87c8f0SMartin Botka 			.num_parents = 1,
3746e87c8f0SMartin Botka 			.flags = CLK_GET_RATE_NOCACHE,
3756e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
3766e87c8f0SMartin Botka 		},
3776e87c8f0SMartin Botka 	},
3786e87c8f0SMartin Botka };
3796e87c8f0SMartin Botka 
3806e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_dp_aux_clk = {
3816e87c8f0SMartin Botka 	.halt_reg = 0x2040,
3826e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
3836e87c8f0SMartin Botka 	.clkr = {
3846e87c8f0SMartin Botka 		.enable_reg = 0x2040,
3856e87c8f0SMartin Botka 		.enable_mask = BIT(0),
3866e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
3876e87c8f0SMartin Botka 			.name = "disp_cc_mdss_dp_aux_clk",
3886e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
3896e87c8f0SMartin Botka 				&disp_cc_mdss_dp_aux_clk_src.clkr.hw,
3906e87c8f0SMartin Botka 			},
3916e87c8f0SMartin Botka 			.num_parents = 1,
3926e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
3936e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
3946e87c8f0SMartin Botka 		},
3956e87c8f0SMartin Botka 	},
3966e87c8f0SMartin Botka };
3976e87c8f0SMartin Botka 
3986e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_dp_crypto_clk = {
3996e87c8f0SMartin Botka 	.halt_reg = 0x2038,
4006e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4016e87c8f0SMartin Botka 	.clkr = {
4026e87c8f0SMartin Botka 		.enable_reg = 0x2038,
4036e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4046e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4056e87c8f0SMartin Botka 			.name = "disp_cc_mdss_dp_crypto_clk",
4066e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4076e87c8f0SMartin Botka 				&disp_cc_mdss_dp_crypto_clk_src.clkr.hw,
4086e87c8f0SMartin Botka 			},
4096e87c8f0SMartin Botka 			.num_parents = 1,
4106e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
4116e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
4126e87c8f0SMartin Botka 		},
4136e87c8f0SMartin Botka 	},
4146e87c8f0SMartin Botka };
4156e87c8f0SMartin Botka 
4166e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_dp_link_clk = {
4176e87c8f0SMartin Botka 	.halt_reg = 0x2030,
4186e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4196e87c8f0SMartin Botka 	.clkr = {
4206e87c8f0SMartin Botka 		.enable_reg = 0x2030,
4216e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4226e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4236e87c8f0SMartin Botka 			.name = "disp_cc_mdss_dp_link_clk",
4246e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4256e87c8f0SMartin Botka 				&disp_cc_mdss_dp_link_clk_src.clkr.hw,
4266e87c8f0SMartin Botka 			},
4276e87c8f0SMartin Botka 			.num_parents = 1,
4286e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
4296e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
4306e87c8f0SMartin Botka 		},
4316e87c8f0SMartin Botka 	},
4326e87c8f0SMartin Botka };
4336e87c8f0SMartin Botka 
4346e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_dp_link_intf_clk = {
4356e87c8f0SMartin Botka 	.halt_reg = 0x2034,
4366e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4376e87c8f0SMartin Botka 	.clkr = {
4386e87c8f0SMartin Botka 		.enable_reg = 0x2034,
4396e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4406e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4416e87c8f0SMartin Botka 			.name = "disp_cc_mdss_dp_link_intf_clk",
4426e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4436e87c8f0SMartin Botka 				&disp_cc_mdss_dp_link_clk_src.clkr.hw,
4446e87c8f0SMartin Botka 			},
4456e87c8f0SMartin Botka 			.num_parents = 1,
4466e87c8f0SMartin Botka 			.flags = CLK_GET_RATE_NOCACHE,
4476e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
4486e87c8f0SMartin Botka 		},
4496e87c8f0SMartin Botka 	},
4506e87c8f0SMartin Botka };
4516e87c8f0SMartin Botka 
4526e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_dp_pixel_clk = {
4536e87c8f0SMartin Botka 	.halt_reg = 0x203c,
4546e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4556e87c8f0SMartin Botka 	.clkr = {
4566e87c8f0SMartin Botka 		.enable_reg = 0x203c,
4576e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4586e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4596e87c8f0SMartin Botka 			.name = "disp_cc_mdss_dp_pixel_clk",
4606e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4616e87c8f0SMartin Botka 				&disp_cc_mdss_dp_pixel_clk_src.clkr.hw,
4626e87c8f0SMartin Botka 			},
4636e87c8f0SMartin Botka 			.num_parents = 1,
4646e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
4656e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
4666e87c8f0SMartin Botka 		},
4676e87c8f0SMartin Botka 	},
4686e87c8f0SMartin Botka };
4696e87c8f0SMartin Botka 
4706e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_esc0_clk = {
4716e87c8f0SMartin Botka 	.halt_reg = 0x202c,
4726e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4736e87c8f0SMartin Botka 	.clkr = {
4746e87c8f0SMartin Botka 		.enable_reg = 0x202c,
4756e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4766e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4776e87c8f0SMartin Botka 			.name = "disp_cc_mdss_esc0_clk",
4786e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4796e87c8f0SMartin Botka 				&disp_cc_mdss_esc0_clk_src.clkr.hw,
4806e87c8f0SMartin Botka 			},
4816e87c8f0SMartin Botka 			.num_parents = 1,
4826e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
4836e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
4846e87c8f0SMartin Botka 		},
4856e87c8f0SMartin Botka 	},
4866e87c8f0SMartin Botka };
4876e87c8f0SMartin Botka 
4886e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_mdp_clk = {
4896e87c8f0SMartin Botka 	.halt_reg = 0x2008,
4906e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
4916e87c8f0SMartin Botka 	.clkr = {
4926e87c8f0SMartin Botka 		.enable_reg = 0x2008,
4936e87c8f0SMartin Botka 		.enable_mask = BIT(0),
4946e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
4956e87c8f0SMartin Botka 			.name = "disp_cc_mdss_mdp_clk",
4966e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
4976e87c8f0SMartin Botka 				&disp_cc_mdss_mdp_clk_src.clkr.hw,
4986e87c8f0SMartin Botka 			},
4996e87c8f0SMartin Botka 			.num_parents = 1,
5006e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
5016e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5026e87c8f0SMartin Botka 		},
5036e87c8f0SMartin Botka 	},
5046e87c8f0SMartin Botka };
5056e87c8f0SMartin Botka 
5066e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
5076e87c8f0SMartin Botka 	.halt_reg = 0x2018,
5086e87c8f0SMartin Botka 	.halt_check = BRANCH_VOTED,
5096e87c8f0SMartin Botka 	.clkr = {
5106e87c8f0SMartin Botka 		.enable_reg = 0x2018,
5116e87c8f0SMartin Botka 		.enable_mask = BIT(0),
5126e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
5136e87c8f0SMartin Botka 			.name = "disp_cc_mdss_mdp_lut_clk",
5146e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
5156e87c8f0SMartin Botka 				&disp_cc_mdss_mdp_clk_src.clkr.hw,
5166e87c8f0SMartin Botka 			},
5176e87c8f0SMartin Botka 			.num_parents = 1,
5186e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5196e87c8f0SMartin Botka 		},
5206e87c8f0SMartin Botka 	},
5216e87c8f0SMartin Botka };
5226e87c8f0SMartin Botka 
5236e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
5246e87c8f0SMartin Botka 	.halt_reg = 0x4004,
5256e87c8f0SMartin Botka 	.halt_check = BRANCH_VOTED,
5266e87c8f0SMartin Botka 	.clkr = {
5276e87c8f0SMartin Botka 		.enable_reg = 0x4004,
5286e87c8f0SMartin Botka 		.enable_mask = BIT(0),
5296e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
5306e87c8f0SMartin Botka 			.name = "disp_cc_mdss_non_gdsc_ahb_clk",
5316e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
5326e87c8f0SMartin Botka 				&disp_cc_mdss_ahb_clk_src.clkr.hw,
5336e87c8f0SMartin Botka 			},
5346e87c8f0SMartin Botka 			.num_parents = 1,
5356e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
5366e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5376e87c8f0SMartin Botka 		},
5386e87c8f0SMartin Botka 	},
5396e87c8f0SMartin Botka };
5406e87c8f0SMartin Botka 
5416e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_pclk0_clk = {
5426e87c8f0SMartin Botka 	.halt_reg = 0x2004,
5436e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
5446e87c8f0SMartin Botka 	.clkr = {
5456e87c8f0SMartin Botka 		.enable_reg = 0x2004,
5466e87c8f0SMartin Botka 		.enable_mask = BIT(0),
5476e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
5486e87c8f0SMartin Botka 			.name = "disp_cc_mdss_pclk0_clk",
5496e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
5506e87c8f0SMartin Botka 				&disp_cc_mdss_pclk0_clk_src.clkr.hw,
5516e87c8f0SMartin Botka 			},
5526e87c8f0SMartin Botka 			.num_parents = 1,
5536e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
5546e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5556e87c8f0SMartin Botka 		},
5566e87c8f0SMartin Botka 	},
5576e87c8f0SMartin Botka };
5586e87c8f0SMartin Botka 
5596e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_rot_clk = {
5606e87c8f0SMartin Botka 	.halt_reg = 0x2010,
5616e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
5626e87c8f0SMartin Botka 	.clkr = {
5636e87c8f0SMartin Botka 		.enable_reg = 0x2010,
5646e87c8f0SMartin Botka 		.enable_mask = BIT(0),
5656e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
5666e87c8f0SMartin Botka 			.name = "disp_cc_mdss_rot_clk",
5676e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
5686e87c8f0SMartin Botka 				&disp_cc_mdss_rot_clk_src.clkr.hw,
5696e87c8f0SMartin Botka 			},
5706e87c8f0SMartin Botka 			.num_parents = 1,
5716e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
5726e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5736e87c8f0SMartin Botka 		},
5746e87c8f0SMartin Botka 	},
5756e87c8f0SMartin Botka };
5766e87c8f0SMartin Botka 
5776e87c8f0SMartin Botka static struct clk_branch disp_cc_mdss_vsync_clk = {
5786e87c8f0SMartin Botka 	.halt_reg = 0x2020,
5796e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
5806e87c8f0SMartin Botka 	.clkr = {
5816e87c8f0SMartin Botka 		.enable_reg = 0x2020,
5826e87c8f0SMartin Botka 		.enable_mask = BIT(0),
5836e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
5846e87c8f0SMartin Botka 			.name = "disp_cc_mdss_vsync_clk",
5856e87c8f0SMartin Botka 			.parent_hws = (const struct clk_hw*[]){
5866e87c8f0SMartin Botka 				&disp_cc_mdss_vsync_clk_src.clkr.hw,
5876e87c8f0SMartin Botka 			},
5886e87c8f0SMartin Botka 			.num_parents = 1,
5896e87c8f0SMartin Botka 			.flags = CLK_SET_RATE_PARENT,
5906e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
5916e87c8f0SMartin Botka 		},
5926e87c8f0SMartin Botka 	},
5936e87c8f0SMartin Botka };
5946e87c8f0SMartin Botka 
5956e87c8f0SMartin Botka static struct clk_branch disp_cc_xo_clk = {
5966e87c8f0SMartin Botka 	.halt_reg = 0x604c,
5976e87c8f0SMartin Botka 	.halt_check = BRANCH_HALT,
5986e87c8f0SMartin Botka 	.clkr = {
5996e87c8f0SMartin Botka 		.enable_reg = 0x604c,
6006e87c8f0SMartin Botka 		.enable_mask = BIT(0),
6016e87c8f0SMartin Botka 		.hw.init = &(struct clk_init_data){
6026e87c8f0SMartin Botka 			.name = "disp_cc_xo_clk",
6036e87c8f0SMartin Botka 			.flags = CLK_IS_CRITICAL,
6046e87c8f0SMartin Botka 			.ops = &clk_branch2_ops,
6056e87c8f0SMartin Botka 		},
6066e87c8f0SMartin Botka 	},
6076e87c8f0SMartin Botka };
6086e87c8f0SMartin Botka 
6096e87c8f0SMartin Botka static struct gdsc mdss_gdsc = {
6106e87c8f0SMartin Botka 	.gdscr = 0x3000,
6116e87c8f0SMartin Botka 	.pd = {
6126e87c8f0SMartin Botka 		.name = "mdss_gdsc",
6136e87c8f0SMartin Botka 	},
6146e87c8f0SMartin Botka 	.pwrsts = PWRSTS_OFF_ON,
6156e87c8f0SMartin Botka 	.flags = HW_CTRL,
6166e87c8f0SMartin Botka };
6176e87c8f0SMartin Botka 
6186e87c8f0SMartin Botka static struct clk_regmap *disp_cc_sm6125_clocks[] = {
6196e87c8f0SMartin Botka 	[DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
6206e87c8f0SMartin Botka 	[DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
6216e87c8f0SMartin Botka 	[DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
6226e87c8f0SMartin Botka 	[DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
6236e87c8f0SMartin Botka 	[DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
6246e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_AUX_CLK] = &disp_cc_mdss_dp_aux_clk.clkr,
6256e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_AUX_CLK_SRC] = &disp_cc_mdss_dp_aux_clk_src.clkr,
6266e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_CRYPTO_CLK] = &disp_cc_mdss_dp_crypto_clk.clkr,
6276e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_CRYPTO_CLK_SRC] = &disp_cc_mdss_dp_crypto_clk_src.clkr,
6286e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_LINK_CLK] = &disp_cc_mdss_dp_link_clk.clkr,
6296e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_LINK_CLK_SRC] = &disp_cc_mdss_dp_link_clk_src.clkr,
6306e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_LINK_INTF_CLK] = &disp_cc_mdss_dp_link_intf_clk.clkr,
6316e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_PIXEL_CLK] = &disp_cc_mdss_dp_pixel_clk.clkr,
6326e87c8f0SMartin Botka 	[DISP_CC_MDSS_DP_PIXEL_CLK_SRC] = &disp_cc_mdss_dp_pixel_clk_src.clkr,
6336e87c8f0SMartin Botka 	[DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
6346e87c8f0SMartin Botka 	[DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
6356e87c8f0SMartin Botka 	[DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
6366e87c8f0SMartin Botka 	[DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
6376e87c8f0SMartin Botka 	[DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
6386e87c8f0SMartin Botka 	[DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
6396e87c8f0SMartin Botka 	[DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
6406e87c8f0SMartin Botka 	[DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
6416e87c8f0SMartin Botka 	[DISP_CC_MDSS_ROT_CLK] = &disp_cc_mdss_rot_clk.clkr,
6426e87c8f0SMartin Botka 	[DISP_CC_MDSS_ROT_CLK_SRC] = &disp_cc_mdss_rot_clk_src.clkr,
6436e87c8f0SMartin Botka 	[DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
6446e87c8f0SMartin Botka 	[DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
6456e87c8f0SMartin Botka 	[DISP_CC_PLL0] = &disp_cc_pll0.clkr,
6466e87c8f0SMartin Botka 	[DISP_CC_XO_CLK] = &disp_cc_xo_clk.clkr,
6476e87c8f0SMartin Botka };
6486e87c8f0SMartin Botka 
6496e87c8f0SMartin Botka static struct gdsc *disp_cc_sm6125_gdscs[] = {
6506e87c8f0SMartin Botka 	[MDSS_GDSC] = &mdss_gdsc,
6516e87c8f0SMartin Botka };
6526e87c8f0SMartin Botka 
6536e87c8f0SMartin Botka static const struct regmap_config disp_cc_sm6125_regmap_config = {
6546e87c8f0SMartin Botka 	.reg_bits = 32,
6556e87c8f0SMartin Botka 	.reg_stride = 4,
6566e87c8f0SMartin Botka 	.val_bits = 32,
6576e87c8f0SMartin Botka 	.max_register = 0x10000,
6586e87c8f0SMartin Botka 	.fast_io = true,
6596e87c8f0SMartin Botka };
6606e87c8f0SMartin Botka 
6616e87c8f0SMartin Botka static const struct qcom_cc_desc disp_cc_sm6125_desc = {
6626e87c8f0SMartin Botka 	.config = &disp_cc_sm6125_regmap_config,
6636e87c8f0SMartin Botka 	.clks = disp_cc_sm6125_clocks,
6646e87c8f0SMartin Botka 	.num_clks = ARRAY_SIZE(disp_cc_sm6125_clocks),
6656e87c8f0SMartin Botka 	.gdscs = disp_cc_sm6125_gdscs,
6666e87c8f0SMartin Botka 	.num_gdscs = ARRAY_SIZE(disp_cc_sm6125_gdscs),
6676e87c8f0SMartin Botka };
6686e87c8f0SMartin Botka 
6696e87c8f0SMartin Botka static const struct of_device_id disp_cc_sm6125_match_table[] = {
670c045154cSMarijn Suijten 	{ .compatible = "qcom,sm6125-dispcc" },
6716e87c8f0SMartin Botka 	{ }
6726e87c8f0SMartin Botka };
6736e87c8f0SMartin Botka MODULE_DEVICE_TABLE(of, disp_cc_sm6125_match_table);
6746e87c8f0SMartin Botka 
disp_cc_sm6125_probe(struct platform_device * pdev)6756e87c8f0SMartin Botka static int disp_cc_sm6125_probe(struct platform_device *pdev)
6766e87c8f0SMartin Botka {
6776e87c8f0SMartin Botka 	struct regmap *regmap;
6786e87c8f0SMartin Botka 
6796e87c8f0SMartin Botka 	regmap = qcom_cc_map(pdev, &disp_cc_sm6125_desc);
6806e87c8f0SMartin Botka 	if (IS_ERR(regmap))
6816e87c8f0SMartin Botka 		return PTR_ERR(regmap);
6826e87c8f0SMartin Botka 
6836e87c8f0SMartin Botka 	clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
6846e87c8f0SMartin Botka 
685*9f93a0a4SLuo Jie 	return qcom_cc_really_probe(&pdev->dev, &disp_cc_sm6125_desc, regmap);
6866e87c8f0SMartin Botka }
6876e87c8f0SMartin Botka 
6886e87c8f0SMartin Botka static struct platform_driver disp_cc_sm6125_driver = {
6896e87c8f0SMartin Botka 	.probe = disp_cc_sm6125_probe,
6906e87c8f0SMartin Botka 	.driver = {
6916e87c8f0SMartin Botka 		.name = "disp_cc-sm6125",
6926e87c8f0SMartin Botka 		.of_match_table = disp_cc_sm6125_match_table,
6936e87c8f0SMartin Botka 	},
6946e87c8f0SMartin Botka };
6956e87c8f0SMartin Botka 
696c334ecf3SDmitry Baryshkov module_platform_driver(disp_cc_sm6125_driver);
6976e87c8f0SMartin Botka 
6986e87c8f0SMartin Botka MODULE_DESCRIPTION("QTI DISPCC SM6125 Driver");
6996e87c8f0SMartin Botka MODULE_LICENSE("GPL v2");
700