From: Taniya Das <tdas@codeaurora.org>
To: "Stephen Boyd" <sboyd@kernel.org>,
"Michael Turquette " <mturquette@baylibre.com>
Cc: David Brown <david.brown@linaro.org>,
Rajendra Nayak <rnayak@codeaurora.org>,
linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Gross <agross@kernel.org>, Taniya Das <tdas@codeaurora.org>
Subject: [PATCH v0] clk: qcom: lpasscc: Re-configure the PLL in case lost
Date: Wed, 14 Oct 2020 00:03:28 +0530 [thread overview]
Message-ID: <1602614008-2421-2-git-send-email-tdas@codeaurora.org> (raw)
In-Reply-To: <1602614008-2421-1-git-send-email-tdas@codeaurora.org>
In the case where the PLL configuration is lost, then the pm runtime
resume will reconfigure before usage.
Fixes: edab812d802d ("clk: qcom: lpass: Add support for LPASS clock controller for SC7180")
Signed-off-by: Taniya Das <tdas@codeaurora.org>
---
drivers/clk/qcom/lpasscorecc-sc7180.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c
index 228d08f..5804a93 100644
--- a/drivers/clk/qcom/lpasscorecc-sc7180.c
+++ b/drivers/clk/qcom/lpasscorecc-sc7180.c
@@ -356,6 +356,25 @@ static const struct qcom_cc_desc lpass_audio_hm_sc7180_desc = {
.num_gdscs = ARRAY_SIZE(lpass_audio_hm_sc7180_gdscs),
};
+static int lpass_core_cc_pm_clk_resume(struct device *dev)
+{
+ struct regmap *regmap = dev_get_drvdata(dev);
+ int l_val;
+
+ pm_clk_resume(dev);
+
+ /* Read PLL_L_VAL */
+ regmap_read(regmap, 0x1004, &l_val);
+ if (!l_val)
+ clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap,
+ &lpass_lpaaudio_dig_pll_config);
+ return 0;
+}
+
+static const struct dev_pm_ops lpass_core_pm_ops = {
+ SET_RUNTIME_PM_OPS(pm_clk_suspend, lpass_core_cc_pm_clk_resume, NULL)
+};
+
static int lpass_core_cc_sc7180_probe(struct platform_device *pdev)
{
const struct qcom_cc_desc *desc;
@@ -386,6 +405,9 @@ static int lpass_core_cc_sc7180_probe(struct platform_device *pdev)
clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap,
&lpass_lpaaudio_dig_pll_config);
+ pdev->dev.driver->pm = &lpass_core_pm_ops;
+ dev_set_drvdata(&pdev->dev, regmap);
+
return qcom_cc_really_probe(pdev, &lpass_core_cc_sc7180_desc, regmap);
}
--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the Linux Foundation.
next prev parent reply other threads:[~2020-10-13 18:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 18:33 [PATCH v0] LPASSCC: Configure the PLL in case lost for SC7180 Taniya Das
2020-10-13 18:33 ` Taniya Das [this message]
2020-10-13 22:26 ` [PATCH v0] clk: qcom: lpasscc: Re-configure the PLL in case lost Doug Anderson
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=1602614008-2421-2-git-send-email-tdas@codeaurora.org \
--to=tdas@codeaurora.org \
--cc=agross@kernel.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rnayak@codeaurora.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