|
@@ -658,6 +658,26 @@ static void _update_pll_cpcon(struct tegra_clk_pll *pll,
|
|
|
pll_writel_misc(val, pll);
|
|
|
}
|
|
|
|
|
|
+static void pll_clk_start_ss(struct tegra_clk_pll *pll)
|
|
|
+{
|
|
|
+ if (pll->params->defaults_set && pll->params->ssc_ctrl_reg) {
|
|
|
+ u32 val = pll_readl(pll->params->ssc_ctrl_reg, pll);
|
|
|
+
|
|
|
+ val |= pll->params->ssc_ctrl_en_mask;
|
|
|
+ pll_writel(val, pll->params->ssc_ctrl_reg, pll);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+static void pll_clk_stop_ss(struct tegra_clk_pll *pll)
|
|
|
+{
|
|
|
+ if (pll->params->defaults_set && pll->params->ssc_ctrl_reg) {
|
|
|
+ u32 val = pll_readl(pll->params->ssc_ctrl_reg, pll);
|
|
|
+
|
|
|
+ val &= ~pll->params->ssc_ctrl_en_mask;
|
|
|
+ pll_writel(val, pll->params->ssc_ctrl_reg, pll);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
|
|
|
unsigned long rate)
|
|
|
{
|
|
@@ -676,8 +696,10 @@ static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if (state)
|
|
|
+ if (state) {
|
|
|
+ pll_clk_stop_ss(pll);
|
|
|
_clk_pll_disable(hw);
|
|
|
+ }
|
|
|
|
|
|
if (!pll->params->defaults_set && pll->params->set_defaults)
|
|
|
pll->params->set_defaults(pll);
|
|
@@ -690,6 +712,7 @@ static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
|
|
|
if (state) {
|
|
|
_clk_pll_enable(hw);
|
|
|
ret = clk_pll_wait_for_lock(pll);
|
|
|
+ pll_clk_start_ss(pll);
|
|
|
}
|
|
|
|
|
|
return ret;
|