Lines Matching refs:table
31 static unsigned int _get_table_maxdiv(const struct clk_div_table *table, in _get_table_maxdiv() argument
37 for (clkt = table; clkt->div; clkt++) in _get_table_maxdiv()
43 static unsigned int _get_table_mindiv(const struct clk_div_table *table) in _get_table_mindiv() argument
48 for (clkt = table; clkt->div; clkt++) in _get_table_mindiv()
54 static unsigned int _get_maxdiv(const struct clk_div_table *table, u8 width, in _get_maxdiv() argument
61 if (table) in _get_maxdiv()
62 return _get_table_maxdiv(table, width); in _get_maxdiv()
66 static unsigned int _get_table_div(const struct clk_div_table *table, in _get_table_div() argument
71 for (clkt = table; clkt->div; clkt++) in _get_table_div()
77 static unsigned int _get_div(const struct clk_div_table *table, in _get_div() argument
86 if (table) in _get_div()
87 return _get_table_div(table, val); in _get_div()
91 static unsigned int _get_table_val(const struct clk_div_table *table, in _get_table_val() argument
96 for (clkt = table; clkt->div; clkt++) in _get_table_val()
102 static unsigned int _get_val(const struct clk_div_table *table, in _get_val() argument
111 if (table) in _get_val()
112 return _get_table_val(table, div); in _get_val()
118 const struct clk_div_table *table, in divider_recalc_rate() argument
123 div = _get_div(table, val, flags, width); in divider_recalc_rate()
144 return divider_recalc_rate(hw, parent_rate, val, divider->table, in clk_divider_recalc_rate()
148 static bool _is_valid_table_div(const struct clk_div_table *table, in _is_valid_table_div() argument
153 for (clkt = table; clkt->div; clkt++) in _is_valid_table_div()
159 static bool _is_valid_div(const struct clk_div_table *table, unsigned int div, in _is_valid_div() argument
164 if (table) in _is_valid_div()
165 return _is_valid_table_div(table, div); in _is_valid_div()
169 static int _round_up_table(const struct clk_div_table *table, int div) in _round_up_table() argument
174 for (clkt = table; clkt->div; clkt++) { in _round_up_table()
187 static int _round_down_table(const struct clk_div_table *table, int div) in _round_down_table() argument
190 int down = _get_table_mindiv(table); in _round_down_table()
192 for (clkt = table; clkt->div; clkt++) { in _round_down_table()
205 static int _div_round_up(const struct clk_div_table *table, in _div_round_up() argument
213 if (table) in _div_round_up()
214 div = _round_up_table(table, div); in _div_round_up()
219 static int _div_round_closest(const struct clk_div_table *table, in _div_round_closest() argument
232 } else if (table) { in _div_round_closest()
233 up = _round_up_table(table, up); in _div_round_closest()
234 down = _round_down_table(table, down); in _div_round_closest()
243 static int _div_round(const struct clk_div_table *table, in _div_round() argument
248 return _div_round_closest(table, parent_rate, rate, flags); in _div_round()
250 return _div_round_up(table, parent_rate, rate, flags); in _div_round()
262 static int _next_div(const struct clk_div_table *table, int div, in _next_div() argument
269 if (table) in _next_div()
270 return _round_up_table(table, div); in _next_div()
278 const struct clk_div_table *table, u8 width, in clk_divider_bestdiv() argument
288 maxdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
292 bestdiv = _div_round(table, parent_rate, rate, flags); in clk_divider_bestdiv()
304 for (i = _next_div(table, 0, flags); i <= maxdiv; in clk_divider_bestdiv()
305 i = _next_div(table, i, flags)) { in clk_divider_bestdiv()
325 bestdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
334 const struct clk_div_table *table, in divider_round_rate_parent() argument
339 div = clk_divider_bestdiv(hw, parent, rate, prate, table, width, flags); in divider_round_rate_parent()
347 const struct clk_div_table *table, u8 width, in divider_ro_round_rate_parent() argument
352 div = _get_div(table, val, flags, width); in divider_ro_round_rate_parent()
379 return divider_ro_round_rate(hw, rate, prate, divider->table, in clk_divider_round_rate()
384 return divider_round_rate(hw, rate, prate, divider->table, in clk_divider_round_rate()
389 const struct clk_div_table *table, u8 width, in divider_get_val() argument
396 if (!_is_valid_div(table, div, flags)) in divider_get_val()
399 value = _get_val(table, div, flags, width); in divider_get_val()
413 value = divider_get_val(rate, parent_rate, divider->table, in clk_divider_set_rate()
456 u8 clk_divider_flags, const struct clk_div_table *table, in _register_divider() argument
492 div->table = table; in _register_divider()
571 u8 clk_divider_flags, const struct clk_div_table *table, in clk_register_divider_table() argument
577 width, clk_divider_flags, table, lock); in clk_register_divider_table()
601 u8 clk_divider_flags, const struct clk_div_table *table, in clk_hw_register_divider_table() argument
605 width, clk_divider_flags, table, lock); in clk_hw_register_divider_table()