From 26926a35f7da4ab908c610cb42640d0e0f0ad52c Mon Sep 17 00:00:00 2001 From: Taniya Das Date: Fri, 26 Mar 2021 17:57:08 +0530 Subject: [PATCH] clk: qcom: clk-alpha-pll: Update support for FSM legacy mode The Lucid PLL could require the FSM legacy mode bit to be set for the PLL to be operational, thus set the same when the flag is set. While at it also update the Zonda disable function to remove the additional offset usage. Change-Id: I3ed4b6c38a1769c5021f17e0115215eab615ab62 Signed-off-by: Taniya Das --- drivers/clk/qcom/clk-alpha-pll.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index 77521a2aec27..690640cdba2f 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2015-2016, 2018-2020, The Linux Foundation. + * Copyright (c) 2015-2016, 2018-2021, The Linux Foundation. * All rights reserved. */ @@ -1532,10 +1532,10 @@ static int clk_zonda_pll_enable(struct clk_hw *hw) static void clk_zonda_pll_disable(struct clk_hw *hw) { struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); - u32 val, mask, off = pll->offset; + u32 val, mask; int ret; - ret = regmap_read(pll->clkr.regmap, off + PLL_MODE(pll), &val); + ret = regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val); if (ret) return; @@ -2677,6 +2677,9 @@ void clk_lucid_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, clk_alpha_pll_custom_configure(pll, regmap, config); + if (pll->flags & SUPPORTS_FSM_LEGACY_MODE) + regmap_update_bits(regmap, PLL_MODE(pll), PLL_FSM_LEGACY_MODE, + PLL_FSM_LEGACY_MODE); regmap_update_bits(regmap, PLL_MODE(pll), PLL_UPDATE_BYPASS, PLL_UPDATE_BYPASS);