Lines Matching refs:np

34 static struct device_node *_opp_of_get_opp_desc_node(struct device_node *np, int index)
37 return of_parse_phandle(np, "operating-points-v2", index);
50 struct device_node *np;
52 np = _opp_of_get_opp_desc_node(dev->of_node, index);
53 if (!np) {
59 if (opp_table->np == np) {
62 * so will have same node-pointer, np.
76 of_node_put(np);
90 if (opp->np == opp_np) {
102 static struct device_node *of_parse_required_opp(struct device_node *np, int index)
104 return of_parse_phandle(np, "required-opps", index);
125 if (opp_table_np == opp_table->np) {
167 struct device_node *required_np, *np;
171 np = of_get_next_available_child(opp_np, NULL);
172 if (!np) {
177 count = of_count_phandle_with_args(np, "required-opps", NULL);
191 required_np = of_parse_required_opp(np, i);
219 of_node_put(np);
224 struct device_node *np, *opp_np;
231 np = of_node_get(dev->of_node);
232 if (!np) {
236 if (!of_property_read_u32(np, "clock-latency", &val)) {
239 of_property_read_u32(np, "voltage-tolerance", &opp_table->voltage_tolerance_v1);
241 if (of_find_property(np, "#power-domain-cells", NULL)) {
246 opp_np = _opp_of_get_opp_desc_node(np, index);
247 of_node_put(np);
259 opp_table->np = opp_np;
301 struct device_node *np;
318 np = of_parse_required_opp(opp->np, i);
319 if (unlikely(!np)) {
324 required_opps[i] = _find_opp_of_np(required_table, np);
325 of_node_put(np);
328 pr_err("%s: Unable to find required OPP node: %pOF (%d)\n", __func__, opp->np, i);
344 struct device_node *np, *opp_np;
348 np = of_node_get(dev->of_node);
349 if (!np) {
352 opp_np = _opp_of_get_opp_desc_node(np, 0);
353 of_node_put(np);
355 opp_np = of_node_get(opp_table->np);
362 np = of_get_next_available_child(opp_np, NULL);
364 if (!np) {
368 prop = of_find_property(np, "opp-peak-kBps", NULL);
369 of_node_put(np);
378 struct device_node *np;
389 np = of_node_get(dev->of_node);
390 if (!np) {
394 count = of_count_phandle_with_args(np, "interconnects", "#interconnect-cells");
395 of_node_put(np);
440 static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table, struct device_node *np)
453 if (of_find_property(np, "opp-supported-hw", NULL)) {
460 count = of_property_count_u32_elems(np, "opp-supported-hw");
473 ret = of_property_read_u32_index(np, "opp-supported-hw", i * levels + j, &val);
505 prop = of_find_property(opp->np, name, NULL);
511 prop = of_find_property(opp->np, name, NULL);
537 vcount = of_property_count_u32_elems(opp->np, name);
555 ret = of_property_read_u32_array(opp->np, name, microvolt, vcount);
566 prop = of_find_property(opp->np, name, NULL);
572 prop = of_find_property(opp->np, name, NULL);
576 icount = of_property_count_u32_elems(opp->np, name);
596 ret = of_property_read_u32_array(opp->np, name, microamp, icount);
641 static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table, struct device_node *np, bool peak)
648 prop = of_find_property(np, name, NULL);
664 ret = of_property_read_u32_array(np, name, bw, count);
683 static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *table, struct device_node *np,
690 ret = of_property_read_u64(np, "opp-hz", &rate);
707 ret = _read_bw(new_opp, table, np, true);
710 ret = _read_bw(new_opp, table, np, false);
718 if (!of_property_read_u32(np, "opp-level", &new_opp->level)) {
733 * @np: device node
753 static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, struct device *dev, struct device_node *np)
765 ret = _read_opp_key(new_opp, opp_table, np, &rate_not_available);
772 if (!_opp_is_supported(dev, opp_table, np)) {
777 new_opp->turbo = of_property_read_bool(np, "turbo-mode");
779 new_opp->np = np;
788 if (!of_property_read_u32(np, "clock-latency-ns", &val)) {
811 if (of_property_read_bool(np, "opp-suspend")) {
851 struct device_node *np;
867 for_each_available_child_of_node(opp_table->np, np)
869 opp = _opp_add_static_v2(opp_table, dev, np);
873 of_node_put(np);
994 if (opp_table->np) {
1137 struct device_node *np, *tmp_np, *cpu_np;
1141 np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
1142 if (!np) {
1150 if (!of_property_read_bool(np, "opp-shared")) {
1177 if (np == tmp_np) {
1185 of_node_put(np);
1192 * @np: Node that contains the "required-opps" property.
1196 * property at @index in @np.
1201 int of_get_required_opp_performance_state(struct device_node *np, int index)
1208 required_np = of_parse_required_opp(np, index);
1215 pr_err("%s: Failed to find required OPP table %pOF: %ld\n", __func__, np, PTR_ERR(opp_table));
1249 return of_node_get(opp->np);
1268 struct device_node *np;
1274 np = of_node_get(dev->of_node);
1275 if (!np) {
1279 ret = of_property_read_u32(np, "dynamic-power-coefficient", &cap);
1280 of_node_put(np);
1320 struct device_node *np;
1335 np = of_node_get(dev->of_node);
1336 if (!np) {
1348 ret = of_property_read_u32(np, "dynamic-power-coefficient", &cap);
1349 of_node_put(np);