Lines Matching refs:vco
94 for (*index = 0; *index < pll->vco->rtbl_cnt; (*index)++) { in clk_pll_round_rate_index()
97 *prate = pll_calc_rate(pll->vco->rtbl, vco_parent_rate, *index, in clk_pll_round_rate_index()
128 if (pll->vco->lock) in clk_pll_recalc_rate()
129 spin_lock_irqsave(pll->vco->lock, flags); in clk_pll_recalc_rate()
131 p = readl_relaxed(pll->vco->cfg_reg); in clk_pll_recalc_rate()
133 if (pll->vco->lock) in clk_pll_recalc_rate()
134 spin_unlock_irqrestore(pll->vco->lock, flags); in clk_pll_recalc_rate()
145 struct pll_rate_tbl *rtbl = pll->vco->rtbl; in clk_pll_set_rate()
151 if (pll->vco->lock) in clk_pll_set_rate()
152 spin_lock_irqsave(pll->vco->lock, flags); in clk_pll_set_rate()
154 val = readl_relaxed(pll->vco->cfg_reg); in clk_pll_set_rate()
157 writel_relaxed(val, pll->vco->cfg_reg); in clk_pll_set_rate()
159 if (pll->vco->lock) in clk_pll_set_rate()
160 spin_unlock_irqrestore(pll->vco->lock, flags); in clk_pll_set_rate()
174 struct clk_vco *vco = to_clk_vco(hw); in vco_calc_rate() local
176 return pll_calc_rate(vco->rtbl, prate, index, NULL); in vco_calc_rate()
182 struct clk_vco *vco = to_clk_vco(hw); in clk_vco_round_rate() local
186 vco->rtbl_cnt, &unused); in clk_vco_round_rate()
192 struct clk_vco *vco = to_clk_vco(hw); in clk_vco_recalc_rate() local
196 if (vco->lock) in clk_vco_recalc_rate()
197 spin_lock_irqsave(vco->lock, flags); in clk_vco_recalc_rate()
199 mode = (readl_relaxed(vco->mode_reg) >> PLL_MODE_SHIFT) & PLL_MODE_MASK; in clk_vco_recalc_rate()
201 val = readl_relaxed(vco->cfg_reg); in clk_vco_recalc_rate()
203 if (vco->lock) in clk_vco_recalc_rate()
204 spin_unlock_irqrestore(vco->lock, flags); in clk_vco_recalc_rate()
230 struct clk_vco *vco = to_clk_vco(hw); in clk_vco_set_rate() local
231 struct pll_rate_tbl *rtbl = vco->rtbl; in clk_vco_set_rate()
235 clk_round_rate_index(hw, drate, prate, vco_calc_rate, vco->rtbl_cnt, in clk_vco_set_rate()
238 if (vco->lock) in clk_vco_set_rate()
239 spin_lock_irqsave(vco->lock, flags); in clk_vco_set_rate()
241 val = readl_relaxed(vco->mode_reg); in clk_vco_set_rate()
244 writel_relaxed(val, vco->mode_reg); in clk_vco_set_rate()
246 val = readl_relaxed(vco->cfg_reg); in clk_vco_set_rate()
258 writel_relaxed(val, vco->cfg_reg); in clk_vco_set_rate()
260 if (vco->lock) in clk_vco_set_rate()
261 spin_unlock_irqrestore(vco->lock, flags); in clk_vco_set_rate()
279 struct clk_vco *vco; in clk_register_vco_pll() local
291 vco = kzalloc(sizeof(*vco), GFP_KERNEL); in clk_register_vco_pll()
292 if (!vco) in clk_register_vco_pll()
300 vco->mode_reg = mode_reg; in clk_register_vco_pll()
301 vco->cfg_reg = cfg_reg; in clk_register_vco_pll()
302 vco->rtbl = rtbl; in clk_register_vco_pll()
303 vco->rtbl_cnt = rtbl_cnt; in clk_register_vco_pll()
304 vco->lock = lock; in clk_register_vco_pll()
305 vco->hw.init = &vco_init; in clk_register_vco_pll()
307 pll->vco = vco; in clk_register_vco_pll()
335 vco_clk = clk_register(NULL, &vco->hw); in clk_register_vco_pll()
351 kfree(vco); in clk_register_vco_pll()