Lines Matching refs:rate
141 * Calculate m/n:d rate
144 * rate = ----------- x ---
148 calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
151 rate = mult_frac(rate, 2, hid_div + 1);
154 rate = mult_frac(rate, m, n);
156 return rate;
190 unsigned long clk_flags, rate = req->rate;
197 f = qcom_find_freq_floor(f, rate);
200 f = qcom_find_freq(f, rate);
219 rate = f->freq;
221 if (!rate)
222 rate = req->rate;
223 rate /= 2;
224 rate *= f->pre_div + 1;
228 u64 tmp = rate;
231 rate = tmp;
234 rate = clk_hw_get_rate(p);
237 req->best_parent_rate = rate;
238 req->rate = f->freq;
316 static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
324 f = qcom_find_freq_floor(rcg->freq_tbl, rate);
327 f = qcom_find_freq(rcg->freq_tbl, rate);
339 static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
342 return __clk_rcg2_set_rate(hw, rate, CEIL);
345 static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate,
348 return __clk_rcg2_set_rate(hw, rate, FLOOR);
352 unsigned long rate, unsigned long parent_rate, u8 index)
354 return __clk_rcg2_set_rate(hw, rate, CEIL);
358 unsigned long rate, unsigned long parent_rate, u8 index)
360 return __clk_rcg2_set_rate(hw, rate, FLOOR);
390 static const struct frac_entry frac_table_675m[] = { /* link rate of 270M */
401 static struct frac_entry frac_table_810m[] = { /* Link rate of 162M */
412 static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
430 request = rate;
452 unsigned long rate, unsigned long parent_rate, u8 index)
455 return clk_edp_pixel_set_rate(hw, rate, parent_rate);
480 request = req->rate;
492 req->rate = calc_rate(req->best_parent_rate,
522 if (req->rate == 0)
526 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, req->rate);
528 div = DIV_ROUND_UP((2 * parent_rate), req->rate) - 1;
531 req->rate = calc_rate(parent_rate, 0, 0, 0, div);
536 static int clk_byte_set_rate(struct clk_hw *hw, unsigned long rate,
544 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
553 unsigned long rate, unsigned long parent_rate, u8 index)
556 return clk_byte_set_rate(hw, rate, parent_rate);
577 unsigned long rate = req->rate;
579 if (rate == 0)
583 req->best_parent_rate = parent_rate = clk_hw_round_rate(p, rate);
585 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
588 req->rate = calc_rate(parent_rate, 0, 0, 0, div);
593 static int clk_byte2_set_rate(struct clk_hw *hw, unsigned long rate,
603 div = DIV_ROUND_UP((2 * parent_rate), rate) - 1;
623 unsigned long rate, unsigned long parent_rate, u8 index)
626 return clk_byte2_set_rate(hw, rate, parent_rate);
657 request = (req->rate * frac->den) / frac->num;
665 req->rate = (src_rate * frac->num) / frac->den;
672 static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
695 request = (rate * frac->den) / frac->num;
714 static int clk_pixel_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
717 return clk_pixel_set_rate(hw, rate, parent_rate);
740 if (req->rate == clk_hw_get_rate(xo)) {
749 /* PLL9 is a fixed rate PLL */
752 parent_req.rate = req->rate = min(req->rate, p9_rate);
753 if (req->rate == p9_rate) {
754 req->rate = req->best_parent_rate = p9_rate;
760 /* Are we going back to a previously used rate? */
761 if (clk_hw_get_rate(p8) == req->rate)
775 req->rate = req->best_parent_rate = parent_req.rate;
780 static int clk_gfx3d_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
796 static int clk_gfx3d_set_rate(struct clk_hw *hw, unsigned long rate,
866 static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
872 f = qcom_find_freq(rcg->freq_tbl, rate);
887 unsigned long rate, unsigned long parent_rate, u8 index)
889 return clk_rcg2_shared_set_rate(hw, rate, parent_rate);
940 /* Write back the stored configuration corresponding to current rate */
1136 static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate,
1146 rational_best_approximation(parent_rate, rate,
1181 unsigned long rate, unsigned long parent_rate, u8 index)
1183 return clk_rcg2_dp_set_rate(hw, rate, parent_rate);
1193 /* Parent rate is a fixed phy link rate */
1194 rational_best_approximation(req->best_parent_rate, req->rate,
1203 req->rate = tmp;