Lines Matching refs:div
165 struct lgm_clk_divider *div = to_lgm_clk_divider(hw); in lgm_clk_divider_enable_disable() local
167 if (div->flags != DIV_CLK_NO_MASK) in lgm_clk_divider_enable_disable()
168 lgm_set_clk_val(div->membase, div->reg, div->shift_gate, in lgm_clk_divider_enable_disable()
169 div->width_gate, enable); in lgm_clk_divider_enable_disable()
197 struct lgm_clk_divider *div; in lgm_clk_register_divider() local
207 div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL); in lgm_clk_register_divider()
208 if (!div) in lgm_clk_register_divider()
217 div->membase = ctx->membase; in lgm_clk_register_divider()
218 div->reg = reg; in lgm_clk_register_divider()
219 div->shift = shift; in lgm_clk_register_divider()
220 div->width = width; in lgm_clk_register_divider()
221 div->shift_gate = shift_gate; in lgm_clk_register_divider()
222 div->width_gate = width_gate; in lgm_clk_register_divider()
223 div->flags = cflags; in lgm_clk_register_divider()
224 div->table = list->div_table; in lgm_clk_register_divider()
225 div->hw.init = &init; in lgm_clk_register_divider()
227 hw = &div->hw; in lgm_clk_register_divider()
233 lgm_set_clk_val(div->membase, reg, shift, width, list->div_val); in lgm_clk_register_divider()
246 list->mult, list->div); in lgm_clk_register_fixed_factor()
409 do_div(prate, ddiv->div); in lgm_clk_ddiv_recalc_rate()
434 lgm_clk_get_ddiv_val(u32 div, u32 *ddiv1, u32 *ddiv2) in lgm_clk_get_ddiv_val() argument
441 if (div > MAX_DIVIDER_VAL) in lgm_clk_get_ddiv_val()
442 div = MAX_DIVIDER_VAL; in lgm_clk_get_ddiv_val()
444 if (div > 1) { in lgm_clk_get_ddiv_val()
446 temp = DIV_ROUND_UP_ULL((u64)div, idx); in lgm_clk_get_ddiv_val()
447 if (div % idx == 0 && temp <= MAX_DDIV_REG) in lgm_clk_get_ddiv_val()
466 u32 div, ddiv1, ddiv2; in lgm_clk_ddiv_set_rate() local
468 div = DIV_ROUND_CLOSEST_ULL((u64)prate, rate); in lgm_clk_ddiv_set_rate()
471 div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); in lgm_clk_ddiv_set_rate()
472 div = div * 2; in lgm_clk_ddiv_set_rate()
475 if (div <= 0) in lgm_clk_ddiv_set_rate()
478 if (lgm_clk_get_ddiv_val(div, &ddiv1, &ddiv2)) in lgm_clk_ddiv_set_rate()
495 u32 div, ddiv1, ddiv2; in lgm_clk_ddiv_round_rate() local
498 div = DIV_ROUND_CLOSEST_ULL((u64)*prate, rate); in lgm_clk_ddiv_round_rate()
502 div = div * 2; in lgm_clk_ddiv_round_rate()
503 div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); in lgm_clk_ddiv_round_rate()
506 if (div <= 0) in lgm_clk_ddiv_round_rate()
509 if (lgm_clk_get_ddiv_val(div, &ddiv1, &ddiv2) != 0) in lgm_clk_ddiv_round_rate()
510 if (lgm_clk_get_ddiv_val(div + 1, &ddiv1, &ddiv2) != 0) in lgm_clk_ddiv_round_rate()
569 ddiv->div = 5; in lgm_clk_register_ddiv()