Lines Matching refs:frac
43 u32 frac; member
78 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_recalc_rate() local
80 return parent_rate * (frac->mul + 1) + in sam9x60_frac_pll_recalc_rate()
81 DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22)); in sam9x60_frac_pll_recalc_rate()
86 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_set() local
100 (cmul == frac->mul && cfrac == frac->frac)) in sam9x60_frac_pll_set()
111 (frac->mul << core->layout->mul_shift) | in sam9x60_frac_pll_set()
112 (frac->frac << core->layout->frac_shift)); in sam9x60_frac_pll_set()
192 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_compute_mul_frac() local
221 frac->mul = nmul - 1; in sam9x60_frac_pll_compute_mul_frac()
222 frac->frac = nfrac; in sam9x60_frac_pll_compute_mul_frac()
248 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_set_rate_chg() local
266 if (cmul == frac->mul && cfrac == frac->frac) in sam9x60_frac_pll_set_rate_chg()
270 (frac->mul << core->layout->mul_shift) | in sam9x60_frac_pll_set_rate_chg()
271 (frac->frac << core->layout->frac_shift)); in sam9x60_frac_pll_set_rate_chg()
298 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_save_context() local
300 frac->pms.status = sam9x60_pll_ready(core->regmap, core->id); in sam9x60_frac_pll_save_context()
308 struct sam9x60_frac *frac = to_sam9x60_frac(core); in sam9x60_frac_pll_restore_context() local
310 if (frac->pms.status) in sam9x60_frac_pll_restore_context()
617 struct sam9x60_frac *frac; in sam9x60_clk_register_frac_pll() local
627 frac = kzalloc(sizeof(*frac), GFP_KERNEL); in sam9x60_clk_register_frac_pll()
628 if (!frac) in sam9x60_clk_register_frac_pll()
644 frac->core.id = id; in sam9x60_clk_register_frac_pll()
645 frac->core.hw.init = &init; in sam9x60_clk_register_frac_pll()
646 frac->core.characteristics = characteristics; in sam9x60_clk_register_frac_pll()
647 frac->core.layout = layout; in sam9x60_clk_register_frac_pll()
648 frac->core.regmap = regmap; in sam9x60_clk_register_frac_pll()
649 frac->core.lock = lock; in sam9x60_clk_register_frac_pll()
651 spin_lock_irqsave(frac->core.lock, irqflags); in sam9x60_clk_register_frac_pll()
656 frac->mul = FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, val); in sam9x60_clk_register_frac_pll()
657 frac->frac = FIELD_GET(PMC_PLL_CTRL1_FRACR_MSK, val); in sam9x60_clk_register_frac_pll()
672 ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN, in sam9x60_clk_register_frac_pll()
679 spin_unlock_irqrestore(frac->core.lock, irqflags); in sam9x60_clk_register_frac_pll()
681 hw = &frac->core.hw; in sam9x60_clk_register_frac_pll()
684 kfree(frac); in sam9x60_clk_register_frac_pll()
691 spin_unlock_irqrestore(frac->core.lock, irqflags); in sam9x60_clk_register_frac_pll()
692 kfree(frac); in sam9x60_clk_register_frac_pll()