devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Taniya Das <quic_tdas@quicinc.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	 Philipp Zabel <p.zabel@pengutronix.de>,
	 Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 13/14] clk: qcom: dispcc-sm8550: enable support for SAR2130P
Date: Thu, 17 Oct 2024 19:57:03 +0300	[thread overview]
Message-ID: <20241017-sar2130p-clocks-v1-13-f75e740f0a8d@linaro.org> (raw)
In-Reply-To: <20241017-sar2130p-clocks-v1-0-f75e740f0a8d@linaro.org>

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.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/clk/qcom/Kconfig         |  4 ++--
 drivers/clk/qcom/dispcc-sm8550.c | 18 ++++++++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 5f7bf9db76cfcef1ab18a6ba09fb4dc506695f9d..f314f26fe136c0fc1612edc0cca23c4deba5cd9f 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -968,10 +968,10 @@ config SM_DISPCC_8450
 config SM_DISPCC_8550
 	tristate "SM8550 Display Clock Controller"
 	depends on ARM64 || COMPILE_TEST
-	depends on SM_GCC_8550 || SM_GCC_8650
+	depends on SM_GCC_8550 || SM_GCC_8650 || SAR_GCC_2130P
 	help
 	  Support for the display clock controller on Qualcomm Technologies, Inc
-	  SM8550 or SM8650 devices.
+	  SAR2130P, SM8550 or SM8650 devices.
 	  Say Y if you want to support display devices and functionality such as
 	  splash screen.
 
diff --git a/drivers/clk/qcom/dispcc-sm8550.c b/drivers/clk/qcom/dispcc-sm8550.c
index 7f9021ca0ecb0ef743a40bed1bb3d2cbcfa23dc7..e41d4104d77021cae6438886bcb7015469d86a9f 100644
--- a/drivers/clk/qcom/dispcc-sm8550.c
+++ b/drivers/clk/qcom/dispcc-sm8550.c
@@ -75,7 +75,7 @@ static struct pll_vco lucid_ole_vco[] = {
 	{ 249600000, 2000000000, 0 },
 };
 
-static const struct alpha_pll_config disp_cc_pll0_config = {
+static struct alpha_pll_config disp_cc_pll0_config = {
 	.l = 0xd,
 	.alpha = 0x6492,
 	.config_ctl_val = 0x20485699,
@@ -106,7 +106,7 @@ static struct clk_alpha_pll disp_cc_pll0 = {
 	},
 };
 
-static const struct alpha_pll_config disp_cc_pll1_config = {
+static struct alpha_pll_config disp_cc_pll1_config = {
 	.l = 0x1f,
 	.alpha = 0x4000,
 	.config_ctl_val = 0x20485699,
@@ -594,6 +594,13 @@ static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
 	{ }
 };
 
+static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sar2130p[] = {
+	F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
+	F(325000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
+	F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
+	{ }
+};
+
 static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sm8650[] = {
 	F(19200000, P_BI_TCXO, 1, 0, 0),
 	F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
@@ -1750,6 +1757,7 @@ static struct qcom_cc_desc disp_cc_sm8550_desc = {
 };
 
 static const struct of_device_id disp_cc_sm8550_match_table[] = {
+	{ .compatible = "qcom,sar2130p-dispcc" },
 	{ .compatible = "qcom,sm8550-dispcc" },
 	{ .compatible = "qcom,sm8650-dispcc" },
 	{ }
@@ -1780,6 +1788,12 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
 		disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sm8650;
 		disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr.hw.init->parent_hws[0] =
 			&disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw;
+	} else if (of_device_is_compatible(pdev->dev.of_node, "qcom,sar2130p-dispcc")) {
+		disp_cc_pll0_config.l = 0x1f;
+		disp_cc_pll0_config.alpha = 0x4000;
+		disp_cc_pll0_config.user_ctl_val = 0x1;
+		disp_cc_pll1_config.user_ctl_val = 0x1;
+		disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sar2130p;
 	}
 
 	clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);

-- 
2.39.5


  parent reply	other threads:[~2024-10-17 16:57 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:56 [PATCH 00/14] clk: qcom: add support for clock controllers on the SAR2130P platform Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 01/14] dt-bindings: clock: qcom,rpmhcc: Add SAR2130P compatible Dmitry Baryshkov
2024-10-21  7:51   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 02/14] dt-bindings: clock: qcom: document SAR2130P Global Clock Controller Dmitry Baryshkov
2024-10-18  6:50   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 03/14] dt-bindings: clock: qcom,sm8550-tcsr: Add SAR2130P compatible Dmitry Baryshkov
2024-10-18  7:09   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 04/14] dt-bindings: clock: qcom,sm8550-dispcc: " Dmitry Baryshkov
2024-10-21  7:52   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 05/14] dt-bindings: clk: qcom,sm8450-gpucc: add SAR2130P compatibles Dmitry Baryshkov
2024-10-18  6:51   ` Krzysztof Kozlowski
2024-10-18  7:10   ` Krzysztof Kozlowski
2024-10-18  8:34     ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 06/14] clk: qcom: clk-branch: Add support for BRANCH_HALT_POLL flag Dmitry Baryshkov
2024-10-17 18:03   ` Stephen Boyd
2024-10-17 22:05     ` Dmitry Baryshkov
2024-10-18 11:02       ` Taniya Das
2024-10-18 11:12         ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 07/14] clk: qcom: clk-branch: Add support for SREG branch ops Dmitry Baryshkov
2024-10-17 18:10   ` Stephen Boyd
2024-10-17 22:00     ` Dmitry Baryshkov
2024-10-17 22:28       ` Stephen Boyd
2024-10-18  9:56         ` Dmitry Baryshkov
2024-10-18 10:50           ` Taniya Das
2024-10-18 10:53             ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 08/14] clk: qcom: rcg2: add clk_rcg2_shared_floor_ops Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 09/14] clk: qcom: gdsc: add separate sleep state collapse vote support Dmitry Baryshkov
2024-10-18 10:28   ` Taniya Das
2024-10-18 10:48     ` Dmitry Baryshkov
2024-10-17 16:57 ` [PATCH 10/14] clk: qcom: rpmh: add support for SAR2130P Dmitry Baryshkov
2024-10-17 19:11   ` Konrad Dybcio
2024-10-17 16:57 ` [PATCH 11/14] clk: qcom: add support for GCC on SAR2130P Dmitry Baryshkov
2024-10-20 23:30   ` kernel test robot
2024-10-20 23:52   ` kernel test robot
2024-10-17 16:57 ` [PATCH 12/14] clk: qcom: tcsrcc-sm8550: add SAR2130P support Dmitry Baryshkov
2024-10-17 19:13   ` Konrad Dybcio
2024-10-17 16:57 ` Dmitry Baryshkov [this message]
2024-10-18  7:26   ` [PATCH 13/14] clk: qcom: dispcc-sm8550: enable support for SAR2130P Neil Armstrong
2024-10-17 16:57 ` [PATCH 14/14] clk: qcom: add SAR2130P GPU Clock Controller support Dmitry Baryshkov
2024-10-17 19:21   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241017-sar2130p-clocks-v1-13-f75e740f0a8d@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_tdas@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).