1
- // SPDX-License-Identifier: GPL-2.0
1
+ // SPDX-License-Identifier: GPL-2.0-only
2
2
/*
3
- * Copyright (c) 2022, David Wronek <[email protected] >
3
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4
+ * Copyright (c) 2023, David Wronek <[email protected] >
4
5
*/
5
6
6
7
#include <linux/clk-provider.h>
16
17
#include "clk-regmap-divider.h"
17
18
#include "common.h"
18
19
#include "gdsc.h"
20
+ #include "reset.h"
19
21
20
22
enum {
21
23
P_BI_TCXO ,
@@ -34,6 +36,13 @@ static const struct pll_vco fabia_vco[] = {
34
36
{ 249600000 , 2000000000 , 0 },
35
37
};
36
38
39
+ /* 860MHz configuration */
40
+ static const struct alpha_pll_config disp_cc_pll0_config = {
41
+ .l = 0x2c ,
42
+ .alpha = 0xcaaa ,
43
+ .test_ctl_val = 0x40000000 ,
44
+ };
45
+
37
46
static struct clk_alpha_pll disp_cc_pll0 = {
38
47
.offset = 0x0 ,
39
48
.vco_table = fabia_vco ,
@@ -348,13 +357,13 @@ static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
348
357
};
349
358
350
359
static const struct freq_tbl ftbl_disp_cc_mdss_rot_clk_src [] = {
351
- F (19200000 , P_BI_TCXO , 1 , 0 , 0 ),
352
- F (171428571 , P_GPLL0_OUT_MAIN , 3.5 , 0 , 0 ),
353
- F (200000000 , P_GPLL0_OUT_MAIN , 3 , 0 , 0 ),
354
- F (300000000 , P_GPLL0_OUT_MAIN , 2 , 0 , 0 ),
355
- F (344000000 , P_DISP_CC_PLL0_OUT_MAIN , 2.5 , 0 , 0 ),
356
- F (430000000 , P_DISP_CC_PLL0_OUT_MAIN , 2 , 0 , 0 ),
357
- { }
360
+ F (19200000 , P_BI_TCXO , 1 , 0 , 0 ),
361
+ F (171428571 , P_GPLL0_OUT_MAIN , 3.5 , 0 , 0 ),
362
+ F (200000000 , P_GPLL0_OUT_MAIN , 3 , 0 , 0 ),
363
+ F (300000000 , P_GPLL0_OUT_MAIN , 2 , 0 , 0 ),
364
+ F (344000000 , P_DISP_CC_PLL0_OUT_MAIN , 2.5 , 0 , 0 ),
365
+ F (430000000 , P_DISP_CC_PLL0_OUT_MAIN , 2 , 0 , 0 ),
366
+ { }
358
367
};
359
368
360
369
static struct clk_rcg2 disp_cc_mdss_rot_clk_src = {
@@ -801,10 +810,6 @@ static struct gdsc mdss_gdsc = {
801
810
.flags = HW_CTRL ,
802
811
};
803
812
804
- static struct gdsc * disp_cc_sm7150_gdscs [] = {
805
- [MDSS_GDSC ] = & mdss_gdsc ,
806
- };
807
-
808
813
static struct clk_regmap * disp_cc_sm7150_clocks [] = {
809
814
[DISP_CC_MDSS_AHB_CLK ] = & disp_cc_mdss_ahb_clk .clkr ,
810
815
[DISP_CC_MDSS_AHB_CLK_SRC ] = & disp_cc_mdss_ahb_clk_src .clkr ,
@@ -848,12 +853,16 @@ static struct clk_regmap *disp_cc_sm7150_clocks[] = {
848
853
[DISP_CC_PLL0_OUT_EVEN ] = & disp_cc_pll0_out_even .clkr ,
849
854
};
850
855
856
+ static struct gdsc * disp_cc_sm7150_gdscs [] = {
857
+ [MDSS_GDSC ] = & mdss_gdsc ,
858
+ };
859
+
851
860
static const struct regmap_config disp_cc_sm7150_regmap_config = {
852
- .reg_bits = 32 ,
853
- .reg_stride = 4 ,
854
- .val_bits = 32 ,
855
- .max_register = 0x10000 ,
856
- .fast_io = true,
861
+ .reg_bits = 32 ,
862
+ .reg_stride = 4 ,
863
+ .val_bits = 32 ,
864
+ .max_register = 0x10000 ,
865
+ .fast_io = true,
857
866
};
858
867
859
868
static const struct qcom_cc_desc disp_cc_sm7150_desc = {
@@ -865,26 +874,20 @@ static const struct qcom_cc_desc disp_cc_sm7150_desc = {
865
874
};
866
875
867
876
static const struct of_device_id disp_cc_sm7150_match_table [] = {
868
- { .compatible = "qcom,dispcc- sm7150" },
877
+ { .compatible = "qcom,sm7150-dispcc " },
869
878
{ }
870
879
};
871
880
MODULE_DEVICE_TABLE (of , disp_cc_sm7150_match_table );
872
881
873
882
static int disp_cc_sm7150_probe (struct platform_device * pdev )
874
883
{
875
884
struct regmap * regmap ;
876
- struct alpha_pll_config disp_cc_pll_config = {};
877
885
878
886
regmap = qcom_cc_map (pdev , & disp_cc_sm7150_desc );
879
887
if (IS_ERR (regmap ))
880
888
return PTR_ERR (regmap );
881
889
882
- /* 860MHz configuration */
883
- disp_cc_pll_config .l = 0x2c ;
884
- disp_cc_pll_config .alpha = 0xcaaa ;
885
- disp_cc_pll_config .test_ctl_val = 0x40000000 ;
886
-
887
- clk_fabia_pll_configure (& disp_cc_pll0 , regmap , & disp_cc_pll_config );
890
+ clk_fabia_pll_configure (& disp_cc_pll0 , regmap , & disp_cc_pll0_config );
888
891
/* Enable clock gating for DSI and MDP clocks */
889
892
regmap_update_bits (regmap , 0x8000 , 0x7f0 , 0x7f0 );
890
893
/* Keep DISP_CC_XO_CLK always-ON */
@@ -896,7 +899,7 @@ static int disp_cc_sm7150_probe(struct platform_device *pdev)
896
899
static struct platform_driver disp_cc_sm7150_driver = {
897
900
.probe = disp_cc_sm7150_probe ,
898
901
.driver = {
899
- .name = "dispcc -sm7150" ,
902
+ .name = "disp_cc -sm7150" ,
900
903
.of_match_table = disp_cc_sm7150_match_table ,
901
904
},
902
905
};
0 commit comments