Lines Matching refs:rate
148 calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div) in calc_rate() argument
151 rate *= 2; in calc_rate()
152 rate /= hid_div + 1; in calc_rate()
156 u64 tmp = rate; in calc_rate()
159 rate = tmp; in calc_rate()
162 return rate; in calc_rate()
196 unsigned long clk_flags, rate = req->rate; in _freq_tbl_determine_rate() local
203 f = qcom_find_freq_floor(f, rate); in _freq_tbl_determine_rate()
206 f = qcom_find_freq(f, rate); in _freq_tbl_determine_rate()
225 rate = f->freq; in _freq_tbl_determine_rate()
227 if (!rate) in _freq_tbl_determine_rate()
228 rate = req->rate; in _freq_tbl_determine_rate()
229 rate /= 2; in _freq_tbl_determine_rate()
230 rate *= f->pre_div + 1; in _freq_tbl_determine_rate()
234 u64 tmp = rate; in _freq_tbl_determine_rate()
237 rate = tmp; in _freq_tbl_determine_rate()
240 rate = clk_hw_get_rate(p); in _freq_tbl_determine_rate()
243 req->best_parent_rate = rate; in _freq_tbl_determine_rate()
244 req->rate = f->freq; in _freq_tbl_determine_rate()
313 static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, in __clk_rcg2_set_rate() argument
321 f = qcom_find_freq_floor(rcg->freq_tbl, rate); in __clk_rcg2_set_rate()
324 f = qcom_find_freq(rcg->freq_tbl, rate); in __clk_rcg2_set_rate()
336 static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, in clk_rcg2_set_rate() argument
339 return __clk_rcg2_set_rate(hw, rate, CEIL); in clk_rcg2_set_rate()
342 static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate, in clk_rcg2_set_floor_rate() argument
345 return __clk_rcg2_set_rate(hw, rate, FLOOR); in clk_rcg2_set_floor_rate()
349 unsigned long rate, unsigned long parent_rate, u8 index) in clk_rcg2_set_rate_and_parent() argument
351 return __clk_rcg2_set_rate(hw, rate, CEIL); in clk_rcg2_set_rate_and_parent()
355 unsigned long rate, unsigned long parent_rate, u8 index) in clk_rcg2_set_floor_rate_and_parent() argument
357 return __clk_rcg2_set_rate(hw, rate, FLOOR); in clk_rcg2_set_floor_rate_and_parent()
490 static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate, in clk_edp_pixel_set_rate() argument
508 request = rate; in clk_edp_pixel_set_rate()
530 unsigned long rate, unsigned long parent_rate, u8 index) in clk_edp_pixel_set_rate_and_parent() argument
533 return clk_edp_pixel_set_rate(hw, rate, parent_rate); in clk_edp_pixel_set_rate_and_parent()
558 request = req->rate; in clk_edp_pixel_determine_rate()
570 req->rate = calc_rate(req->best_parent_rate, in clk_edp_pixel_determine_rate()
600 if (req->rate == 0) in clk_byte_determine_rate()
604 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, req->rate); in clk_byte_determine_rate()
606 div = DIV_ROUND_UP((2 * parent_rate), req->rate) - 1; in clk_byte_determine_rate()
609 req->rate = calc_rate(parent_rate, 0, 0, 0, div); in clk_byte_determine_rate()
614 static int clk_byte_set_rate(struct clk_hw *hw, unsigned long rate, in clk_byte_set_rate() argument
622 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1; in clk_byte_set_rate()
631 unsigned long rate, unsigned long parent_rate, u8 index) in clk_byte_set_rate_and_parent() argument
634 return clk_byte_set_rate(hw, rate, parent_rate); in clk_byte_set_rate_and_parent()
655 unsigned long rate = req->rate; in clk_byte2_determine_rate() local
657 if (rate == 0) in clk_byte2_determine_rate()
661 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, rate); in clk_byte2_determine_rate()
663 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1; in clk_byte2_determine_rate()
666 req->rate = calc_rate(parent_rate, 0, 0, 0, div); in clk_byte2_determine_rate()
671 static int clk_byte2_set_rate(struct clk_hw *hw, unsigned long rate, in clk_byte2_set_rate() argument
681 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1; in clk_byte2_set_rate()
701 unsigned long rate, unsigned long parent_rate, u8 index) in clk_byte2_set_rate_and_parent() argument
704 return clk_byte2_set_rate(hw, rate, parent_rate); in clk_byte2_set_rate_and_parent()
734 request = (req->rate * frac->den) / frac->num; in clk_pixel_determine_rate()
742 req->rate = (src_rate * frac->num) / frac->den; in clk_pixel_determine_rate()
749 static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate, in clk_pixel_set_rate() argument
772 request = (rate * frac->den) / frac->num; in clk_pixel_set_rate()
791 static int clk_pixel_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, in clk_pixel_set_rate_and_parent() argument
794 return clk_pixel_set_rate(hw, rate, parent_rate); in clk_pixel_set_rate_and_parent()
830 if (req->rate == clk_hw_get_rate(xo)) { in clk_gfx3d_determine_rate()
838 parent_req.rate = req->rate * mux_div; in clk_gfx3d_determine_rate()
843 if (parent_req.rate == p0_rate) { in clk_gfx3d_determine_rate()
844 req->rate = req->best_parent_rate = p0_rate; in clk_gfx3d_determine_rate()
851 if (clk_hw_get_rate(p2) == parent_req.rate) in clk_gfx3d_determine_rate()
865 req->rate = req->best_parent_rate = parent_req.rate; in clk_gfx3d_determine_rate()
866 req->rate /= mux_div; in clk_gfx3d_determine_rate()
871 static int clk_gfx3d_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, in clk_gfx3d_set_rate_and_parent() argument
891 static int clk_gfx3d_set_rate(struct clk_hw *hw, unsigned long rate, in clk_gfx3d_set_rate() argument
961 static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate, in clk_rcg2_shared_set_rate() argument
967 f = qcom_find_freq(rcg->freq_tbl, rate); in clk_rcg2_shared_set_rate()
982 unsigned long rate, unsigned long parent_rate, u8 index) in clk_rcg2_shared_set_rate_and_parent() argument
984 return clk_rcg2_shared_set_rate(hw, rate, parent_rate); in clk_rcg2_shared_set_rate_and_parent()
1231 static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate, in clk_rcg2_dp_set_rate() argument
1241 rational_best_approximation(parent_rate, rate, in clk_rcg2_dp_set_rate()
1276 unsigned long rate, unsigned long parent_rate, u8 index) in clk_rcg2_dp_set_rate_and_parent() argument
1278 return clk_rcg2_dp_set_rate(hw, rate, parent_rate); in clk_rcg2_dp_set_rate_and_parent()
1289 rational_best_approximation(req->best_parent_rate, req->rate, in clk_rcg2_dp_determine_rate()
1298 req->rate = tmp; in clk_rcg2_dp_determine_rate()