Skip to content

Commit 1335c7e

Browse files
lumagandersson
authored andcommitted
clk: qcom: dispcc-sm8550: enable support for SAR2130P
The display clock controller on SAR2130P is very close to the clock controller on SM8550 (and SM8650). Reuse existing driver to add support for the controller on SAR2130P. Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent d2e0a04 commit 1335c7e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

drivers/clk/qcom/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,10 @@ config SM_DISPCC_8450
988988
config SM_DISPCC_8550
989989
tristate "SM8550 Display Clock Controller"
990990
depends on ARM64 || COMPILE_TEST
991-
depends on SM_GCC_8550 || SM_GCC_8650
991+
depends on SM_GCC_8550 || SM_GCC_8650 || SAR_GCC_2130P
992992
help
993993
Support for the display clock controller on Qualcomm Technologies, Inc
994-
SM8550 or SM8650 devices.
994+
SAR2130P, SM8550 or SM8650 devices.
995995
Say Y if you want to support display devices and functionality such as
996996
splash screen.
997997

drivers/clk/qcom/dispcc-sm8550.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static struct pll_vco lucid_ole_vco[] = {
7575
{ 249600000, 2000000000, 0 },
7676
};
7777

78-
static const struct alpha_pll_config disp_cc_pll0_config = {
78+
static struct alpha_pll_config disp_cc_pll0_config = {
7979
.l = 0xd,
8080
.alpha = 0x6492,
8181
.config_ctl_val = 0x20485699,
@@ -106,7 +106,7 @@ static struct clk_alpha_pll disp_cc_pll0 = {
106106
},
107107
};
108108

109-
static const struct alpha_pll_config disp_cc_pll1_config = {
109+
static struct alpha_pll_config disp_cc_pll1_config = {
110110
.l = 0x1f,
111111
.alpha = 0x4000,
112112
.config_ctl_val = 0x20485699,
@@ -594,6 +594,13 @@ static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
594594
{ }
595595
};
596596

597+
static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sar2130p[] = {
598+
F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
599+
F(325000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
600+
F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
601+
{ }
602+
};
603+
597604
static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sm8650[] = {
598605
F(19200000, P_BI_TCXO, 1, 0, 0),
599606
F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
@@ -1750,6 +1757,7 @@ static struct qcom_cc_desc disp_cc_sm8550_desc = {
17501757
};
17511758

17521759
static const struct of_device_id disp_cc_sm8550_match_table[] = {
1760+
{ .compatible = "qcom,sar2130p-dispcc" },
17531761
{ .compatible = "qcom,sm8550-dispcc" },
17541762
{ .compatible = "qcom,sm8650-dispcc" },
17551763
{ }
@@ -1780,6 +1788,12 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
17801788
disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sm8650;
17811789
disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr.hw.init->parent_hws[0] =
17821790
&disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw;
1791+
} else if (of_device_is_compatible(pdev->dev.of_node, "qcom,sar2130p-dispcc")) {
1792+
disp_cc_pll0_config.l = 0x1f;
1793+
disp_cc_pll0_config.alpha = 0x4000;
1794+
disp_cc_pll0_config.user_ctl_val = 0x1;
1795+
disp_cc_pll1_config.user_ctl_val = 0x1;
1796+
disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sar2130p;
17831797
}
17841798

17851799
clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);

0 commit comments

Comments
 (0)