Lines Matching defs:rate
41 static int sclk_div_getdiv(struct clk_hw *hw, unsigned long rate,
44 int div = DIV_ROUND_CLOSEST_ULL((u64)prate, rate);
49 static int sclk_div_bestdiv(struct clk_hw *hw, unsigned long rate,
58 if (!rate)
59 rate = 1;
64 return sclk_div_getdiv(hw, rate, *prate, maxdiv);
68 * unsigned long in rate * i below
70 maxdiv = min(ULONG_MAX / rate, maxdiv);
74 * It's the most ideal case if the requested rate can be
76 * parent rate, so return the divider immediately.
78 if (rate * i == *prate)
81 parent_now = clk_hw_round_rate(parent, rate * i);
84 if (abs(rate - now) < abs(rate - best)) {
106 div = sclk_div_bestdiv(hw, req->rate, &req->best_parent_rate, sclk);
107 req->rate = DIV_ROUND_UP_ULL((u64)req->best_parent_rate, div);
167 static int sclk_div_set_rate(struct clk_hw *hw, unsigned long rate,
174 sclk->cached_div = sclk_div_getdiv(hw, rate, prate, maxdiv);