Lines Matching refs:opp_table
24 static struct opp_table *_managed_opp(const struct device_node *np) in _managed_opp()
26 struct opp_table *opp_table; in _managed_opp() local
28 list_for_each_entry_rcu(opp_table, &opp_tables, node) { in _managed_opp()
29 if (opp_table->np == np) { in _managed_opp()
37 if (opp_table->shared_opp == OPP_TABLE_ACCESS_SHARED) in _managed_opp()
38 return opp_table; in _managed_opp()
47 void _of_init_opp_table(struct opp_table *opp_table, struct device *dev) in _of_init_opp_table() argument
60 opp_table->clock_latency_ns_max = val; in _of_init_opp_table()
62 &opp_table->voltage_tolerance_v1); in _of_init_opp_table()
67 static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table, in _opp_is_supported() argument
70 unsigned int count = opp_table->supported_hw_count; in _opp_is_supported()
74 if (!opp_table->supported_hw) { in _opp_is_supported()
97 if (!(version & opp_table->supported_hw[count])) in _opp_is_supported()
106 struct opp_table *opp_table) in opp_parse_supplies() argument
115 if (opp_table->prop_name) { in opp_parse_supplies()
117 opp_table->prop_name); in opp_parse_supplies()
163 if (opp_table->prop_name) { in opp_parse_supplies()
165 opp_table->prop_name); in opp_parse_supplies()
238 struct opp_table *opp_table; in _opp_add_static_v2() local
247 new_opp = _allocate_opp(dev, &opp_table); in _opp_add_static_v2()
260 if (!_opp_is_supported(dev, opp_table, np)) { in _opp_add_static_v2()
280 ret = opp_parse_supplies(new_opp, dev, opp_table); in _opp_add_static_v2()
284 ret = _opp_add(dev, new_opp, opp_table); in _opp_add_static_v2()
290 if (opp_table->suspend_opp) { in _opp_add_static_v2()
292 __func__, opp_table->suspend_opp->rate, in _opp_add_static_v2()
296 opp_table->suspend_opp = new_opp; in _opp_add_static_v2()
300 if (new_opp->clock_latency_ns > opp_table->clock_latency_ns_max) in _opp_add_static_v2()
301 opp_table->clock_latency_ns_max = new_opp->clock_latency_ns; in _opp_add_static_v2()
314 srcu_notifier_call_chain(&opp_table->srcu_head, OPP_EVENT_ADD, new_opp); in _opp_add_static_v2()
318 _opp_remove(opp_table, new_opp, false); in _opp_add_static_v2()
328 struct opp_table *opp_table; in _of_add_opp_table_v2() local
333 opp_table = _managed_opp(opp_np); in _of_add_opp_table_v2()
334 if (opp_table) { in _of_add_opp_table_v2()
336 if (!_add_opp_dev(dev, opp_table)) in _of_add_opp_table_v2()
362 opp_table = _find_opp_table(dev); in _of_add_opp_table_v2()
363 if (WARN_ON(IS_ERR(opp_table))) { in _of_add_opp_table_v2()
364 ret = PTR_ERR(opp_table); in _of_add_opp_table_v2()
369 opp_table->np = opp_np; in _of_add_opp_table_v2()
371 opp_table->shared_opp = OPP_TABLE_ACCESS_SHARED; in _of_add_opp_table_v2()
373 opp_table->shared_opp = OPP_TABLE_ACCESS_EXCLUSIVE; in _of_add_opp_table_v2()