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