1*dd3d0662STaniya Das // SPDX-License-Identifier: GPL-2.0-only 2*dd3d0662STaniya Das /* 3*dd3d0662STaniya Das * Copyright (c) 2019, The Linux Foundation. All rights reserved. 4*dd3d0662STaniya Das */ 5*dd3d0662STaniya Das 6*dd3d0662STaniya Das #include <linux/clk-provider.h> 7*dd3d0662STaniya Das #include <linux/module.h> 8*dd3d0662STaniya Das #include <linux/platform_device.h> 9*dd3d0662STaniya Das #include <linux/regmap.h> 10*dd3d0662STaniya Das 11*dd3d0662STaniya Das #include <dt-bindings/clock/qcom,dispcc-sc7180.h> 12*dd3d0662STaniya Das 13*dd3d0662STaniya Das #include "clk-alpha-pll.h" 14*dd3d0662STaniya Das #include "clk-branch.h" 15*dd3d0662STaniya Das #include "clk-rcg.h" 16*dd3d0662STaniya Das #include "clk-regmap-divider.h" 17*dd3d0662STaniya Das #include "common.h" 18*dd3d0662STaniya Das #include "gdsc.h" 19*dd3d0662STaniya Das 20*dd3d0662STaniya Das enum { 21*dd3d0662STaniya Das P_BI_TCXO, 22*dd3d0662STaniya Das P_CHIP_SLEEP_CLK, 23*dd3d0662STaniya Das P_CORE_BI_PLL_TEST_SE, 24*dd3d0662STaniya Das P_DISP_CC_PLL0_OUT_EVEN, 25*dd3d0662STaniya Das P_DISP_CC_PLL0_OUT_MAIN, 26*dd3d0662STaniya Das P_DP_PHY_PLL_LINK_CLK, 27*dd3d0662STaniya Das P_DP_PHY_PLL_VCO_DIV_CLK, 28*dd3d0662STaniya Das P_DSI0_PHY_PLL_OUT_BYTECLK, 29*dd3d0662STaniya Das P_DSI0_PHY_PLL_OUT_DSICLK, 30*dd3d0662STaniya Das P_GPLL0_OUT_MAIN, 31*dd3d0662STaniya Das }; 32*dd3d0662STaniya Das 33*dd3d0662STaniya Das static const struct pll_vco fabia_vco[] = { 34*dd3d0662STaniya Das { 249600000, 2000000000, 0 }, 35*dd3d0662STaniya Das }; 36*dd3d0662STaniya Das 37*dd3d0662STaniya Das static struct clk_alpha_pll disp_cc_pll0 = { 38*dd3d0662STaniya Das .offset = 0x0, 39*dd3d0662STaniya Das .vco_table = fabia_vco, 40*dd3d0662STaniya Das .num_vco = ARRAY_SIZE(fabia_vco), 41*dd3d0662STaniya Das .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA], 42*dd3d0662STaniya Das .clkr = { 43*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 44*dd3d0662STaniya Das .name = "disp_cc_pll0", 45*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 46*dd3d0662STaniya Das .fw_name = "bi_tcxo", 47*dd3d0662STaniya Das }, 48*dd3d0662STaniya Das .num_parents = 1, 49*dd3d0662STaniya Das .ops = &clk_alpha_pll_fabia_ops, 50*dd3d0662STaniya Das }, 51*dd3d0662STaniya Das }, 52*dd3d0662STaniya Das }; 53*dd3d0662STaniya Das 54*dd3d0662STaniya Das static const struct clk_div_table post_div_table_disp_cc_pll0_out_even[] = { 55*dd3d0662STaniya Das { 0x0, 1 }, 56*dd3d0662STaniya Das { } 57*dd3d0662STaniya Das }; 58*dd3d0662STaniya Das 59*dd3d0662STaniya Das static struct clk_alpha_pll_postdiv disp_cc_pll0_out_even = { 60*dd3d0662STaniya Das .offset = 0x0, 61*dd3d0662STaniya Das .post_div_shift = 8, 62*dd3d0662STaniya Das .post_div_table = post_div_table_disp_cc_pll0_out_even, 63*dd3d0662STaniya Das .num_post_div = ARRAY_SIZE(post_div_table_disp_cc_pll0_out_even), 64*dd3d0662STaniya Das .width = 4, 65*dd3d0662STaniya Das .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA], 66*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 67*dd3d0662STaniya Das .name = "disp_cc_pll0_out_even", 68*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 69*dd3d0662STaniya Das .hw = &disp_cc_pll0.clkr.hw, 70*dd3d0662STaniya Das }, 71*dd3d0662STaniya Das .num_parents = 1, 72*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 73*dd3d0662STaniya Das .ops = &clk_alpha_pll_postdiv_fabia_ops, 74*dd3d0662STaniya Das }, 75*dd3d0662STaniya Das }; 76*dd3d0662STaniya Das 77*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_0[] = { 78*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 79*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 80*dd3d0662STaniya Das }; 81*dd3d0662STaniya Das 82*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_0[] = { 83*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 84*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 85*dd3d0662STaniya Das }; 86*dd3d0662STaniya Das 87*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_1[] = { 88*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 89*dd3d0662STaniya Das { P_DP_PHY_PLL_LINK_CLK, 1 }, 90*dd3d0662STaniya Das { P_DP_PHY_PLL_VCO_DIV_CLK, 2 }, 91*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 92*dd3d0662STaniya Das }; 93*dd3d0662STaniya Das 94*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_1[] = { 95*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 96*dd3d0662STaniya Das { .fw_name = "dp_phy_pll_link_clk", .name = "dp_phy_pll_link_clk" }, 97*dd3d0662STaniya Das { .fw_name = "dp_phy_pll_vco_div_clk", 98*dd3d0662STaniya Das .name = "dp_phy_pll_vco_div_clk"}, 99*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 100*dd3d0662STaniya Das }; 101*dd3d0662STaniya Das 102*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_2[] = { 103*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 104*dd3d0662STaniya Das { P_DSI0_PHY_PLL_OUT_BYTECLK, 1 }, 105*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 106*dd3d0662STaniya Das }; 107*dd3d0662STaniya Das 108*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_2[] = { 109*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 110*dd3d0662STaniya Das { .fw_name = "dsi0_phy_pll_out_byteclk", 111*dd3d0662STaniya Das .name = "dsi0_phy_pll_out_byteclk" }, 112*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 113*dd3d0662STaniya Das }; 114*dd3d0662STaniya Das 115*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_3[] = { 116*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 117*dd3d0662STaniya Das { P_DISP_CC_PLL0_OUT_MAIN, 1 }, 118*dd3d0662STaniya Das { P_GPLL0_OUT_MAIN, 4 }, 119*dd3d0662STaniya Das { P_DISP_CC_PLL0_OUT_EVEN, 5 }, 120*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 121*dd3d0662STaniya Das }; 122*dd3d0662STaniya Das 123*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_3[] = { 124*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 125*dd3d0662STaniya Das { .hw = &disp_cc_pll0.clkr.hw }, 126*dd3d0662STaniya Das { .fw_name = "gcc_disp_gpll0_clk_src" }, 127*dd3d0662STaniya Das { .hw = &disp_cc_pll0_out_even.clkr.hw }, 128*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 129*dd3d0662STaniya Das }; 130*dd3d0662STaniya Das 131*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_4[] = { 132*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 133*dd3d0662STaniya Das { P_GPLL0_OUT_MAIN, 4 }, 134*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 135*dd3d0662STaniya Das }; 136*dd3d0662STaniya Das 137*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_4[] = { 138*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 139*dd3d0662STaniya Das { .fw_name = "gcc_disp_gpll0_clk_src" }, 140*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 141*dd3d0662STaniya Das }; 142*dd3d0662STaniya Das 143*dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_5[] = { 144*dd3d0662STaniya Das { P_BI_TCXO, 0 }, 145*dd3d0662STaniya Das { P_DSI0_PHY_PLL_OUT_DSICLK, 1 }, 146*dd3d0662STaniya Das { P_CORE_BI_PLL_TEST_SE, 7 }, 147*dd3d0662STaniya Das }; 148*dd3d0662STaniya Das 149*dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_5[] = { 150*dd3d0662STaniya Das { .fw_name = "bi_tcxo" }, 151*dd3d0662STaniya Das { .fw_name = "dsi0_phy_pll_out_dsiclk", 152*dd3d0662STaniya Das .name = "dsi0_phy_pll_out_dsiclk" }, 153*dd3d0662STaniya Das { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" }, 154*dd3d0662STaniya Das }; 155*dd3d0662STaniya Das 156*dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = { 157*dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0), 158*dd3d0662STaniya Das F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0), 159*dd3d0662STaniya Das F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0), 160*dd3d0662STaniya Das { } 161*dd3d0662STaniya Das }; 162*dd3d0662STaniya Das 163*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = { 164*dd3d0662STaniya Das .cmd_rcgr = 0x22bc, 165*dd3d0662STaniya Das .mnd_width = 0, 166*dd3d0662STaniya Das .hid_width = 5, 167*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_4, 168*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src, 169*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 170*dd3d0662STaniya Das .name = "disp_cc_mdss_ahb_clk_src", 171*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_4, 172*dd3d0662STaniya Das .num_parents = 3, 173*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 174*dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops, 175*dd3d0662STaniya Das }, 176*dd3d0662STaniya Das }; 177*dd3d0662STaniya Das 178*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = { 179*dd3d0662STaniya Das .cmd_rcgr = 0x2110, 180*dd3d0662STaniya Das .mnd_width = 0, 181*dd3d0662STaniya Das .hid_width = 5, 182*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_2, 183*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 184*dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_clk_src", 185*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_2, 186*dd3d0662STaniya Das .num_parents = 3, 187*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 188*dd3d0662STaniya Das .ops = &clk_byte2_ops, 189*dd3d0662STaniya Das }, 190*dd3d0662STaniya Das }; 191*dd3d0662STaniya Das 192*dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux_clk_src[] = { 193*dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0), 194*dd3d0662STaniya Das { } 195*dd3d0662STaniya Das }; 196*dd3d0662STaniya Das 197*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = { 198*dd3d0662STaniya Das .cmd_rcgr = 0x21dc, 199*dd3d0662STaniya Das .mnd_width = 0, 200*dd3d0662STaniya Das .hid_width = 5, 201*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_0, 202*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src, 203*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 204*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_aux_clk_src", 205*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_0, 206*dd3d0662STaniya Das .num_parents = 2, 207*dd3d0662STaniya Das .ops = &clk_rcg2_ops, 208*dd3d0662STaniya Das }, 209*dd3d0662STaniya Das }; 210*dd3d0662STaniya Das 211*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = { 212*dd3d0662STaniya Das .cmd_rcgr = 0x2194, 213*dd3d0662STaniya Das .mnd_width = 0, 214*dd3d0662STaniya Das .hid_width = 5, 215*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1, 216*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 217*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_crypto_clk_src", 218*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1, 219*dd3d0662STaniya Das .num_parents = 4, 220*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 221*dd3d0662STaniya Das .ops = &clk_byte2_ops, 222*dd3d0662STaniya Das }, 223*dd3d0662STaniya Das }; 224*dd3d0662STaniya Das 225*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = { 226*dd3d0662STaniya Das .cmd_rcgr = 0x2178, 227*dd3d0662STaniya Das .mnd_width = 0, 228*dd3d0662STaniya Das .hid_width = 5, 229*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1, 230*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 231*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_clk_src", 232*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1, 233*dd3d0662STaniya Das .num_parents = 4, 234*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 235*dd3d0662STaniya Das .ops = &clk_byte2_ops, 236*dd3d0662STaniya Das }, 237*dd3d0662STaniya Das }; 238*dd3d0662STaniya Das 239*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src = { 240*dd3d0662STaniya Das .cmd_rcgr = 0x21ac, 241*dd3d0662STaniya Das .mnd_width = 16, 242*dd3d0662STaniya Das .hid_width = 5, 243*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1, 244*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 245*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_pixel_clk_src", 246*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1, 247*dd3d0662STaniya Das .num_parents = 4, 248*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 249*dd3d0662STaniya Das .ops = &clk_dp_ops, 250*dd3d0662STaniya Das }, 251*dd3d0662STaniya Das }; 252*dd3d0662STaniya Das 253*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { 254*dd3d0662STaniya Das .cmd_rcgr = 0x2148, 255*dd3d0662STaniya Das .mnd_width = 0, 256*dd3d0662STaniya Das .hid_width = 5, 257*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_2, 258*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src, 259*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 260*dd3d0662STaniya Das .name = "disp_cc_mdss_esc0_clk_src", 261*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_2, 262*dd3d0662STaniya Das .num_parents = 3, 263*dd3d0662STaniya Das .ops = &clk_rcg2_ops, 264*dd3d0662STaniya Das }, 265*dd3d0662STaniya Das }; 266*dd3d0662STaniya Das 267*dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = { 268*dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0), 269*dd3d0662STaniya Das F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0), 270*dd3d0662STaniya Das F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0), 271*dd3d0662STaniya Das F(345000000, P_DISP_CC_PLL0_OUT_MAIN, 4, 0, 0), 272*dd3d0662STaniya Das F(460000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 273*dd3d0662STaniya Das { } 274*dd3d0662STaniya Das }; 275*dd3d0662STaniya Das 276*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = { 277*dd3d0662STaniya Das .cmd_rcgr = 0x20c8, 278*dd3d0662STaniya Das .mnd_width = 0, 279*dd3d0662STaniya Das .hid_width = 5, 280*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_3, 281*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src, 282*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 283*dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_clk_src", 284*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_3, 285*dd3d0662STaniya Das .num_parents = 5, 286*dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops, 287*dd3d0662STaniya Das }, 288*dd3d0662STaniya Das }; 289*dd3d0662STaniya Das 290*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = { 291*dd3d0662STaniya Das .cmd_rcgr = 0x2098, 292*dd3d0662STaniya Das .mnd_width = 8, 293*dd3d0662STaniya Das .hid_width = 5, 294*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_5, 295*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 296*dd3d0662STaniya Das .name = "disp_cc_mdss_pclk0_clk_src", 297*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_5, 298*dd3d0662STaniya Das .num_parents = 3, 299*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 300*dd3d0662STaniya Das .ops = &clk_pixel_ops, 301*dd3d0662STaniya Das }, 302*dd3d0662STaniya Das }; 303*dd3d0662STaniya Das 304*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_rot_clk_src = { 305*dd3d0662STaniya Das .cmd_rcgr = 0x20e0, 306*dd3d0662STaniya Das .mnd_width = 0, 307*dd3d0662STaniya Das .hid_width = 5, 308*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_3, 309*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src, 310*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 311*dd3d0662STaniya Das .name = "disp_cc_mdss_rot_clk_src", 312*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_3, 313*dd3d0662STaniya Das .num_parents = 5, 314*dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops, 315*dd3d0662STaniya Das }, 316*dd3d0662STaniya Das }; 317*dd3d0662STaniya Das 318*dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { 319*dd3d0662STaniya Das .cmd_rcgr = 0x20f8, 320*dd3d0662STaniya Das .mnd_width = 0, 321*dd3d0662STaniya Das .hid_width = 5, 322*dd3d0662STaniya Das .parent_map = disp_cc_parent_map_0, 323*dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src, 324*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){ 325*dd3d0662STaniya Das .name = "disp_cc_mdss_vsync_clk_src", 326*dd3d0662STaniya Das .parent_data = disp_cc_parent_data_0, 327*dd3d0662STaniya Das .num_parents = 2, 328*dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops, 329*dd3d0662STaniya Das }, 330*dd3d0662STaniya Das }; 331*dd3d0662STaniya Das 332*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_ahb_clk = { 333*dd3d0662STaniya Das .halt_reg = 0x2080, 334*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 335*dd3d0662STaniya Das .clkr = { 336*dd3d0662STaniya Das .enable_reg = 0x2080, 337*dd3d0662STaniya Das .enable_mask = BIT(0), 338*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 339*dd3d0662STaniya Das .name = "disp_cc_mdss_ahb_clk", 340*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 341*dd3d0662STaniya Das .hw = &disp_cc_mdss_ahb_clk_src.clkr.hw, 342*dd3d0662STaniya Das }, 343*dd3d0662STaniya Das .num_parents = 1, 344*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 345*dd3d0662STaniya Das .ops = &clk_branch2_ops, 346*dd3d0662STaniya Das }, 347*dd3d0662STaniya Das }, 348*dd3d0662STaniya Das }; 349*dd3d0662STaniya Das 350*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_byte0_clk = { 351*dd3d0662STaniya Das .halt_reg = 0x2028, 352*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 353*dd3d0662STaniya Das .clkr = { 354*dd3d0662STaniya Das .enable_reg = 0x2028, 355*dd3d0662STaniya Das .enable_mask = BIT(0), 356*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 357*dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_clk", 358*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 359*dd3d0662STaniya Das .hw = &disp_cc_mdss_byte0_clk_src.clkr.hw, 360*dd3d0662STaniya Das }, 361*dd3d0662STaniya Das .num_parents = 1, 362*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 363*dd3d0662STaniya Das .ops = &clk_branch2_ops, 364*dd3d0662STaniya Das }, 365*dd3d0662STaniya Das }, 366*dd3d0662STaniya Das }; 367*dd3d0662STaniya Das 368*dd3d0662STaniya Das static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = { 369*dd3d0662STaniya Das .reg = 0x2128, 370*dd3d0662STaniya Das .shift = 0, 371*dd3d0662STaniya Das .width = 2, 372*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data) { 373*dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_div_clk_src", 374*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 375*dd3d0662STaniya Das .hw = &disp_cc_mdss_byte0_clk_src.clkr.hw 376*dd3d0662STaniya Das }, 377*dd3d0662STaniya Das .num_parents = 1, 378*dd3d0662STaniya Das .ops = &clk_regmap_div_ops, 379*dd3d0662STaniya Das }, 380*dd3d0662STaniya Das }; 381*dd3d0662STaniya Das 382*dd3d0662STaniya Das static struct clk_regmap_div disp_cc_mdss_dp_link_div_clk_src = { 383*dd3d0662STaniya Das .reg = 0x2190, 384*dd3d0662STaniya Das .shift = 0, 385*dd3d0662STaniya Das .width = 2, 386*dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data) { 387*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_div_clk_src", 388*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 389*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_link_clk_src.clkr.hw 390*dd3d0662STaniya Das }, 391*dd3d0662STaniya Das .num_parents = 1, 392*dd3d0662STaniya Das .ops = &clk_regmap_div_ops, 393*dd3d0662STaniya Das }, 394*dd3d0662STaniya Das }; 395*dd3d0662STaniya Das 396*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_byte0_intf_clk = { 397*dd3d0662STaniya Das .halt_reg = 0x202c, 398*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 399*dd3d0662STaniya Das .clkr = { 400*dd3d0662STaniya Das .enable_reg = 0x202c, 401*dd3d0662STaniya Das .enable_mask = BIT(0), 402*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 403*dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_intf_clk", 404*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 405*dd3d0662STaniya Das .hw = &disp_cc_mdss_byte0_div_clk_src.clkr.hw, 406*dd3d0662STaniya Das }, 407*dd3d0662STaniya Das .num_parents = 1, 408*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 409*dd3d0662STaniya Das .ops = &clk_branch2_ops, 410*dd3d0662STaniya Das }, 411*dd3d0662STaniya Das }, 412*dd3d0662STaniya Das }; 413*dd3d0662STaniya Das 414*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_aux_clk = { 415*dd3d0662STaniya Das .halt_reg = 0x2054, 416*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 417*dd3d0662STaniya Das .clkr = { 418*dd3d0662STaniya Das .enable_reg = 0x2054, 419*dd3d0662STaniya Das .enable_mask = BIT(0), 420*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 421*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_aux_clk", 422*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 423*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_aux_clk_src.clkr.hw, 424*dd3d0662STaniya Das }, 425*dd3d0662STaniya Das .num_parents = 1, 426*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 427*dd3d0662STaniya Das .ops = &clk_branch2_ops, 428*dd3d0662STaniya Das }, 429*dd3d0662STaniya Das }, 430*dd3d0662STaniya Das }; 431*dd3d0662STaniya Das 432*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_crypto_clk = { 433*dd3d0662STaniya Das .halt_reg = 0x2048, 434*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 435*dd3d0662STaniya Das .clkr = { 436*dd3d0662STaniya Das .enable_reg = 0x2048, 437*dd3d0662STaniya Das .enable_mask = BIT(0), 438*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 439*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_crypto_clk", 440*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 441*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_crypto_clk_src.clkr.hw, 442*dd3d0662STaniya Das }, 443*dd3d0662STaniya Das .num_parents = 1, 444*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 445*dd3d0662STaniya Das .ops = &clk_branch2_ops, 446*dd3d0662STaniya Das }, 447*dd3d0662STaniya Das }, 448*dd3d0662STaniya Das }; 449*dd3d0662STaniya Das 450*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_link_clk = { 451*dd3d0662STaniya Das .halt_reg = 0x2040, 452*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 453*dd3d0662STaniya Das .clkr = { 454*dd3d0662STaniya Das .enable_reg = 0x2040, 455*dd3d0662STaniya Das .enable_mask = BIT(0), 456*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 457*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_clk", 458*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 459*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_link_clk_src.clkr.hw, 460*dd3d0662STaniya Das }, 461*dd3d0662STaniya Das .num_parents = 1, 462*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 463*dd3d0662STaniya Das .ops = &clk_branch2_ops, 464*dd3d0662STaniya Das }, 465*dd3d0662STaniya Das }, 466*dd3d0662STaniya Das }; 467*dd3d0662STaniya Das 468*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_link_intf_clk = { 469*dd3d0662STaniya Das .halt_reg = 0x2044, 470*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 471*dd3d0662STaniya Das .clkr = { 472*dd3d0662STaniya Das .enable_reg = 0x2044, 473*dd3d0662STaniya Das .enable_mask = BIT(0), 474*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 475*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_intf_clk", 476*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 477*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_link_div_clk_src.clkr.hw, 478*dd3d0662STaniya Das }, 479*dd3d0662STaniya Das .num_parents = 1, 480*dd3d0662STaniya Das .ops = &clk_branch2_ops, 481*dd3d0662STaniya Das }, 482*dd3d0662STaniya Das }, 483*dd3d0662STaniya Das }; 484*dd3d0662STaniya Das 485*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_pixel_clk = { 486*dd3d0662STaniya Das .halt_reg = 0x204c, 487*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 488*dd3d0662STaniya Das .clkr = { 489*dd3d0662STaniya Das .enable_reg = 0x204c, 490*dd3d0662STaniya Das .enable_mask = BIT(0), 491*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 492*dd3d0662STaniya Das .name = "disp_cc_mdss_dp_pixel_clk", 493*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 494*dd3d0662STaniya Das .hw = &disp_cc_mdss_dp_pixel_clk_src.clkr.hw, 495*dd3d0662STaniya Das }, 496*dd3d0662STaniya Das .num_parents = 1, 497*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 498*dd3d0662STaniya Das .ops = &clk_branch2_ops, 499*dd3d0662STaniya Das }, 500*dd3d0662STaniya Das }, 501*dd3d0662STaniya Das }; 502*dd3d0662STaniya Das 503*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_esc0_clk = { 504*dd3d0662STaniya Das .halt_reg = 0x2038, 505*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 506*dd3d0662STaniya Das .clkr = { 507*dd3d0662STaniya Das .enable_reg = 0x2038, 508*dd3d0662STaniya Das .enable_mask = BIT(0), 509*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 510*dd3d0662STaniya Das .name = "disp_cc_mdss_esc0_clk", 511*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 512*dd3d0662STaniya Das .hw = &disp_cc_mdss_esc0_clk_src.clkr.hw, 513*dd3d0662STaniya Das }, 514*dd3d0662STaniya Das .num_parents = 1, 515*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 516*dd3d0662STaniya Das .ops = &clk_branch2_ops, 517*dd3d0662STaniya Das }, 518*dd3d0662STaniya Das }, 519*dd3d0662STaniya Das }; 520*dd3d0662STaniya Das 521*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_mdp_clk = { 522*dd3d0662STaniya Das .halt_reg = 0x200c, 523*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 524*dd3d0662STaniya Das .clkr = { 525*dd3d0662STaniya Das .enable_reg = 0x200c, 526*dd3d0662STaniya Das .enable_mask = BIT(0), 527*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 528*dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_clk", 529*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 530*dd3d0662STaniya Das .hw = &disp_cc_mdss_mdp_clk_src.clkr.hw, 531*dd3d0662STaniya Das }, 532*dd3d0662STaniya Das .num_parents = 1, 533*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 534*dd3d0662STaniya Das .ops = &clk_branch2_ops, 535*dd3d0662STaniya Das }, 536*dd3d0662STaniya Das }, 537*dd3d0662STaniya Das }; 538*dd3d0662STaniya Das 539*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_mdp_lut_clk = { 540*dd3d0662STaniya Das .halt_reg = 0x201c, 541*dd3d0662STaniya Das .halt_check = BRANCH_VOTED, 542*dd3d0662STaniya Das .clkr = { 543*dd3d0662STaniya Das .enable_reg = 0x201c, 544*dd3d0662STaniya Das .enable_mask = BIT(0), 545*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 546*dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_lut_clk", 547*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 548*dd3d0662STaniya Das .hw = &disp_cc_mdss_mdp_clk_src.clkr.hw, 549*dd3d0662STaniya Das }, 550*dd3d0662STaniya Das .num_parents = 1, 551*dd3d0662STaniya Das .ops = &clk_branch2_ops, 552*dd3d0662STaniya Das }, 553*dd3d0662STaniya Das }, 554*dd3d0662STaniya Das }; 555*dd3d0662STaniya Das 556*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = { 557*dd3d0662STaniya Das .halt_reg = 0x4004, 558*dd3d0662STaniya Das .halt_check = BRANCH_VOTED, 559*dd3d0662STaniya Das .clkr = { 560*dd3d0662STaniya Das .enable_reg = 0x4004, 561*dd3d0662STaniya Das .enable_mask = BIT(0), 562*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 563*dd3d0662STaniya Das .name = "disp_cc_mdss_non_gdsc_ahb_clk", 564*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 565*dd3d0662STaniya Das .hw = &disp_cc_mdss_ahb_clk_src.clkr.hw, 566*dd3d0662STaniya Das }, 567*dd3d0662STaniya Das .num_parents = 1, 568*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 569*dd3d0662STaniya Das .ops = &clk_branch2_ops, 570*dd3d0662STaniya Das }, 571*dd3d0662STaniya Das }, 572*dd3d0662STaniya Das }; 573*dd3d0662STaniya Das 574*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_pclk0_clk = { 575*dd3d0662STaniya Das .halt_reg = 0x2004, 576*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 577*dd3d0662STaniya Das .clkr = { 578*dd3d0662STaniya Das .enable_reg = 0x2004, 579*dd3d0662STaniya Das .enable_mask = BIT(0), 580*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 581*dd3d0662STaniya Das .name = "disp_cc_mdss_pclk0_clk", 582*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 583*dd3d0662STaniya Das .hw = &disp_cc_mdss_pclk0_clk_src.clkr.hw, 584*dd3d0662STaniya Das }, 585*dd3d0662STaniya Das .num_parents = 1, 586*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 587*dd3d0662STaniya Das .ops = &clk_branch2_ops, 588*dd3d0662STaniya Das }, 589*dd3d0662STaniya Das }, 590*dd3d0662STaniya Das }; 591*dd3d0662STaniya Das 592*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_rot_clk = { 593*dd3d0662STaniya Das .halt_reg = 0x2014, 594*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 595*dd3d0662STaniya Das .clkr = { 596*dd3d0662STaniya Das .enable_reg = 0x2014, 597*dd3d0662STaniya Das .enable_mask = BIT(0), 598*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 599*dd3d0662STaniya Das .name = "disp_cc_mdss_rot_clk", 600*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 601*dd3d0662STaniya Das .hw = &disp_cc_mdss_rot_clk_src.clkr.hw, 602*dd3d0662STaniya Das }, 603*dd3d0662STaniya Das .num_parents = 1, 604*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 605*dd3d0662STaniya Das .ops = &clk_branch2_ops, 606*dd3d0662STaniya Das }, 607*dd3d0662STaniya Das }, 608*dd3d0662STaniya Das }; 609*dd3d0662STaniya Das 610*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_rscc_ahb_clk = { 611*dd3d0662STaniya Das .halt_reg = 0x400c, 612*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 613*dd3d0662STaniya Das .clkr = { 614*dd3d0662STaniya Das .enable_reg = 0x400c, 615*dd3d0662STaniya Das .enable_mask = BIT(0), 616*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 617*dd3d0662STaniya Das .name = "disp_cc_mdss_rscc_ahb_clk", 618*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 619*dd3d0662STaniya Das .hw = &disp_cc_mdss_ahb_clk_src.clkr.hw, 620*dd3d0662STaniya Das }, 621*dd3d0662STaniya Das .num_parents = 1, 622*dd3d0662STaniya Das .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 623*dd3d0662STaniya Das .ops = &clk_branch2_ops, 624*dd3d0662STaniya Das }, 625*dd3d0662STaniya Das }, 626*dd3d0662STaniya Das }; 627*dd3d0662STaniya Das 628*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_rscc_vsync_clk = { 629*dd3d0662STaniya Das .halt_reg = 0x4008, 630*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 631*dd3d0662STaniya Das .clkr = { 632*dd3d0662STaniya Das .enable_reg = 0x4008, 633*dd3d0662STaniya Das .enable_mask = BIT(0), 634*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 635*dd3d0662STaniya Das .name = "disp_cc_mdss_rscc_vsync_clk", 636*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 637*dd3d0662STaniya Das .hw = &disp_cc_mdss_vsync_clk_src.clkr.hw, 638*dd3d0662STaniya Das }, 639*dd3d0662STaniya Das .num_parents = 1, 640*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 641*dd3d0662STaniya Das .ops = &clk_branch2_ops, 642*dd3d0662STaniya Das }, 643*dd3d0662STaniya Das }, 644*dd3d0662STaniya Das }; 645*dd3d0662STaniya Das 646*dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_vsync_clk = { 647*dd3d0662STaniya Das .halt_reg = 0x2024, 648*dd3d0662STaniya Das .halt_check = BRANCH_HALT, 649*dd3d0662STaniya Das .clkr = { 650*dd3d0662STaniya Das .enable_reg = 0x2024, 651*dd3d0662STaniya Das .enable_mask = BIT(0), 652*dd3d0662STaniya Das .hw.init = &(struct clk_init_data){ 653*dd3d0662STaniya Das .name = "disp_cc_mdss_vsync_clk", 654*dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){ 655*dd3d0662STaniya Das .hw = &disp_cc_mdss_vsync_clk_src.clkr.hw, 656*dd3d0662STaniya Das }, 657*dd3d0662STaniya Das .num_parents = 1, 658*dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT, 659*dd3d0662STaniya Das .ops = &clk_branch2_ops, 660*dd3d0662STaniya Das }, 661*dd3d0662STaniya Das }, 662*dd3d0662STaniya Das }; 663*dd3d0662STaniya Das 664*dd3d0662STaniya Das static struct gdsc mdss_gdsc = { 665*dd3d0662STaniya Das .gdscr = 0x3000, 666*dd3d0662STaniya Das .pd = { 667*dd3d0662STaniya Das .name = "mdss_gdsc", 668*dd3d0662STaniya Das }, 669*dd3d0662STaniya Das .pwrsts = PWRSTS_OFF_ON, 670*dd3d0662STaniya Das .flags = HW_CTRL, 671*dd3d0662STaniya Das }; 672*dd3d0662STaniya Das 673*dd3d0662STaniya Das static struct gdsc *disp_cc_sc7180_gdscs[] = { 674*dd3d0662STaniya Das [MDSS_GDSC] = &mdss_gdsc, 675*dd3d0662STaniya Das }; 676*dd3d0662STaniya Das 677*dd3d0662STaniya Das static struct clk_regmap *disp_cc_sc7180_clocks[] = { 678*dd3d0662STaniya Das [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr, 679*dd3d0662STaniya Das [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr, 680*dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr, 681*dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr, 682*dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr, 683*dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr, 684*dd3d0662STaniya Das [DISP_CC_MDSS_DP_AUX_CLK] = &disp_cc_mdss_dp_aux_clk.clkr, 685*dd3d0662STaniya Das [DISP_CC_MDSS_DP_AUX_CLK_SRC] = &disp_cc_mdss_dp_aux_clk_src.clkr, 686*dd3d0662STaniya Das [DISP_CC_MDSS_DP_CRYPTO_CLK] = &disp_cc_mdss_dp_crypto_clk.clkr, 687*dd3d0662STaniya Das [DISP_CC_MDSS_DP_CRYPTO_CLK_SRC] = &disp_cc_mdss_dp_crypto_clk_src.clkr, 688*dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_CLK] = &disp_cc_mdss_dp_link_clk.clkr, 689*dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_CLK_SRC] = &disp_cc_mdss_dp_link_clk_src.clkr, 690*dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC] = 691*dd3d0662STaniya Das &disp_cc_mdss_dp_link_div_clk_src.clkr, 692*dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_INTF_CLK] = &disp_cc_mdss_dp_link_intf_clk.clkr, 693*dd3d0662STaniya Das [DISP_CC_MDSS_DP_PIXEL_CLK] = &disp_cc_mdss_dp_pixel_clk.clkr, 694*dd3d0662STaniya Das [DISP_CC_MDSS_DP_PIXEL_CLK_SRC] = &disp_cc_mdss_dp_pixel_clk_src.clkr, 695*dd3d0662STaniya Das [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr, 696*dd3d0662STaniya Das [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr, 697*dd3d0662STaniya Das [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr, 698*dd3d0662STaniya Das [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr, 699*dd3d0662STaniya Das [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr, 700*dd3d0662STaniya Das [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr, 701*dd3d0662STaniya Das [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr, 702*dd3d0662STaniya Das [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr, 703*dd3d0662STaniya Das [DISP_CC_MDSS_ROT_CLK] = &disp_cc_mdss_rot_clk.clkr, 704*dd3d0662STaniya Das [DISP_CC_MDSS_ROT_CLK_SRC] = &disp_cc_mdss_rot_clk_src.clkr, 705*dd3d0662STaniya Das [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr, 706*dd3d0662STaniya Das [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr, 707*dd3d0662STaniya Das [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr, 708*dd3d0662STaniya Das [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr, 709*dd3d0662STaniya Das [DISP_CC_PLL0] = &disp_cc_pll0.clkr, 710*dd3d0662STaniya Das [DISP_CC_PLL0_OUT_EVEN] = &disp_cc_pll0_out_even.clkr, 711*dd3d0662STaniya Das }; 712*dd3d0662STaniya Das 713*dd3d0662STaniya Das static const struct regmap_config disp_cc_sc7180_regmap_config = { 714*dd3d0662STaniya Das .reg_bits = 32, 715*dd3d0662STaniya Das .reg_stride = 4, 716*dd3d0662STaniya Das .val_bits = 32, 717*dd3d0662STaniya Das .max_register = 0x10000, 718*dd3d0662STaniya Das .fast_io = true, 719*dd3d0662STaniya Das }; 720*dd3d0662STaniya Das 721*dd3d0662STaniya Das static const struct qcom_cc_desc disp_cc_sc7180_desc = { 722*dd3d0662STaniya Das .config = &disp_cc_sc7180_regmap_config, 723*dd3d0662STaniya Das .clks = disp_cc_sc7180_clocks, 724*dd3d0662STaniya Das .num_clks = ARRAY_SIZE(disp_cc_sc7180_clocks), 725*dd3d0662STaniya Das .gdscs = disp_cc_sc7180_gdscs, 726*dd3d0662STaniya Das .num_gdscs = ARRAY_SIZE(disp_cc_sc7180_gdscs), 727*dd3d0662STaniya Das }; 728*dd3d0662STaniya Das 729*dd3d0662STaniya Das static const struct of_device_id disp_cc_sc7180_match_table[] = { 730*dd3d0662STaniya Das { .compatible = "qcom,sc7180-dispcc" }, 731*dd3d0662STaniya Das { } 732*dd3d0662STaniya Das }; 733*dd3d0662STaniya Das MODULE_DEVICE_TABLE(of, disp_cc_sc7180_match_table); 734*dd3d0662STaniya Das 735*dd3d0662STaniya Das static int disp_cc_sc7180_probe(struct platform_device *pdev) 736*dd3d0662STaniya Das { 737*dd3d0662STaniya Das struct regmap *regmap; 738*dd3d0662STaniya Das struct alpha_pll_config disp_cc_pll_config = {}; 739*dd3d0662STaniya Das 740*dd3d0662STaniya Das regmap = qcom_cc_map(pdev, &disp_cc_sc7180_desc); 741*dd3d0662STaniya Das if (IS_ERR(regmap)) 742*dd3d0662STaniya Das return PTR_ERR(regmap); 743*dd3d0662STaniya Das 744*dd3d0662STaniya Das /* 1380MHz configuration */ 745*dd3d0662STaniya Das disp_cc_pll_config.l = 0x47; 746*dd3d0662STaniya Das disp_cc_pll_config.alpha = 0xe000; 747*dd3d0662STaniya Das disp_cc_pll_config.user_ctl_val = 0x00000001; 748*dd3d0662STaniya Das disp_cc_pll_config.user_ctl_hi_val = 0x00004805; 749*dd3d0662STaniya Das 750*dd3d0662STaniya Das clk_fabia_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll_config); 751*dd3d0662STaniya Das 752*dd3d0662STaniya Das return qcom_cc_really_probe(pdev, &disp_cc_sc7180_desc, regmap); 753*dd3d0662STaniya Das } 754*dd3d0662STaniya Das 755*dd3d0662STaniya Das static struct platform_driver disp_cc_sc7180_driver = { 756*dd3d0662STaniya Das .probe = disp_cc_sc7180_probe, 757*dd3d0662STaniya Das .driver = { 758*dd3d0662STaniya Das .name = "sc7180-dispcc", 759*dd3d0662STaniya Das .of_match_table = disp_cc_sc7180_match_table, 760*dd3d0662STaniya Das }, 761*dd3d0662STaniya Das }; 762*dd3d0662STaniya Das 763*dd3d0662STaniya Das static int __init disp_cc_sc7180_init(void) 764*dd3d0662STaniya Das { 765*dd3d0662STaniya Das return platform_driver_register(&disp_cc_sc7180_driver); 766*dd3d0662STaniya Das } 767*dd3d0662STaniya Das subsys_initcall(disp_cc_sc7180_init); 768*dd3d0662STaniya Das 769*dd3d0662STaniya Das static void __exit disp_cc_sc7180_exit(void) 770*dd3d0662STaniya Das { 771*dd3d0662STaniya Das platform_driver_unregister(&disp_cc_sc7180_driver); 772*dd3d0662STaniya Das } 773*dd3d0662STaniya Das module_exit(disp_cc_sc7180_exit); 774*dd3d0662STaniya Das 775*dd3d0662STaniya Das MODULE_DESCRIPTION("QTI DISP_CC SC7180 Driver"); 776*dd3d0662STaniya Das MODULE_LICENSE("GPL v2"); 777