diff options
author | Satya Priya Kakitapalli <[email protected]> | 2024-07-31 11:59:11 +0530 |
---|---|---|
committer | Bjorn Andersson <[email protected]> | 2024-07-31 21:56:09 -0500 |
commit | 85e8ee59dfde1a7b847fbed0778391392cd985cb (patch) | |
tree | 764d81c51193af833fc5b30da615b0463d584f85 | |
parent | 4ad1ed6ef27cab94888bb3c740c14042d5c0dff2 (diff) |
clk: qcom: clk-alpha-pll: Fix zonda set_rate failure when PLL is disabled
Currently, clk_zonda_pll_set_rate polls for the PLL to lock even if the
PLL is disabled. However, if the PLL is disabled then LOCK_DET will
never assert and we'll return an error. There is no reason to poll
LOCK_DET if the PLL is already disabled, so skip polling in this case.
Fixes: f21b6bfecc27 ("clk: qcom: clk-alpha-pll: add support for zonda pll")
Cc: [email protected]
Signed-off-by: Satya Priya Kakitapalli <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
-rw-r--r-- | drivers/clk/qcom/clk-alpha-pll.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index eb5626095916..2ebeb277cb4d 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -2136,6 +2136,9 @@ static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate, regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a); regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l); + if (!clk_hw_is_enabled(hw)) + return 0; + /* Wait before polling for the frequency latch */ udelay(5); |