Lines Matching refs:zclk

198 	struct cpg_z_clk *zclk = to_z_clk(hw);  in cpg_z_clk_recalc_rate()  local
202 val = readl(zclk->reg) & zclk->mask; in cpg_z_clk_recalc_rate()
203 mult = 32 - (val >> __ffs(zclk->mask)); in cpg_z_clk_recalc_rate()
206 32 * zclk->fixed_div); in cpg_z_clk_recalc_rate()
212 struct cpg_z_clk *zclk = to_z_clk(hw); in cpg_z_clk_determine_rate() local
217 if (rate <= zclk->max_rate) { in cpg_z_clk_determine_rate()
219 prate = zclk->max_rate; in cpg_z_clk_determine_rate()
225 prate * zclk->fixed_div); in cpg_z_clk_determine_rate()
227 prate = req->best_parent_rate / zclk->fixed_div; in cpg_z_clk_determine_rate()
243 struct cpg_z_clk *zclk = to_z_clk(hw); in cpg_z_clk_set_rate() local
247 mult = DIV64_U64_ROUND_CLOSEST(rate * 32ULL * zclk->fixed_div, in cpg_z_clk_set_rate()
251 if (readl(zclk->kick_reg) & CPG_FRQCRB_KICK) in cpg_z_clk_set_rate()
254 cpg_reg_modify(zclk->reg, zclk->mask, (32 - mult) << __ffs(zclk->mask)); in cpg_z_clk_set_rate()
260 cpg_reg_modify(zclk->kick_reg, 0, CPG_FRQCRB_KICK); in cpg_z_clk_set_rate()
272 if (!(readl(zclk->kick_reg) & CPG_FRQCRB_KICK)) in cpg_z_clk_set_rate()
294 struct cpg_z_clk *zclk; in cpg_z_clk_register() local
297 zclk = kzalloc(sizeof(*zclk), GFP_KERNEL); in cpg_z_clk_register()
298 if (!zclk) in cpg_z_clk_register()
307 zclk->reg = reg + CPG_FRQCRC; in cpg_z_clk_register()
308 zclk->kick_reg = reg + CPG_FRQCRB; in cpg_z_clk_register()
309 zclk->hw.init = &init; in cpg_z_clk_register()
310 zclk->mask = GENMASK(offset + 4, offset); in cpg_z_clk_register()
311 zclk->fixed_div = div; /* PLLVCO x 1/div x SYS-CPU divider */ in cpg_z_clk_register()
313 clk = clk_register(NULL, &zclk->hw); in cpg_z_clk_register()
315 kfree(zclk); in cpg_z_clk_register()
319 zclk->max_rate = clk_hw_get_rate(clk_hw_get_parent(&zclk->hw)) / in cpg_z_clk_register()
320 zclk->fixed_div; in cpg_z_clk_register()