@@ -40,7 +40,7 @@ static const struct pll_vco lucid_evo_vco[] = {
4040 { 249600000 , 2000000000 , 0 },
4141};
4242
43- static struct alpha_pll_config gpu_cc_pll0_config = {
43+ static const struct alpha_pll_config gpu_cc_pll0_config = {
4444 .l = 0x1d ,
4545 .alpha = 0xb000 ,
4646 .config_ctl_val = 0x20485699 ,
@@ -50,6 +50,20 @@ static struct alpha_pll_config gpu_cc_pll0_config = {
5050 .user_ctl_hi_val = 0x00000805 ,
5151};
5252
53+ static const struct alpha_pll_config sm8475_gpu_cc_pll0_config = {
54+ .l = 0x1d ,
55+ .alpha = 0xb000 ,
56+ .config_ctl_val = 0x20485699 ,
57+ .config_ctl_hi_val = 0x00182261 ,
58+ .config_ctl_hi1_val = 0x82aa299c ,
59+ .test_ctl_val = 0x00000000 ,
60+ .test_ctl_hi_val = 0x00000003 ,
61+ .test_ctl_hi1_val = 0x00009000 ,
62+ .test_ctl_hi2_val = 0x00000034 ,
63+ .user_ctl_val = 0x00000000 ,
64+ .user_ctl_hi_val = 0x00000005 ,
65+ };
66+
5367static struct clk_alpha_pll gpu_cc_pll0 = {
5468 .offset = 0x0 ,
5569 .vco_table = lucid_evo_vco ,
@@ -67,7 +81,7 @@ static struct clk_alpha_pll gpu_cc_pll0 = {
6781 },
6882};
6983
70- static struct alpha_pll_config gpu_cc_pll1_config = {
84+ static const struct alpha_pll_config gpu_cc_pll1_config = {
7185 .l = 0x34 ,
7286 .alpha = 0x1555 ,
7387 .config_ctl_val = 0x20485699 ,
@@ -77,6 +91,20 @@ static struct alpha_pll_config gpu_cc_pll1_config = {
7791 .user_ctl_hi_val = 0x00000805 ,
7892};
7993
94+ static const struct alpha_pll_config sm8475_gpu_cc_pll1_config = {
95+ .l = 0x34 ,
96+ .alpha = 0x1555 ,
97+ .config_ctl_val = 0x20485699 ,
98+ .config_ctl_hi_val = 0x00182261 ,
99+ .config_ctl_hi1_val = 0x82aa299c ,
100+ .test_ctl_val = 0x00000000 ,
101+ .test_ctl_hi_val = 0x00000003 ,
102+ .test_ctl_hi1_val = 0x00009000 ,
103+ .test_ctl_hi2_val = 0x00000034 ,
104+ .user_ctl_val = 0x00000000 ,
105+ .user_ctl_hi_val = 0x00000005 ,
106+ };
107+
80108static struct clk_alpha_pll gpu_cc_pll1 = {
81109 .offset = 0x1000 ,
82110 .vco_table = lucid_evo_vco ,
@@ -736,6 +764,7 @@ static const struct qcom_cc_desc gpu_cc_sm8450_desc = {
736764
737765static const struct of_device_id gpu_cc_sm8450_match_table [] = {
738766 { .compatible = "qcom,sm8450-gpucc" },
767+ { .compatible = "qcom,sm8475-gpucc" },
739768 { }
740769};
741770MODULE_DEVICE_TABLE (of , gpu_cc_sm8450_match_table );
@@ -748,8 +777,19 @@ static int gpu_cc_sm8450_probe(struct platform_device *pdev)
748777 if (IS_ERR (regmap ))
749778 return PTR_ERR (regmap );
750779
751- clk_lucid_evo_pll_configure (& gpu_cc_pll0 , regmap , & gpu_cc_pll0_config );
752- clk_lucid_evo_pll_configure (& gpu_cc_pll1 , regmap , & gpu_cc_pll1_config );
780+ if (of_device_is_compatible (pdev -> dev .of_node , "qcom,sm8475-gpucc" )) {
781+ /* Update GPUCC PLL0 */
782+ gpu_cc_pll0 .regs = clk_alpha_pll_regs [CLK_ALPHA_PLL_TYPE_LUCID_OLE ];
783+
784+ /* Update GPUCC PLL1 */
785+ gpu_cc_pll1 .regs = clk_alpha_pll_regs [CLK_ALPHA_PLL_TYPE_LUCID_OLE ];
786+
787+ clk_lucid_ole_pll_configure (& gpu_cc_pll0 , regmap , & sm8475_gpu_cc_pll0_config );
788+ clk_lucid_ole_pll_configure (& gpu_cc_pll1 , regmap , & sm8475_gpu_cc_pll1_config );
789+ } else {
790+ clk_lucid_evo_pll_configure (& gpu_cc_pll0 , regmap , & gpu_cc_pll0_config );
791+ clk_lucid_evo_pll_configure (& gpu_cc_pll1 , regmap , & gpu_cc_pll1_config );
792+ }
753793
754794 return qcom_cc_really_probe (& pdev -> dev , & gpu_cc_sm8450_desc , regmap );
755795}
@@ -763,5 +803,5 @@ static struct platform_driver gpu_cc_sm8450_driver = {
763803};
764804module_platform_driver (gpu_cc_sm8450_driver );
765805
766- MODULE_DESCRIPTION ("QTI GPU_CC SM8450 Driver" );
806+ MODULE_DESCRIPTION ("QTI GPU_CC SM8450 / SM8475 Driver" );
767807MODULE_LICENSE ("GPL" );
0 commit comments