Lines Matching refs:table
31 static unsigned int _get_table_maxdiv(const struct clk_div_table *table) in _get_table_maxdiv() argument
36 for (clkt = table; clkt->div; clkt++) in _get_table_maxdiv()
48 if (divider->table) in _get_maxdiv()
49 return _get_table_maxdiv(divider->table); in _get_maxdiv()
53 static unsigned int _get_table_div(const struct clk_div_table *table, in _get_table_div() argument
58 for (clkt = table; clkt->div; clkt++) in _get_table_div()
70 if (divider->table) in _get_div()
71 return _get_table_div(divider->table, val); in _get_div()
75 static unsigned int _get_table_val(const struct clk_div_table *table, in _get_table_val() argument
80 for (clkt = table; clkt->div; clkt++) in _get_table_val()
92 if (divider->table) in _get_val()
93 return _get_table_val(divider->table, div); in _get_val()
123 static bool _is_valid_table_div(const struct clk_div_table *table, in _is_valid_table_div() argument
128 for (clkt = table; clkt->div; clkt++) in _is_valid_table_div()
138 if (divider->table) in _is_valid_div()
139 return _is_valid_table_div(divider->table, div); in _is_valid_div()
143 static int _div_round_up(const struct clk_div_table *table, in _div_round_up() argument
150 for (clkt = table; clkt->div; clkt++) { in _div_round_up()
163 static int _div_round(const struct clk_div_table *table, in _div_round() argument
166 if (!table) in _div_round()
169 return _div_round_up(table, parent_rate, rate); in _div_round()
187 bestdiv = _div_round(divider->table, parent_rate, rate); in ti_clk_divider_bestdiv()
283 const struct clk_div_table *table) in _register_divider() argument
314 div->table = table; in _register_divider()
327 const struct clk_div_table **table) in ti_clk_parse_divider_data() argument
352 *table = NULL; in ti_clk_parse_divider_data()
385 *table = tmp; in ti_clk_parse_divider_data()
393 const struct clk_div_table *table = NULL; in _get_div_table_from_setup() local
397 &table); in _get_div_table_from_setup()
399 return table; in _get_div_table_from_setup()
424 div->table = _get_div_table_from_setup(setup, &div->width); in ti_clk_build_component_div()
442 const struct clk_div_table *table; in ti_clk_register_divider() local
454 table = _get_div_table_from_setup(div, &width); in ti_clk_register_divider()
455 if (IS_ERR(table)) in ti_clk_register_divider()
456 return (struct clk *)table; in ti_clk_register_divider()
460 width, -EINVAL, div_flags, table); in ti_clk_register_divider()
463 kfree(table); in ti_clk_register_divider()
471 struct clk_div_table *table; in ti_clk_get_div_table() local
499 table = kcalloc(valid_div + 1, sizeof(*table), GFP_KERNEL); in ti_clk_get_div_table()
501 if (!table) in ti_clk_get_div_table()
509 table[valid_div].div = val; in ti_clk_get_div_table()
510 table[valid_div].val = i; in ti_clk_get_div_table()
515 return table; in ti_clk_get_div_table()
519 const struct clk_div_table *table, in _get_divider_width() argument
527 if (!table) { in _get_divider_width()
553 while (table[div].div) { in _get_divider_width()
554 val = table[div].val; in _get_divider_width()
563 struct clk_omap_reg *reg, const struct clk_div_table **table, in ti_clk_divider_populate() argument
597 *table = ti_clk_get_div_table(node); in ti_clk_divider_populate()
599 if (IS_ERR(*table)) in ti_clk_divider_populate()
600 return PTR_ERR(*table); in ti_clk_divider_populate()
602 *width = _get_divider_width(node, *table, *div_flags); in ti_clk_divider_populate()
622 const struct clk_div_table *table = NULL; in of_ti_divider_clk_setup() local
627 if (ti_clk_divider_populate(node, ®, &table, &flags, in of_ti_divider_clk_setup()
632 shift, width, latch, clk_divider_flags, table); in of_ti_divider_clk_setup()
641 kfree(table); in of_ti_divider_clk_setup()
654 if (ti_clk_divider_populate(node, &div->reg, &div->table, &val, in of_ti_composite_divider_clk_setup()
663 kfree(div->table); in of_ti_composite_divider_clk_setup()