Lines Matching refs:node
34 * @node: pointer to device_node containing graph port
36 * Return: True if @node has a port or ports (with a port) sub-node,
39 bool of_graph_is_present(const struct device_node *node)
43 ports = of_get_child_by_name(node, "ports");
45 node = ports;
47 port = of_get_child_by_name(node, "port");
58 * @np: device node from which the property value is to be read.
62 * Search for a property in a device node and count the number of elements of
80 pr_err("size of %s in node %pOF is not a multiple of %d\n",
92 * @np: device node from which the property value is to be read.
98 * Search for a property in a device node and valid the requested size.
128 * @np: device node from which the property value is to be read.
133 * Search for a property in a device node and read nth 32-bit value from
162 * @np: device node from which the property value is to be read.
167 * Search for a property in a device node and read nth 64-bit value from
196 * @np: device node from which the property value is to be read.
204 * Search for a property in a device node and read 8-bit value(s) from
246 * @np: device node from which the property value is to be read.
254 * Search for a property in a device node and read 16-bit value(s) from
296 * @np: device node from which the property value is to be read.
304 * Search for a property in a device node and read 32-bit value(s) from
341 * @np: device node from which the property value is to be read.
345 * Search for a property in a device node and read a 64-bit value from
374 * @np: device node from which the property value is to be read.
382 * Search for a property in a device node and read 64-bit value(s) from
421 * @np: device node from which the property value is to be read.
426 * Search for a property in a device tree node and retrieve a null
452 * @np: pointer to node containing string list property
489 * @np: device node from which the property value is to be read.
567 * of_graph_parse_endpoint() - parse common endpoint node properties
568 * @node: pointer to endpoint device_node
571 * The caller should hold a reference to @node.
573 int of_graph_parse_endpoint(const struct device_node *node,
576 struct device_node *port_node = of_get_parent(node);
578 WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n",
579 __func__, node);
583 endpoint->local_node = node;
589 of_property_read_u32(node, "reg", &endpoint->id);
599 * @parent: pointer to the parent device node
602 * Return: A 'port' node pointer with refcount incremented. The caller
607 struct device_node *node, *port;
609 node = of_get_child_by_name(parent, "ports");
610 if (node)
611 parent = node;
623 of_node_put(node);
630 * of_graph_get_next_endpoint() - get next endpoint node
631 * @parent: pointer to the parent device node
632 * @prev: previous endpoint node, or NULL to get first
634 * Return: An 'endpoint' node pointer with refcount incremented. Refcount
635 * of the passed @prev node is decremented.
647 * Start by locating the port node. If no previous endpoint is specified
648 * search for the first port node, otherwise get the previous endpoint
649 * parent port node.
652 struct device_node *node;
654 node = of_get_child_by_name(parent, "ports");
655 if (node)
656 parent = node;
659 of_node_put(node);
662 pr_err("graph: no port node found in %pOF\n", parent);
667 if (WARN_ONCE(!port, "%s(): endpoint %pOF has no parent node\n",
674 * Now that we have a port node, get the next endpoint by
697 * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
698 * @parent: pointer to the parent device node
699 * @port_reg: identifier (value of reg property) of the parent port node
700 * @reg: identifier (value of reg property) of the endpoint node
702 * Return: An 'endpoint' node pointer which is identified by reg and at the same
703 * is the child of a port node identified by port_reg. reg and port_reg are
710 struct device_node *node = NULL;
712 for_each_endpoint_of_node(parent, node) {
713 of_graph_parse_endpoint(node, &endpoint);
716 return node;
724 * of_graph_get_remote_endpoint() - get remote endpoint node
725 * @node: pointer to a local endpoint device_node
727 * Return: Remote endpoint node associated with remote endpoint node linked
728 * to @node. Use of_node_put() on it when done.
730 struct device_node *of_graph_get_remote_endpoint(const struct device_node *node)
732 /* Get remote endpoint node. */
733 return of_parse_phandle(node, "remote-endpoint", 0);
738 * of_graph_get_port_parent() - get port's parent node
739 * @node: pointer to a local endpoint device_node
741 * Return: device node associated with endpoint node linked
742 * to @node. Use of_node_put() on it when done.
744 struct device_node *of_graph_get_port_parent(struct device_node *node)
748 if (!node)
752 * Preserve usecount for passed in node as of_get_next_parent()
755 of_node_get(node);
757 /* Walk 3 levels up only if there is 'ports' node. */
758 for (depth = 3; depth && node; depth--) {
759 node = of_get_next_parent(node);
760 if (depth == 2 && !of_node_name_eq(node, "ports"))
763 return node;
768 * of_graph_get_remote_port_parent() - get remote port's parent node
769 * @node: pointer to a local endpoint device_node
771 * Return: Remote device node associated with remote endpoint node linked
772 * to @node. Use of_node_put() on it when done.
775 const struct device_node *node)
779 /* Get remote endpoint node. */
780 np = of_graph_get_remote_endpoint(node);
791 * of_graph_get_remote_port() - get remote port node
792 * @node: pointer to a local endpoint device_node
794 * Return: Remote port node associated with remote endpoint node linked
795 * to @node. Use of_node_put() on it when done.
797 struct device_node *of_graph_get_remote_port(const struct device_node *node)
801 /* Get remote endpoint node. */
802 np = of_graph_get_remote_endpoint(node);
823 * @node: pointer to parent device_node containing graph port/endpoint
824 * @port: identifier (value of reg property) of the parent port node
825 * @endpoint: identifier (value of reg property) of the endpoint node
827 * Return: Remote device node associated with remote endpoint node linked
828 * to @node. Use of_node_put() on it when done.
830 struct device_node *of_graph_get_remote_node(const struct device_node *node,
835 endpoint_node = of_graph_get_endpoint_by_regs(node, port, endpoint);
837 pr_debug("no valid endpoint (%d, %d) for node %pOF\n",
838 port, endpoint, node);
845 pr_debug("no valid remote node\n");
850 pr_debug("not available for remote node\n");
885 const struct device_node *node = to_of_node(fwnode);
888 return of_property_count_elems_of_size(node, propname,
893 return of_property_read_u8_array(node, propname, val, nval);
895 return of_property_read_u16_array(node, propname, val, nval);
897 return of_property_read_u32_array(node, propname, val, nval);
899 return of_property_read_u64_array(node, propname, val, nval);
910 const struct device_node *node = to_of_node(fwnode);
913 of_property_read_string_array(node, propname, val, nval) :
914 of_property_count_strings(node, propname);
949 const struct device_node *node = to_of_node(fwnode);
952 for_each_available_child_of_node(node, child)
1016 /* Is this the "ports" node? If not, it's the port parent. */
1026 const struct device_node *node = to_of_node(fwnode);
1027 struct device_node *port_node = of_get_parent(node);
1032 of_property_read_u32(node, "reg", &endpoint->id);
1062 * @np: device tree node
1064 * Given a device tree node (@np), this function finds its closest ancestor
1065 * device tree node that has a corresponding struct device.
1087 * @sup_np: phandle to supplier device tree node
1089 * Given a phandle to a supplier device tree node (@sup_np), this function
1090 * finds the device that owns the supplier device tree node and creates a
1111 * Find the device node that contains the supplier phandle. It may be
1134 * Don't allow linking a device node as a consumer of one of its
1135 * descendant nodes. By definition, a child node can't be a functional
1136 * dependency for the parent node.
1190 * @np: Pointer to device tree node containing a list
1202 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1244 * @np: Pointer to device tree node containing a list
1256 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1288 * parse_prop() finds the node corresponding to a supplier phandle
1289 * @parse_prop.np: Pointer to device node holding supplier phandle property
1296 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1385 * @con_np: The consumer device tree node which contains the property
1389 * @con_np device tree node is one of the known common device tree bindings