Lines Matching refs:ddiv

421 	struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw);  in lgm_clk_ddiv_recalc_rate()  local
425 div0 = lgm_get_clk_val(ddiv->membase, ddiv->reg, in lgm_clk_ddiv_recalc_rate()
426 ddiv->shift0, ddiv->width0) + 1; in lgm_clk_ddiv_recalc_rate()
427 div1 = lgm_get_clk_val(ddiv->membase, ddiv->reg, in lgm_clk_ddiv_recalc_rate()
428 ddiv->shift1, ddiv->width1) + 1; in lgm_clk_ddiv_recalc_rate()
429 exdiv = lgm_get_clk_val(ddiv->membase, ddiv->reg, in lgm_clk_ddiv_recalc_rate()
430 ddiv->shift2, ddiv->width2); in lgm_clk_ddiv_recalc_rate()
436 do_div(prate, ddiv->div); in lgm_clk_ddiv_recalc_rate()
437 prate *= ddiv->mult; in lgm_clk_ddiv_recalc_rate()
445 struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); in lgm_clk_ddiv_enable() local
448 spin_lock_irqsave(&ddiv->lock, flags); in lgm_clk_ddiv_enable()
449 lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift_gate, in lgm_clk_ddiv_enable()
450 ddiv->width_gate, 1); in lgm_clk_ddiv_enable()
451 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_enable()
457 struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); in lgm_clk_ddiv_disable() local
460 spin_lock_irqsave(&ddiv->lock, flags); in lgm_clk_ddiv_disable()
461 lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift_gate, in lgm_clk_ddiv_disable()
462 ddiv->width_gate, 0); in lgm_clk_ddiv_disable()
463 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_disable()
498 struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); in lgm_clk_ddiv_set_rate() local
504 spin_lock_irqsave(&ddiv->lock, flags); in lgm_clk_ddiv_set_rate()
505 if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { in lgm_clk_ddiv_set_rate()
511 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_set_rate()
516 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_set_rate()
520 lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift0, ddiv->width0, in lgm_clk_ddiv_set_rate()
523 lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift1, ddiv->width1, in lgm_clk_ddiv_set_rate()
525 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_set_rate()
534 struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); in lgm_clk_ddiv_round_rate() local
542 spin_lock_irqsave(&ddiv->lock, flags); in lgm_clk_ddiv_round_rate()
543 if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { in lgm_clk_ddiv_round_rate()
547 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_round_rate()
561 spin_lock_irqsave(&ddiv->lock, flags); in lgm_clk_ddiv_round_rate()
562 if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { in lgm_clk_ddiv_round_rate()
566 spin_unlock_irqrestore(&ddiv->lock, flags); in lgm_clk_ddiv_round_rate()
590 struct lgm_clk_ddiv *ddiv; in lgm_clk_register_ddiv() local
592 ddiv = devm_kzalloc(dev, sizeof(*ddiv), GFP_KERNEL); in lgm_clk_register_ddiv()
593 if (!ddiv) in lgm_clk_register_ddiv()
602 ddiv->membase = ctx->membase; in lgm_clk_register_ddiv()
603 ddiv->lock = ctx->lock; in lgm_clk_register_ddiv()
604 ddiv->reg = list->reg; in lgm_clk_register_ddiv()
605 ddiv->shift0 = list->shift0; in lgm_clk_register_ddiv()
606 ddiv->width0 = list->width0; in lgm_clk_register_ddiv()
607 ddiv->shift1 = list->shift1; in lgm_clk_register_ddiv()
608 ddiv->width1 = list->width1; in lgm_clk_register_ddiv()
609 ddiv->shift_gate = list->shift_gate; in lgm_clk_register_ddiv()
610 ddiv->width_gate = list->width_gate; in lgm_clk_register_ddiv()
611 ddiv->shift2 = list->ex_shift; in lgm_clk_register_ddiv()
612 ddiv->width2 = list->ex_width; in lgm_clk_register_ddiv()
613 ddiv->flags = list->div_flags; in lgm_clk_register_ddiv()
614 ddiv->mult = 2; in lgm_clk_register_ddiv()
615 ddiv->div = 5; in lgm_clk_register_ddiv()
616 ddiv->hw.init = &init; in lgm_clk_register_ddiv()
618 hw = &ddiv->hw; in lgm_clk_register_ddiv()