Lines Matching full:table
44 static unsigned int _get_table_maxdiv(const struct clk_div_table *table, in _get_table_maxdiv() argument
50 for (clkt = table; clkt->div; clkt++) in _get_table_maxdiv()
56 static unsigned int _get_table_mindiv(const struct clk_div_table *table) in _get_table_mindiv() argument
61 for (clkt = table; clkt->div; clkt++) in _get_table_mindiv()
67 static unsigned int _get_maxdiv(const struct clk_div_table *table, u8 width, in _get_maxdiv() argument
74 if (table) in _get_maxdiv()
75 return _get_table_maxdiv(table, width); in _get_maxdiv()
79 static unsigned int _get_table_div(const struct clk_div_table *table, in _get_table_div() argument
84 for (clkt = table; clkt->div; clkt++) in _get_table_div()
90 static unsigned int _get_div(const struct clk_div_table *table, in _get_div() argument
99 if (table) in _get_div()
100 return _get_table_div(table, val); in _get_div()
104 static unsigned int _get_table_val(const struct clk_div_table *table, in _get_table_val() argument
109 for (clkt = table; clkt->div; clkt++) in _get_table_val()
115 static unsigned int _get_val(const struct clk_div_table *table, in _get_val() argument
124 if (table) in _get_val()
125 return _get_table_val(table, div); in _get_val()
131 const struct clk_div_table *table, in divider_recalc_rate() argument
136 div = _get_div(table, val, flags, width); in divider_recalc_rate()
157 return divider_recalc_rate(hw, parent_rate, val, divider->table, in clk_divider_recalc_rate()
161 static bool _is_valid_table_div(const struct clk_div_table *table, in _is_valid_table_div() argument
166 for (clkt = table; clkt->div; clkt++) in _is_valid_table_div()
172 static bool _is_valid_div(const struct clk_div_table *table, unsigned int div, in _is_valid_div() argument
177 if (table) in _is_valid_div()
178 return _is_valid_table_div(table, div); in _is_valid_div()
182 static int _round_up_table(const struct clk_div_table *table, int div) in _round_up_table() argument
187 for (clkt = table; clkt->div; clkt++) { in _round_up_table()
200 static int _round_down_table(const struct clk_div_table *table, int div) in _round_down_table() argument
203 int down = _get_table_mindiv(table); in _round_down_table()
205 for (clkt = table; clkt->div; clkt++) { in _round_down_table()
218 static int _div_round_up(const struct clk_div_table *table, in _div_round_up() argument
226 if (table) in _div_round_up()
227 div = _round_up_table(table, div); in _div_round_up()
232 static int _div_round_closest(const struct clk_div_table *table, in _div_round_closest() argument
245 } else if (table) { in _div_round_closest()
246 up = _round_up_table(table, up); in _div_round_closest()
247 down = _round_down_table(table, down); in _div_round_closest()
256 static int _div_round(const struct clk_div_table *table, in _div_round() argument
261 return _div_round_closest(table, parent_rate, rate, flags); in _div_round()
263 return _div_round_up(table, parent_rate, rate, flags); in _div_round()
275 static int _next_div(const struct clk_div_table *table, int div, in _next_div() argument
282 if (table) in _next_div()
283 return _round_up_table(table, div); in _next_div()
291 const struct clk_div_table *table, u8 width, in clk_divider_bestdiv() argument
301 maxdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
305 bestdiv = _div_round(table, parent_rate, rate, flags); in clk_divider_bestdiv()
317 for (i = _next_div(table, 0, flags); i <= maxdiv; in clk_divider_bestdiv()
318 i = _next_div(table, i, flags)) { in clk_divider_bestdiv()
338 bestdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
347 const struct clk_div_table *table, in divider_round_rate_parent() argument
352 div = clk_divider_bestdiv(hw, parent, rate, prate, table, width, flags); in divider_round_rate_parent()
360 const struct clk_div_table *table, u8 width, in divider_ro_round_rate_parent() argument
365 div = _get_div(table, val, flags, width); in divider_ro_round_rate_parent()
392 return divider_ro_round_rate(hw, rate, prate, divider->table, in clk_divider_round_rate()
397 return divider_round_rate(hw, rate, prate, divider->table, in clk_divider_round_rate()
402 const struct clk_div_table *table, u8 width, in divider_get_val() argument
409 if (!_is_valid_div(table, div, flags)) in divider_get_val()
412 value = _get_val(table, div, flags, width); in divider_get_val()
426 value = divider_get_val(rate, parent_rate, divider->table, in clk_divider_set_rate()
469 u8 clk_divider_flags, const struct clk_div_table *table, in _register_divider() argument
505 div->table = table; in _register_divider()
568 * clk_register_divider_table - register a table based divider clock with
578 * @table: array of divider/value pairs ending with a div set to 0
584 u8 clk_divider_flags, const struct clk_div_table *table, in clk_register_divider_table() argument
590 width, clk_divider_flags, table, lock); in clk_register_divider_table()
598 * clk_hw_register_divider_table - register a table based divider clock with
608 * @table: array of divider/value pairs ending with a div set to 0
614 u8 clk_divider_flags, const struct clk_div_table *table, in clk_hw_register_divider_table() argument
618 width, clk_divider_flags, table, lock); in clk_hw_register_divider_table()