Skip to content

Commit 480e1ae

Browse files
committed
dispcc: first fixes
1 parent ae11994 commit 480e1ae

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

drivers/clk/qcom/dispcc-sm7150.c

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// SPDX-License-Identifier: GPL-2.0
1+
// SPDX-License-Identifier: GPL-2.0-only
22
/*
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]>
45
*/
56

67
#include <linux/clk-provider.h>
@@ -16,6 +17,7 @@
1617
#include "clk-regmap-divider.h"
1718
#include "common.h"
1819
#include "gdsc.h"
20+
#include "reset.h"
1921

2022
enum {
2123
P_BI_TCXO,
@@ -34,6 +36,13 @@ static const struct pll_vco fabia_vco[] = {
3436
{ 249600000, 2000000000, 0 },
3537
};
3638

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+
3746
static struct clk_alpha_pll disp_cc_pll0 = {
3847
.offset = 0x0,
3948
.vco_table = fabia_vco,
@@ -348,13 +357,13 @@ static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
348357
};
349358

350359
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+
{ }
358367
};
359368

360369
static struct clk_rcg2 disp_cc_mdss_rot_clk_src = {
@@ -801,10 +810,6 @@ static struct gdsc mdss_gdsc = {
801810
.flags = HW_CTRL,
802811
};
803812

804-
static struct gdsc *disp_cc_sm7150_gdscs[] = {
805-
[MDSS_GDSC] = &mdss_gdsc,
806-
};
807-
808813
static struct clk_regmap *disp_cc_sm7150_clocks[] = {
809814
[DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
810815
[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[] = {
848853
[DISP_CC_PLL0_OUT_EVEN] = &disp_cc_pll0_out_even.clkr,
849854
};
850855

856+
static struct gdsc *disp_cc_sm7150_gdscs[] = {
857+
[MDSS_GDSC] = &mdss_gdsc,
858+
};
859+
851860
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,
857866
};
858867

859868
static const struct qcom_cc_desc disp_cc_sm7150_desc = {
@@ -865,26 +874,20 @@ static const struct qcom_cc_desc disp_cc_sm7150_desc = {
865874
};
866875

867876
static const struct of_device_id disp_cc_sm7150_match_table[] = {
868-
{ .compatible = "qcom,dispcc-sm7150" },
877+
{ .compatible = "qcom,sm7150-dispcc" },
869878
{ }
870879
};
871880
MODULE_DEVICE_TABLE(of, disp_cc_sm7150_match_table);
872881

873882
static int disp_cc_sm7150_probe(struct platform_device *pdev)
874883
{
875884
struct regmap *regmap;
876-
struct alpha_pll_config disp_cc_pll_config = {};
877885

878886
regmap = qcom_cc_map(pdev, &disp_cc_sm7150_desc);
879887
if (IS_ERR(regmap))
880888
return PTR_ERR(regmap);
881889

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);
888891
/* Enable clock gating for DSI and MDP clocks */
889892
regmap_update_bits(regmap, 0x8000, 0x7f0, 0x7f0);
890893
/* Keep DISP_CC_XO_CLK always-ON */
@@ -896,7 +899,7 @@ static int disp_cc_sm7150_probe(struct platform_device *pdev)
896899
static struct platform_driver disp_cc_sm7150_driver = {
897900
.probe = disp_cc_sm7150_probe,
898901
.driver = {
899-
.name = "dispcc-sm7150",
902+
.name = "disp_cc-sm7150",
900903
.of_match_table = disp_cc_sm7150_match_table,
901904
},
902905
};

0 commit comments

Comments
 (0)