Lines Matching refs:table
35 static unsigned int _get_table_maxdiv(const struct clk_div_table *table) in _get_table_maxdiv() argument
40 for (clkt = table; clkt->div; clkt++) in _get_table_maxdiv()
46 static unsigned int _get_table_mindiv(const struct clk_div_table *table) in _get_table_mindiv() argument
51 for (clkt = table; clkt->div; clkt++) in _get_table_mindiv()
57 static unsigned int _get_maxdiv(const struct clk_div_table *table, u8 width, in _get_maxdiv() argument
64 if (table) in _get_maxdiv()
65 return _get_table_maxdiv(table); in _get_maxdiv()
69 static unsigned int _get_table_div(const struct clk_div_table *table, in _get_table_div() argument
74 for (clkt = table; clkt->div; clkt++) in _get_table_div()
80 static unsigned int _get_div(const struct clk_div_table *table, in _get_div() argument
89 if (table) in _get_div()
90 return _get_table_div(table, val); in _get_div()
94 static unsigned int _get_table_val(const struct clk_div_table *table, in _get_table_val() argument
99 for (clkt = table; clkt->div; clkt++) in _get_table_val()
105 static unsigned int _get_val(const struct clk_div_table *table, in _get_val() argument
114 if (table) in _get_val()
115 return _get_table_val(table, div); in _get_val()
121 const struct clk_div_table *table, in divider_recalc_rate() argument
127 div = _get_div(table, val, flags, divider->width); in divider_recalc_rate()
148 return divider_recalc_rate(hw, parent_rate, val, divider->table, in clk_divider_recalc_rate()
152 static bool _is_valid_table_div(const struct clk_div_table *table, in _is_valid_table_div() argument
157 for (clkt = table; clkt->div; clkt++) in _is_valid_table_div()
163 static bool _is_valid_div(const struct clk_div_table *table, unsigned int div, in _is_valid_div() argument
168 if (table) in _is_valid_div()
169 return _is_valid_table_div(table, div); in _is_valid_div()
173 static int _round_up_table(const struct clk_div_table *table, int div) in _round_up_table() argument
178 for (clkt = table; clkt->div; clkt++) { in _round_up_table()
191 static int _round_down_table(const struct clk_div_table *table, int div) in _round_down_table() argument
194 int down = _get_table_mindiv(table); in _round_down_table()
196 for (clkt = table; clkt->div; clkt++) { in _round_down_table()
209 static int _div_round_up(const struct clk_div_table *table, in _div_round_up() argument
217 if (table) in _div_round_up()
218 div = _round_up_table(table, div); in _div_round_up()
223 static int _div_round_closest(const struct clk_div_table *table, in _div_round_closest() argument
236 } else if (table) { in _div_round_closest()
237 up = _round_up_table(table, up); in _div_round_closest()
238 down = _round_down_table(table, down); in _div_round_closest()
247 static int _div_round(const struct clk_div_table *table, in _div_round() argument
252 return _div_round_closest(table, parent_rate, rate, flags); in _div_round()
254 return _div_round_up(table, parent_rate, rate, flags); in _div_round()
266 static int _next_div(const struct clk_div_table *table, int div, in _next_div() argument
273 if (table) in _next_div()
274 return _round_up_table(table, div); in _next_div()
281 const struct clk_div_table *table, u8 width, in clk_divider_bestdiv() argument
291 maxdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
295 bestdiv = _div_round(table, parent_rate, rate, flags); in clk_divider_bestdiv()
307 for (i = 1; i <= maxdiv; i = _next_div(table, i, flags)) { in clk_divider_bestdiv()
308 if (!_is_valid_div(table, i, flags)) in clk_divider_bestdiv()
330 bestdiv = _get_maxdiv(table, width, flags); in clk_divider_bestdiv()
338 unsigned long *prate, const struct clk_div_table *table, in divider_round_rate() argument
343 div = clk_divider_bestdiv(hw, rate, prate, table, width, flags); in divider_round_rate()
359 bestdiv = _get_div(divider->table, bestdiv, divider->flags, in clk_divider_round_rate()
364 return divider_round_rate(hw, rate, prate, divider->table, in clk_divider_round_rate()
369 const struct clk_div_table *table, u8 width, in divider_get_val() argument
376 if (!_is_valid_div(table, div, flags)) in divider_get_val()
379 value = _get_val(table, div, flags, width); in divider_get_val()
393 value = divider_get_val(rate, parent_rate, divider->table, in clk_divider_set_rate()
434 u8 clk_divider_flags, const struct clk_div_table *table, in _register_divider() argument
469 div->table = table; in _register_divider()
519 u8 clk_divider_flags, const struct clk_div_table *table, in clk_register_divider_table() argument
523 width, clk_divider_flags, table, lock); in clk_register_divider_table()