Lines Matching refs:frac
36 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_recalc_rate() local
40 div = readl_relaxed(frac->reg) >> frac->shift; in clk_frac_recalc_rate()
41 div &= (1 << frac->width) - 1; in clk_frac_recalc_rate()
44 return tmp_rate >> frac->width; in clk_frac_recalc_rate()
50 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_round_rate() local
59 tmp <<= frac->width; in clk_frac_round_rate()
67 result = tmp_rate >> frac->width; in clk_frac_round_rate()
68 if ((result << frac->width) < tmp_rate) in clk_frac_round_rate()
76 struct clk_frac *frac = to_clk_frac(hw); in clk_frac_set_rate() local
85 tmp <<= frac->width; in clk_frac_set_rate()
94 val = readl_relaxed(frac->reg); in clk_frac_set_rate()
95 val &= ~(((1 << frac->width) - 1) << frac->shift); in clk_frac_set_rate()
96 val |= div << frac->shift; in clk_frac_set_rate()
97 writel_relaxed(val, frac->reg); in clk_frac_set_rate()
101 return mxs_clk_wait(frac->reg, frac->busy); in clk_frac_set_rate()
113 struct clk_frac *frac; in mxs_clk_frac() local
117 frac = kzalloc(sizeof(*frac), GFP_KERNEL); in mxs_clk_frac()
118 if (!frac) in mxs_clk_frac()
127 frac->reg = reg; in mxs_clk_frac()
128 frac->shift = shift; in mxs_clk_frac()
129 frac->width = width; in mxs_clk_frac()
130 frac->busy = busy; in mxs_clk_frac()
131 frac->hw.init = &init; in mxs_clk_frac()
133 clk = clk_register(NULL, &frac->hw); in mxs_clk_frac()
135 kfree(frac); in mxs_clk_frac()