@@ -46,6 +46,21 @@ static const struct alpha_pll_config video_cc_pll0_config = {
4646 .user_ctl_hi_val = 0x00000805 ,
4747};
4848
49+ static const struct alpha_pll_config sm8475_video_cc_pll0_config = {
50+ /* .l includes CAL_L_VAL, L_VAL fields */
51+ .l = 0x1e ,
52+ .alpha = 0x0 ,
53+ .config_ctl_val = 0x20485699 ,
54+ .config_ctl_hi_val = 0x00182261 ,
55+ .config_ctl_hi1_val = 0x82aa299c ,
56+ .test_ctl_val = 0x00000000 ,
57+ .test_ctl_hi_val = 0x00000003 ,
58+ .test_ctl_hi1_val = 0x00009000 ,
59+ .test_ctl_hi2_val = 0x00000034 ,
60+ .user_ctl_val = 0x00000000 ,
61+ .user_ctl_hi_val = 0x00000005 ,
62+ };
63+
4964static struct clk_alpha_pll video_cc_pll0 = {
5065 .offset = 0x0 ,
5166 .vco_table = lucid_evo_vco ,
@@ -74,6 +89,21 @@ static const struct alpha_pll_config video_cc_pll1_config = {
7489 .user_ctl_hi_val = 0x00000805 ,
7590};
7691
92+ static const struct alpha_pll_config sm8475_video_cc_pll1_config = {
93+ /* .l includes CAL_L_VAL, L_VAL fields */
94+ .l = 0x2b ,
95+ .alpha = 0xc000 ,
96+ .config_ctl_val = 0x20485699 ,
97+ .config_ctl_hi_val = 0x00182261 ,
98+ .config_ctl_hi1_val = 0x82aa299c ,
99+ .test_ctl_val = 0x00000000 ,
100+ .test_ctl_hi_val = 0x00000003 ,
101+ .test_ctl_hi1_val = 0x00009000 ,
102+ .test_ctl_hi2_val = 0x00000034 ,
103+ .user_ctl_val = 0x00000000 ,
104+ .user_ctl_hi_val = 0x00000005 ,
105+ };
106+
77107static struct clk_alpha_pll video_cc_pll1 = {
78108 .offset = 0x1000 ,
79109 .vco_table = lucid_evo_vco ,
@@ -397,6 +427,7 @@ static struct qcom_cc_desc video_cc_sm8450_desc = {
397427
398428static const struct of_device_id video_cc_sm8450_match_table [] = {
399429 { .compatible = "qcom,sm8450-videocc" },
430+ { .compatible = "qcom,sm8475-videocc" },
400431 { }
401432};
402433MODULE_DEVICE_TABLE (of , video_cc_sm8450_match_table );
@@ -420,8 +451,19 @@ static int video_cc_sm8450_probe(struct platform_device *pdev)
420451 return PTR_ERR (regmap );
421452 }
422453
423- clk_lucid_evo_pll_configure (& video_cc_pll0 , regmap , & video_cc_pll0_config );
424- clk_lucid_evo_pll_configure (& video_cc_pll1 , regmap , & video_cc_pll1_config );
454+ if (of_device_is_compatible (pdev -> dev .of_node , "qcom,sm8475-videocc" )) {
455+ /* Update VideoCC PLL0 */
456+ video_cc_pll0 .regs = clk_alpha_pll_regs [CLK_ALPHA_PLL_TYPE_LUCID_OLE ];
457+
458+ /* Update VideoCC PLL1 */
459+ video_cc_pll1 .regs = clk_alpha_pll_regs [CLK_ALPHA_PLL_TYPE_LUCID_OLE ];
460+
461+ clk_lucid_ole_pll_configure (& video_cc_pll0 , regmap , & sm8475_video_cc_pll0_config );
462+ clk_lucid_ole_pll_configure (& video_cc_pll1 , regmap , & sm8475_video_cc_pll1_config );
463+ } else {
464+ clk_lucid_evo_pll_configure (& video_cc_pll0 , regmap , & video_cc_pll0_config );
465+ clk_lucid_evo_pll_configure (& video_cc_pll1 , regmap , & video_cc_pll1_config );
466+ }
425467
426468 /* Keep some clocks always-on */
427469 qcom_branch_set_clk_en (regmap , 0x80e4 ); /* VIDEO_CC_AHB_CLK */
@@ -445,5 +487,5 @@ static struct platform_driver video_cc_sm8450_driver = {
445487
446488module_platform_driver (video_cc_sm8450_driver );
447489
448- MODULE_DESCRIPTION ("QTI VIDEOCC SM8450 Driver" );
490+ MODULE_DESCRIPTION ("QTI VIDEOCC SM8450 / SM8475 Driver" );
449491MODULE_LICENSE ("GPL" );
0 commit comments