Lines Matching refs:rate

186 				unsigned long rate,  in alchemy_clk_aux_setr()  argument
190 unsigned long d = rate; in alchemy_clk_aux_setr()
192 if (rate) in alchemy_clk_aux_setr()
206 unsigned long rate, in alchemy_clk_aux_roundr() argument
212 if (!rate || !*parent_rate) in alchemy_clk_aux_roundr()
215 mult = rate / (*parent_rate); in alchemy_clk_aux_roundr()
367 static long alchemy_calc_div(unsigned long rate, unsigned long prate, in alchemy_calc_div() argument
372 div1 = prate / rate; in alchemy_calc_div()
373 if ((prate / div1) > rate) in alchemy_calc_div()
392 static long alchemy_clk_fgcs_detr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgcs_detr() argument
425 if (pr < rate) in alchemy_clk_fgcs_detr()
429 tdv = alchemy_calc_div(rate, pr, scale, maxdiv, NULL); in alchemy_clk_fgcs_detr()
431 diff = rate - nr; in alchemy_clk_fgcs_detr()
432 if (nr > rate) in alchemy_clk_fgcs_detr()
451 tpr = rate * j; in alchemy_clk_fgcs_detr()
456 tdv = alchemy_calc_div(rate, pr, scale, maxdiv, NULL); in alchemy_clk_fgcs_detr()
458 diff = rate - nr; in alchemy_clk_fgcs_detr()
459 if (nr > rate) in alchemy_clk_fgcs_detr()
535 static int alchemy_clk_fgv1_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv1_setr() argument
542 if (!rate || !parent_rate || rate > (parent_rate / 2)) in alchemy_clk_fgv1_setr()
544 ret = alchemy_calc_div(rate, parent_rate, 2, 512, &div); in alchemy_clk_fgv1_setr()
565 static long alchemy_clk_fgv1_detr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv1_detr() argument
571 return alchemy_clk_fgcs_detr(hw, rate, best_parent_rate, in alchemy_clk_fgv1_detr()
660 static int alchemy_clk_fgv2_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv2_setr() argument
667 if (!rate || !parent_rate || rate > parent_rate) in alchemy_clk_fgv2_setr()
671 ret = alchemy_calc_div(rate, parent_rate, v ? 1 : 2, in alchemy_clk_fgv2_setr()
699 static long alchemy_clk_fgv2_detr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_fgv2_detr() argument
716 return alchemy_clk_fgcs_detr(hw, rate, best_parent_rate, in alchemy_clk_fgv2_detr()
887 static int alchemy_clk_csrc_setr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_csrc_setr() argument
894 if (!rate || !parent_rate || rate > parent_rate) in alchemy_clk_csrc_setr()
897 d = (parent_rate + (rate / 2)) / rate; in alchemy_clk_csrc_setr()
920 static long alchemy_clk_csrc_detr(struct clk_hw *hw, unsigned long rate, in alchemy_clk_csrc_detr() argument
929 return alchemy_clk_fgcs_detr(hw, rate, best_parent_rate, in alchemy_clk_csrc_detr()