Skip to content

Commit 3132a9a

Browse files
Jagadeesh Konaandersson
authored andcommitted
clk: qcom: clk-alpha-pll: Add support for lucid ole pll configure
Lucid ole pll has as extra RINGOSC_CAL_L field in L register in addition to the fields that are part of lucid evo pll, hence add support for lucid ole pll configure function to configure the ole plls. Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230707035744.22245-3-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 9cbc647 commit 3132a9a

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

drivers/clk/qcom/clk-alpha-pll.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
271271
#define LUCID_EVO_ENABLE_VOTE_RUN BIT(25)
272272
#define LUCID_EVO_PLL_L_VAL_MASK GENMASK(15, 0)
273273
#define LUCID_EVO_PLL_CAL_L_VAL_SHIFT 16
274+
#define LUCID_OLE_PLL_RINGOSC_CAL_L_VAL_SHIFT 24
274275

275276
/* ZONDA PLL specific */
276277
#define ZONDA_PLL_OUT_MASK 0xf
@@ -2119,6 +2120,34 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
21192120
}
21202121
EXPORT_SYMBOL_GPL(clk_lucid_evo_pll_configure);
21212122

2123+
void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
2124+
const struct alpha_pll_config *config)
2125+
{
2126+
u32 lval = config->l;
2127+
2128+
lval |= TRION_PLL_CAL_VAL << LUCID_EVO_PLL_CAL_L_VAL_SHIFT;
2129+
lval |= TRION_PLL_CAL_VAL << LUCID_OLE_PLL_RINGOSC_CAL_L_VAL_SHIFT;
2130+
clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), lval);
2131+
clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
2132+
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
2133+
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);
2134+
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config->config_ctl_hi1_val);
2135+
clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll), config->user_ctl_val);
2136+
clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll), config->user_ctl_hi_val);
2137+
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val);
2138+
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val);
2139+
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val);
2140+
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val);
2141+
2142+
/* Disable PLL output */
2143+
regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0);
2144+
2145+
/* Set operation mode to STANDBY and de-assert the reset */
2146+
regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
2147+
regmap_update_bits(regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
2148+
}
2149+
EXPORT_SYMBOL_GPL(clk_lucid_ole_pll_configure);
2150+
21222151
static int alpha_pll_lucid_evo_enable(struct clk_hw *hw)
21232152
{
21242153
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);

drivers/clk/qcom/clk-alpha-pll.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ void clk_zonda_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
199199
const struct alpha_pll_config *config);
200200
void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
201201
const struct alpha_pll_config *config);
202+
void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
203+
const struct alpha_pll_config *config);
202204
void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
203205
const struct alpha_pll_config *config);
204206
void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,

0 commit comments

Comments
 (0)