Lines Matching refs:pll
200 const struct s32cc_pll *pll = s32cc_obj2pll(module); in get_pll_parent() local
202 if (pll->source == NULL) { in get_pll_parent()
206 return pll->source; in get_pll_parent()
246 static struct s32cc_clkmux *get_pll_mux(const struct s32cc_pll *pll) in get_pll_mux() argument
248 const struct s32cc_clk_obj *source = pll->source; in get_pll_mux()
300 static int adjust_odiv_settings(const struct s32cc_pll *pll, uintptr_t pll_addr, in adjust_odiv_settings() argument
311 for (i = 0; i < pll->ndividers; i++) { in adjust_odiv_settings()
321 pdiv = (uint32_t)(pll->vco_freq * FP_PRECISION / old_odiv_freq / FP_PRECISION); in adjust_odiv_settings()
323 odiv_freq = pll->vco_freq * FP_PRECISION / pdiv / FP_PRECISION; in adjust_odiv_settings()
396 static int program_pll(const struct s32cc_pll *pll, uintptr_t pll_addr, in program_pll() argument
411 ret = get_pll_mfi_mfn(pll->vco_freq, sclk_freq, &mfi, &mfn); in program_pll()
416 odivs_mask = get_enabled_odivs(pll_addr, pll->ndividers); in program_pll()
419 ret = get_module_rate(&pll->desc, drv, &old_vco, ldepth); in program_pll()
426 disable_odivs(pll_addr, pll->ndividers); in program_pll()
442 ret = adjust_odiv_settings(pll, pll_addr, odivs_mask, old_vco); in program_pll()
450 enable_odivs(pll_addr, pll->ndividers, odivs_mask); in program_pll()
459 const struct s32cc_pll *pll = s32cc_obj2pll(module); in enable_pll() local
473 mux = get_pll_mux(pll); in enable_pll()
478 if (pll->instance != mux->module) { in enable_pll()
483 ret = get_base_addr(pll->instance, drv, &pll_addr); in enable_pll()
504 ret = get_module_rate(&pll->desc, drv, &pll_vco, depth); in enable_pll()
513 (pll_vco == pll->vco_freq)) { in enable_pll()
517 return program_pll(pll, pll_addr, drv, sclk_id, sclk_freq, ldepth); in enable_pll()
578 const struct s32cc_pll *pll; in enable_pll_div() local
588 pll = get_div_pll(pdiv); in enable_pll_div()
589 if (pll == NULL) { in enable_pll_div()
594 ret = get_base_addr(pll->instance, drv, &pll_addr); in enable_pll_div()
600 ret = get_module_rate(&pll->desc, drv, &pll_vco, ldepth); in enable_pll_div()
1560 struct s32cc_pll *pll = s32cc_obj2pll(module); in set_pll_freq() local
1568 if ((pll->vco_freq != 0UL) && (pll->vco_freq != rate)) { in set_pll_freq()
1573 pll->vco_freq = rate; in set_pll_freq()
1574 *orate = pll->vco_freq; in set_pll_freq()
1583 const struct s32cc_pll *pll = s32cc_obj2pll(module); in get_pll_freq() local
1597 ret = get_base_addr(pll->instance, drv, &pll_addr); in get_pll_freq()
1605 *rate = pll->vco_freq; in get_pll_freq()
1657 const struct s32cc_pll *pll; in set_pll_div_freq() local
1671 pll = s32cc_obj2pll(pdiv->parent); in set_pll_div_freq()
1672 if (pll == NULL) { in set_pll_div_freq()
1677 prate = pll->vco_freq; in set_pll_div_freq()
1706 const struct s32cc_pll *pll; in get_pll_div_freq() local
1719 pll = get_div_pll(pdiv); in get_pll_div_freq()
1720 if (pll == NULL) { in get_pll_div_freq()
1725 ret = get_base_addr(pll->instance, drv, &pll_addr); in get_pll_div_freq()