summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Skladowski <a39.skl@gmail.com>2023-08-12 14:24:45 +0300
committerBjorn Andersson <andersson@kernel.org>2023-09-13 22:07:58 +0300
commit500a4609eef46d49a260173b66cabb20bd5159ad (patch)
treef93ee20740b81bfab32b74951b8c6d4dc545e5e2
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff)
downloadlinux-500a4609eef46d49a260173b66cabb20bd5159ad.tar.xz
clk: qcom: clk-hfpll: Configure l_val in init when required
Add support for pre-configuring default frequency multiplier, this appears to be required on some platforms like MSM8976. Without configuring L_VAL device reboots when trying to bring PLL up. Signed-off-by: Adam Skladowski <a39.skl@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230812112534.8610-3-a39.skl@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
-rw-r--r--drivers/clk/qcom/clk-hfpll.c4
-rw-r--r--drivers/clk/qcom/clk-hfpll.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/clk/qcom/clk-hfpll.c b/drivers/clk/qcom/clk-hfpll.c
index 86f728dc69e5..705352aff067 100644
--- a/drivers/clk/qcom/clk-hfpll.c
+++ b/drivers/clk/qcom/clk-hfpll.c
@@ -44,6 +44,10 @@ static void __clk_hfpll_init_once(struct clk_hw *hw)
regmap_write(regmap, hd->user_reg, regval);
}
+ /* Write L_VAL from conf if it exist */
+ if (hd->l_val)
+ regmap_write(regmap, hd->l_reg, hd->l_val);
+
if (hd->droop_reg)
regmap_write(regmap, hd->droop_reg, hd->droop_val);
diff --git a/drivers/clk/qcom/clk-hfpll.h b/drivers/clk/qcom/clk-hfpll.h
index 2a57b2fb2f2f..27b9effcb3fd 100644
--- a/drivers/clk/qcom/clk-hfpll.h
+++ b/drivers/clk/qcom/clk-hfpll.h
@@ -18,6 +18,7 @@ struct hfpll_data {
u32 status_reg;
u8 lock_bit;
+ u32 l_val;
u32 droop_val;
u32 config_val;
u32 user_val;