aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/qcom/clk-pll.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2014-07-15 17:48:41 -0400
committerStephen Boyd <sboyd@codeaurora.org>2014-07-15 19:39:02 -0400
commitd8c25d3a1a1d61cf433654f3632a03ddaee4f781 (patch)
treef3073e5d22c2762ee28fa0c1fe1c1be29fefa468 /drivers/clk/qcom/clk-pll.c
parentf87dfcabc6f173cc811d185d33327f50a8c88399 (diff)
clk: qcom: pll: Add support for configuring SR PLLs
Some SR type PLLs need to be configured for a certain rate when linux boots. Add support for these types of PLLs so that we can program PLL15's rate on apq8064. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom/clk-pll.c')
-rw-r--r--drivers/clk/qcom/clk-pll.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/clk/qcom/clk-pll.c b/drivers/clk/qcom/clk-pll.c
index 0f927c538613..9db03d3b1657 100644
--- a/drivers/clk/qcom/clk-pll.c
+++ b/drivers/clk/qcom/clk-pll.c
@@ -166,7 +166,7 @@ const struct clk_ops clk_pll_vote_ops = {
166EXPORT_SYMBOL_GPL(clk_pll_vote_ops); 166EXPORT_SYMBOL_GPL(clk_pll_vote_ops);
167 167
168static void 168static void
169clk_pll_set_fsm_mode(struct clk_pll *pll, struct regmap *regmap) 169clk_pll_set_fsm_mode(struct clk_pll *pll, struct regmap *regmap, u8 lock_count)
170{ 170{
171 u32 val; 171 u32 val;
172 u32 mask; 172 u32 mask;
@@ -175,7 +175,7 @@ clk_pll_set_fsm_mode(struct clk_pll *pll, struct regmap *regmap)
175 regmap_update_bits(regmap, pll->mode_reg, PLL_VOTE_FSM_RESET, 0); 175 regmap_update_bits(regmap, pll->mode_reg, PLL_VOTE_FSM_RESET, 0);
176 176
177 /* Program bias count and lock count */ 177 /* Program bias count and lock count */
178 val = 1 << PLL_BIAS_COUNT_SHIFT; 178 val = 1 << PLL_BIAS_COUNT_SHIFT | lock_count << PLL_LOCK_COUNT_SHIFT;
179 mask = PLL_BIAS_COUNT_MASK << PLL_BIAS_COUNT_SHIFT; 179 mask = PLL_BIAS_COUNT_MASK << PLL_BIAS_COUNT_SHIFT;
180 mask |= PLL_LOCK_COUNT_MASK << PLL_LOCK_COUNT_SHIFT; 180 mask |= PLL_LOCK_COUNT_MASK << PLL_LOCK_COUNT_SHIFT;
181 regmap_update_bits(regmap, pll->mode_reg, mask, val); 181 regmap_update_bits(regmap, pll->mode_reg, mask, val);
@@ -212,11 +212,20 @@ static void clk_pll_configure(struct clk_pll *pll, struct regmap *regmap,
212 regmap_update_bits(regmap, pll->config_reg, mask, val); 212 regmap_update_bits(regmap, pll->config_reg, mask, val);
213} 213}
214 214
215void clk_pll_configure_sr(struct clk_pll *pll, struct regmap *regmap,
216 const struct pll_config *config, bool fsm_mode)
217{
218 clk_pll_configure(pll, regmap, config);
219 if (fsm_mode)
220 clk_pll_set_fsm_mode(pll, regmap, 8);
221}
222EXPORT_SYMBOL_GPL(clk_pll_configure_sr);
223
215void clk_pll_configure_sr_hpm_lp(struct clk_pll *pll, struct regmap *regmap, 224void clk_pll_configure_sr_hpm_lp(struct clk_pll *pll, struct regmap *regmap,
216 const struct pll_config *config, bool fsm_mode) 225 const struct pll_config *config, bool fsm_mode)
217{ 226{
218 clk_pll_configure(pll, regmap, config); 227 clk_pll_configure(pll, regmap, config);
219 if (fsm_mode) 228 if (fsm_mode)
220 clk_pll_set_fsm_mode(pll, regmap); 229 clk_pll_set_fsm_mode(pll, regmap, 0);
221} 230}
222EXPORT_SYMBOL_GPL(clk_pll_configure_sr_hpm_lp); 231EXPORT_SYMBOL_GPL(clk_pll_configure_sr_hpm_lp);