Lines Matching refs:aux

47 	struct clk_aux *aux = to_clk_aux(hw);  in aux_calc_rate()  local
48 struct aux_rate_tbl *rtbl = aux->rtbl; in aux_calc_rate()
58 struct clk_aux *aux = to_clk_aux(hw); in clk_aux_round_rate() local
62 aux->rtbl_cnt, &unused); in clk_aux_round_rate()
68 struct clk_aux *aux = to_clk_aux(hw); in clk_aux_recalc_rate() local
72 if (aux->lock) in clk_aux_recalc_rate()
73 spin_lock_irqsave(aux->lock, flags); in clk_aux_recalc_rate()
75 val = readl_relaxed(aux->reg); in clk_aux_recalc_rate()
77 if (aux->lock) in clk_aux_recalc_rate()
78 spin_unlock_irqrestore(aux->lock, flags); in clk_aux_recalc_rate()
80 eqn = (val >> aux->masks->eq_sel_shift) & aux->masks->eq_sel_mask; in clk_aux_recalc_rate()
81 if (eqn == aux->masks->eq1_mask) in clk_aux_recalc_rate()
85 num = (val >> aux->masks->xscale_sel_shift) & in clk_aux_recalc_rate()
86 aux->masks->xscale_sel_mask; in clk_aux_recalc_rate()
89 den *= (val >> aux->masks->yscale_sel_shift) & in clk_aux_recalc_rate()
90 aux->masks->yscale_sel_mask; in clk_aux_recalc_rate()
102 struct clk_aux *aux = to_clk_aux(hw); in clk_aux_set_rate() local
103 struct aux_rate_tbl *rtbl = aux->rtbl; in clk_aux_set_rate()
107 clk_round_rate_index(hw, drate, prate, aux_calc_rate, aux->rtbl_cnt, in clk_aux_set_rate()
110 if (aux->lock) in clk_aux_set_rate()
111 spin_lock_irqsave(aux->lock, flags); in clk_aux_set_rate()
113 val = readl_relaxed(aux->reg) & in clk_aux_set_rate()
114 ~(aux->masks->eq_sel_mask << aux->masks->eq_sel_shift); in clk_aux_set_rate()
115 val |= (rtbl[i].eq & aux->masks->eq_sel_mask) << in clk_aux_set_rate()
116 aux->masks->eq_sel_shift; in clk_aux_set_rate()
117 val &= ~(aux->masks->xscale_sel_mask << aux->masks->xscale_sel_shift); in clk_aux_set_rate()
118 val |= (rtbl[i].xscale & aux->masks->xscale_sel_mask) << in clk_aux_set_rate()
119 aux->masks->xscale_sel_shift; in clk_aux_set_rate()
120 val &= ~(aux->masks->yscale_sel_mask << aux->masks->yscale_sel_shift); in clk_aux_set_rate()
121 val |= (rtbl[i].yscale & aux->masks->yscale_sel_mask) << in clk_aux_set_rate()
122 aux->masks->yscale_sel_shift; in clk_aux_set_rate()
123 writel_relaxed(val, aux->reg); in clk_aux_set_rate()
125 if (aux->lock) in clk_aux_set_rate()
126 spin_unlock_irqrestore(aux->lock, flags); in clk_aux_set_rate()
142 struct clk_aux *aux; in clk_register_aux() local
151 aux = kzalloc(sizeof(*aux), GFP_KERNEL); in clk_register_aux()
152 if (!aux) in clk_register_aux()
157 aux->masks = &default_aux_masks; in clk_register_aux()
159 aux->masks = masks; in clk_register_aux()
161 aux->reg = reg; in clk_register_aux()
162 aux->rtbl = rtbl; in clk_register_aux()
163 aux->rtbl_cnt = rtbl_cnt; in clk_register_aux()
164 aux->lock = lock; in clk_register_aux()
165 aux->hw.init = &init; in clk_register_aux()
173 clk = clk_register(NULL, &aux->hw); in clk_register_aux()
182 aux->masks->enable_bit, 0, lock); in clk_register_aux()
193 kfree(aux); in clk_register_aux()