Lines Matching refs:rate

187 				unsigned long rate,  in alchemy_clk_aux_setr()  argument
191 unsigned long d = rate; in alchemy_clk_aux_setr()
193 if (rate) in alchemy_clk_aux_setr()
207 unsigned long rate, in alchemy_clk_aux_roundr() argument
213 if (!rate || !*parent_rate) in alchemy_clk_aux_roundr()
216 mult = rate / (*parent_rate); in alchemy_clk_aux_roundr()
368 static long alchemy_calc_div(unsigned long rate, unsigned long prate, in alchemy_calc_div() argument
373 div1 = prate / rate; in alchemy_calc_div()
374 if ((prate / div1) > rate) in alchemy_calc_div()
425 if (pr < req->rate) in alchemy_clk_fgcs_detr()
429 tdv = alchemy_calc_div(req->rate, pr, scale, maxdiv, NULL); in alchemy_clk_fgcs_detr()
431 diff = req->rate - nr; in alchemy_clk_fgcs_detr()
432 if (nr > req->rate) in alchemy_clk_fgcs_detr()
451 tpr = req->rate * j; in alchemy_clk_fgcs_detr()
456 tdv = alchemy_calc_div(req->rate, pr, scale, maxdiv, in alchemy_clk_fgcs_detr()
459 diff = req->rate - nr; in alchemy_clk_fgcs_detr()
460 if (nr > req->rate) in alchemy_clk_fgcs_detr()
478 req->rate = br; in alchemy_clk_fgcs_detr()
541 static int alchemy_clk_fgv1_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv1_setr() argument
548 if (!rate || !parent_rate || rate > (parent_rate / 2)) in alchemy_clk_fgv1_setr()
550 ret = alchemy_calc_div(rate, parent_rate, 2, 512, &div); in alchemy_clk_fgv1_setr()
662 static int alchemy_clk_fgv2_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv2_setr() argument
669 if (!rate || !parent_rate || rate > parent_rate) in alchemy_clk_fgv2_setr()
673 ret = alchemy_calc_div(rate, parent_rate, v ? 1 : 2, in alchemy_clk_fgv2_setr()
885 static int alchemy_clk_csrc_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_csrc_setr() argument
892 if (!rate || !parent_rate || rate > parent_rate) in alchemy_clk_csrc_setr()
895 d = (parent_rate + (rate / 2)) / rate; in alchemy_clk_csrc_setr()