From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Jagadeesh Kona <quic_jkona@quicinc.com>,
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>,
Konrad Dybcio <konradybcio@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Dmitry Baryshkov <lumag@kernel.org>
Cc: Ajit Pandey <quic_ajipan@quicinc.com>,
Imran Shaik <quic_imrashai@quicinc.com>,
Taniya Das <quic_tdas@quicinc.com>,
Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH v3 12/18] clk: qcom: camcc-x1e80100: Move PLL & clk configuration to really probe
Date: Thu, 27 Mar 2025 15:59:35 +0000 [thread overview]
Message-ID: <bd2a5cfa-5e7a-42f3-809b-eaf34ef22294@linaro.org> (raw)
In-Reply-To: <20250327-videocc-pll-multi-pd-voting-v3-12-895fafd62627@quicinc.com>
On 27/03/2025 09:52, Jagadeesh Kona wrote:
> Camera PLLs on X1E80100 require both MMCX and MXC rails to be kept ON
> to configure the PLLs properly. Hence move runtime power management,
> PLL configuration and enabling critical clocks to qcom_cc_really_probe()
> which ensures all required power domains are in enabled state before
> configuring the PLLs or enabling the clocks.
>
> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
> ---
> drivers/clk/qcom/camcc-x1e80100.c | 63 +++++++++++++++++----------------------
> 1 file changed, 28 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/clk/qcom/camcc-x1e80100.c b/drivers/clk/qcom/camcc-x1e80100.c
> index b73524ae64b1b2b1ee94ceca88b5f3b46143f20b..1f2e49c4798f33b2204b95665cc977b4a52b549a 100644
> --- a/drivers/clk/qcom/camcc-x1e80100.c
> +++ b/drivers/clk/qcom/camcc-x1e80100.c
> @@ -7,7 +7,6 @@
> #include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/pm_runtime.h>
> #include <linux/regmap.h>
>
> #include <dt-bindings/clock/qcom,x1e80100-camcc.h>
> @@ -67,6 +66,7 @@ static const struct alpha_pll_config cam_cc_pll0_config = {
>
> static struct clk_alpha_pll cam_cc_pll0 = {
> .offset = 0x0,
> + .config = &cam_cc_pll0_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -144,6 +144,7 @@ static const struct alpha_pll_config cam_cc_pll1_config = {
>
> static struct clk_alpha_pll cam_cc_pll1 = {
> .offset = 0x1000,
> + .config = &cam_cc_pll1_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -194,6 +195,7 @@ static const struct alpha_pll_config cam_cc_pll2_config = {
>
> static struct clk_alpha_pll cam_cc_pll2 = {
> .offset = 0x2000,
> + .config = &cam_cc_pll2_config,
> .vco_table = rivian_ole_vco,
> .num_vco = ARRAY_SIZE(rivian_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO],
> @@ -225,6 +227,7 @@ static const struct alpha_pll_config cam_cc_pll3_config = {
>
> static struct clk_alpha_pll cam_cc_pll3 = {
> .offset = 0x3000,
> + .config = &cam_cc_pll3_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -279,6 +282,7 @@ static const struct alpha_pll_config cam_cc_pll4_config = {
>
> static struct clk_alpha_pll cam_cc_pll4 = {
> .offset = 0x4000,
> + .config = &cam_cc_pll4_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -333,6 +337,7 @@ static const struct alpha_pll_config cam_cc_pll6_config = {
>
> static struct clk_alpha_pll cam_cc_pll6 = {
> .offset = 0x6000,
> + .config = &cam_cc_pll6_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -387,6 +392,7 @@ static const struct alpha_pll_config cam_cc_pll8_config = {
>
> static struct clk_alpha_pll cam_cc_pll8 = {
> .offset = 0x8000,
> + .config = &cam_cc_pll8_config,
> .vco_table = lucid_ole_vco,
> .num_vco = ARRAY_SIZE(lucid_ole_vco),
> .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
> @@ -2418,6 +2424,21 @@ static const struct qcom_reset_map cam_cc_x1e80100_resets[] = {
> [CAM_CC_SFE_0_BCR] = { 0x1327c },
> };
>
> +static struct clk_alpha_pll *cam_cc_x1e80100_plls[] = {
> + &cam_cc_pll0,
> + &cam_cc_pll1,
> + &cam_cc_pll2,
> + &cam_cc_pll3,
> + &cam_cc_pll4,
> + &cam_cc_pll6,
> + &cam_cc_pll8,
> +};
> +
> +static u32 cam_cc_x1e80100_critical_cbcrs[] = {
> + 0x13a9c, /* CAM_CC_GDSC_CLK */
> + 0x13ab8, /* CAM_CC_SLEEP_CLK */
> +};
> +
> static const struct regmap_config cam_cc_x1e80100_regmap_config = {
> .reg_bits = 32,
> .reg_stride = 4,
> @@ -2434,6 +2455,11 @@ static const struct qcom_cc_desc cam_cc_x1e80100_desc = {
> .num_resets = ARRAY_SIZE(cam_cc_x1e80100_resets),
> .gdscs = cam_cc_x1e80100_gdscs,
> .num_gdscs = ARRAY_SIZE(cam_cc_x1e80100_gdscs),
> + .alpha_plls = cam_cc_x1e80100_plls,
> + .num_alpha_plls = ARRAY_SIZE(cam_cc_x1e80100_plls),
> + .clk_cbcrs = cam_cc_x1e80100_critical_cbcrs,
> + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_x1e80100_critical_cbcrs),
> + .use_rpm = true,
> };
>
> static const struct of_device_id cam_cc_x1e80100_match_table[] = {
> @@ -2444,40 +2470,7 @@ MODULE_DEVICE_TABLE(of, cam_cc_x1e80100_match_table);
>
> static int cam_cc_x1e80100_probe(struct platform_device *pdev)
> {
> - struct regmap *regmap;
> - int ret;
> -
> - ret = devm_pm_runtime_enable(&pdev->dev);
> - if (ret)
> - return ret;
> -
> - ret = pm_runtime_resume_and_get(&pdev->dev);
> - if (ret)
> - return ret;
> -
> - regmap = qcom_cc_map(pdev, &cam_cc_x1e80100_desc);
> - if (IS_ERR(regmap)) {
> - pm_runtime_put(&pdev->dev);
> - return PTR_ERR(regmap);
> - }
> -
> - clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
> - clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config);
> - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config);
> - clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
> - clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config);
> - clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config);
> - clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config);
> -
> - /* Keep clocks always enabled */
> - qcom_branch_set_clk_en(regmap, 0x13a9c); /* CAM_CC_GDSC_CLK */
> - qcom_branch_set_clk_en(regmap, 0x13ab8); /* CAM_CC_SLEEP_CLK */
> -
> - ret = qcom_cc_really_probe(&pdev->dev, &cam_cc_x1e80100_desc, regmap);
> -
> - pm_runtime_put(&pdev->dev);
> -
> - return ret;
> + return qcom_cc_probe(pdev, &cam_cc_x1e80100_desc);
> }
>
> static struct platform_driver cam_cc_x1e80100_driver = {
>
Thanks for this work.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # Dell Inspiron
14 Plus 7441
next prev parent reply other threads:[~2025-03-27 15:59 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 9:52 [PATCH v3 00/18] clk: qcom: Add support to attach multiple power domains in cc probe Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 01/18] dt-bindings: clock: qcom,sm8450-videocc: Add MXC power domain Jagadeesh Kona
2025-03-28 8:09 ` Krzysztof Kozlowski
2025-03-28 8:10 ` Krzysztof Kozlowski
2025-03-27 9:52 ` [PATCH v3 02/18] dt-bindings: clock: qcom: Update sc8280xp camcc bindings Jagadeesh Kona
2025-03-27 15:39 ` Bryan O'Donoghue
2025-03-28 8:07 ` Krzysztof Kozlowski
2025-03-28 10:39 ` Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 03/18] dt-bindings: clock: qcom: sm8450-camcc: Allow to specify two power domains Jagadeesh Kona
2025-03-27 15:28 ` Bryan O'Donoghue
2025-03-28 10:39 ` Jagadeesh Kona
2025-03-28 8:11 ` Krzysztof Kozlowski
2025-03-27 9:52 ` [PATCH v3 04/18] clk: qcom: clk-alpha-pll: Add support for common PLL configuration function Jagadeesh Kona
2025-03-27 15:51 ` Bryan O'Donoghue
2025-03-27 18:20 ` Dmitry Baryshkov
2025-04-11 7:13 ` Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 05/18] clk: qcom: common: Handle runtime power management in qcom_cc_really_probe Jagadeesh Kona
2025-03-27 12:44 ` Dmitry Baryshkov
2025-03-27 15:58 ` Bryan O'Donoghue
2025-03-28 10:41 ` Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 06/18] clk: qcom: common: Add support to configure clk regs " Jagadeesh Kona
2025-03-27 12:50 ` Dmitry Baryshkov
2025-04-11 7:14 ` Jagadeesh Kona
2025-04-11 8:51 ` Dmitry Baryshkov
2025-04-14 10:09 ` Jagadeesh Kona
2025-04-14 10:13 ` Dmitry Baryshkov
2025-03-27 9:52 ` [PATCH v3 07/18] clk: qcom: videocc-sm8450: Move PLL & clk configuration to really probe Jagadeesh Kona
2025-03-27 12:51 ` Dmitry Baryshkov
2025-03-27 9:52 ` [PATCH v3 08/18] clk: qcom: videocc-sm8550: " Jagadeesh Kona
2025-03-27 13:58 ` Dmitry Baryshkov
2025-03-27 9:52 ` [PATCH v3 09/18] clk: qcom: camcc-sm8450: " Jagadeesh Kona
2025-03-27 13:58 ` Dmitry Baryshkov
2025-03-27 9:52 ` [PATCH v3 10/18] clk: qcom: camcc-sm8550: " Jagadeesh Kona
2025-03-27 15:06 ` Dmitry Baryshkov
2025-03-27 9:52 ` [PATCH v3 11/18] clk: qcom: camcc-sm8650: " Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 12/18] clk: qcom: camcc-x1e80100: " Jagadeesh Kona
2025-03-27 15:59 ` Bryan O'Donoghue [this message]
2025-03-27 9:52 ` [PATCH v3 13/18] arm64: dts: qcom: Add MXC power domain to videocc node on SM8450 Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 14/18] arm64: dts: qcom: Add MXC power domain to videocc node on SM8550 Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 15/18] arm64: dts: qcom: Add MXC power domain to videocc node on SM8650 Jagadeesh Kona
2025-04-01 15:27 ` Konrad Dybcio
2025-04-01 16:00 ` Konrad Dybcio
2025-04-11 7:27 ` Jagadeesh Kona
2025-04-11 7:16 ` Jagadeesh Kona
2025-04-11 9:15 ` Konrad Dybcio
2025-03-27 9:52 ` [PATCH v3 16/18] arm64: dts: qcom: Add MXC power domain to camcc node on SM8450 Jagadeesh Kona
2025-03-27 16:03 ` Bryan O'Donoghue
2025-03-28 10:40 ` Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 17/18] arm64: dts: qcom: sm8550: Additionally manage MXC power domain in camcc Jagadeesh Kona
2025-03-27 9:52 ` [PATCH v3 18/18] arm64: dts: qcom: Add MXC power domain to camcc node on SM8650 Jagadeesh Kona
2025-03-27 14:03 ` [PATCH v3 00/18] clk: qcom: Add support to attach multiple power domains in cc probe Rob Herring (Arm)
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=bd2a5cfa-5e7a-42f3-809b-eaf34ef22294@linaro.org \
--to=bryan.odonoghue@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=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=mturquette@baylibre.com \
--cc=quic_ajipan@quicinc.com \
--cc=quic_imrashai@quicinc.com \
--cc=quic_jkona@quicinc.com \
--cc=quic_skakitap@quicinc.com \
--cc=quic_tdas@quicinc.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=vladimir.zapolskiy@linaro.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