Lines Matching refs:rate
152 * Calculate m/n:d rate
155 * rate = ----------- x ---
159 calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
162 rate = mult_frac(rate, 2, hid_div + 1);
165 rate = mult_frac(rate, m, n);
167 return rate;
210 unsigned long clk_flags, rate = req->rate;
217 f = qcom_find_freq_floor(f, rate);
220 f = qcom_find_freq(f, rate);
239 rate = f->freq;
241 if (!rate)
242 rate = req->rate;
243 rate /= 2;
244 rate *= f->pre_div + 1;
248 u64 tmp = rate;
251 rate = tmp;
254 rate = clk_hw_get_rate(p);
257 req->best_parent_rate = rate;
258 req->rate = f->freq;
351 static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
359 f = qcom_find_freq_floor(rcg->freq_tbl, rate);
362 f = qcom_find_freq(rcg->freq_tbl, rate);
374 static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
377 return __clk_rcg2_set_rate(hw, rate, CEIL);
380 static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate,
383 return __clk_rcg2_set_rate(hw, rate, FLOOR);
387 unsigned long rate, unsigned long parent_rate, u8 index)
389 return __clk_rcg2_set_rate(hw, rate, CEIL);
393 unsigned long rate, unsigned long parent_rate, u8 index)
395 return __clk_rcg2_set_rate(hw, rate, FLOOR);
520 static const struct frac_entry frac_table_675m[] = { /* link rate of 270M */
531 static struct frac_entry frac_table_810m[] = { /* Link rate of 162M */
542 static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
560 request = rate;
582 unsigned long rate, unsigned long parent_rate, u8 index)
585 return clk_edp_pixel_set_rate(hw, rate, parent_rate);
610 request = req->rate;
622 req->rate = calc_rate(req->best_parent_rate,
652 if (req->rate == 0)
656 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, req->rate);
658 div = DIV_ROUND_UP((2 * parent_rate), req->rate) - 1;
661 req->rate = calc_rate(parent_rate, 0, 0, 0, div);
666 static int clk_byte_set_rate(struct clk_hw *hw, unsigned long rate,
674 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
683 unsigned long rate, unsigned long parent_rate, u8 index)
686 return clk_byte_set_rate(hw, rate, parent_rate);
707 unsigned long rate = req->rate;
709 if (rate == 0)
713 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, rate);
715 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
718 req->rate = calc_rate(parent_rate, 0, 0, 0, div);
723 static int clk_byte2_set_rate(struct clk_hw *hw, unsigned long rate,
733 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
753 unsigned long rate, unsigned long parent_rate, u8 index)
756 return clk_byte2_set_rate(hw, rate, parent_rate);
787 request = (req->rate * frac->den) / frac->num;
795 req->rate = (src_rate * frac->num) / frac->den;
802 static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
825 request = (rate * frac->den) / frac->num;
844 static int clk_pixel_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
847 return clk_pixel_set_rate(hw, rate, parent_rate);
883 if (req->rate == clk_hw_get_rate(xo)) {
891 parent_req.rate = req->rate * mux_div;
893 /* This has to be a fixed rate PLL */
896 if (parent_req.rate == p0_rate) {
897 req->rate = req->best_parent_rate = p0_rate;
903 /* Are we going back to a previously used rate? */
904 if (clk_hw_get_rate(p2) == parent_req.rate)
927 req->rate = req->best_parent_rate = parent_req.rate;
928 req->rate /= mux_div;
933 static int clk_gfx3d_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
953 static int clk_gfx3d_set_rate(struct clk_hw *hw, unsigned long rate,
1023 static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
1029 f = qcom_find_freq(rcg->freq_tbl, rate);
1045 unsigned long rate, unsigned long parent_rate, u8 index)
1047 return clk_rcg2_shared_set_rate(hw, rate, parent_rate);
1063 /* Write back the stored configuration corresponding to current rate */
1333 static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate,
1343 rational_best_approximation(parent_rate, rate,
1378 unsigned long rate, unsigned long parent_rate, u8 index)
1380 return clk_rcg2_dp_set_rate(hw, rate, parent_rate);
1390 /* Parent rate is a fixed phy link rate */
1391 rational_best_approximation(req->best_parent_rate, req->rate,
1400 req->rate = tmp;