Lines Matching +full:a +full:- +full:child +full:- +full:node +full:- +full:property
1 // SPDX-License-Identifier: GPL-2.0+
3 * drivers/of/property.c - Procedures for accessing and interpreting
7 * file contains the OF property as well as the OF graph interface
11 * Copyright (C) 1996-2005 Paul Mackerras.
33 * of_graph_is_present() - check graph's presence
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) in of_graph_is_present() argument
43 ports = of_get_child_by_name(node, "ports"); in of_graph_is_present()
45 node = ports; in of_graph_is_present()
47 port = of_get_child_by_name(node, "port"); in of_graph_is_present()
56 * of_property_count_elems_of_size - Count the number of elements in a property
58 * @np: device node from which the property value is to be read.
59 * @propname: name of the property to be searched.
62 * Search for a property in a device node and count the number of elements of
63 * size elem_size in it. Returns number of elements on sucess, -EINVAL if the
64 * property does not exist or its length does not match a multiple of elem_size
65 * and -ENODATA if the property does not have a value.
70 struct property *prop = of_find_property(np, propname, NULL); in of_property_count_elems_of_size()
73 return -EINVAL; in of_property_count_elems_of_size()
74 if (!prop->value) in of_property_count_elems_of_size()
75 return -ENODATA; in of_property_count_elems_of_size()
77 if (prop->length % elem_size != 0) { in of_property_count_elems_of_size()
78 pr_err("size of %s in node %pOF is not a multiple of %d\n", in of_property_count_elems_of_size()
80 return -EINVAL; in of_property_count_elems_of_size()
83 return prop->length / elem_size; in of_property_count_elems_of_size()
90 * @np: device node from which the property value is to be read.
91 * @propname: name of the property to be searched.
92 * @min: minimum allowed length of property value
93 * @max: maximum allowed length of property value (0 means unlimited)
96 * Search for a property in a device node and valid the requested size.
97 * Returns the property value on success, -EINVAL if the property does not
98 * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
99 * property data is too small or too large.
105 struct property *prop = of_find_property(np, propname, NULL); in of_find_property_value_of_size()
108 return ERR_PTR(-EINVAL); in of_find_property_value_of_size()
109 if (!prop->value) in of_find_property_value_of_size()
110 return ERR_PTR(-ENODATA); in of_find_property_value_of_size()
111 if (prop->length < min) in of_find_property_value_of_size()
112 return ERR_PTR(-EOVERFLOW); in of_find_property_value_of_size()
113 if (max && prop->length > max) in of_find_property_value_of_size()
114 return ERR_PTR(-EOVERFLOW); in of_find_property_value_of_size()
117 *len = prop->length; in of_find_property_value_of_size()
119 return prop->value; in of_find_property_value_of_size()
123 * of_property_read_u32_index - Find and read a u32 from a multi-value property.
125 * @np: device node from which the property value is to be read.
126 * @propname: name of the property to be searched.
130 * Search for a property in a device node and read nth 32-bit value from
131 * it. Returns 0 on success, -EINVAL if the property does not exist,
132 * -ENODATA if property does not have a value, and -EOVERFLOW if the
133 * property data isn't large enough.
135 * The out_value is modified only if a valid u32 value can be decoded.
155 * of_property_read_u64_index - Find and read a u64 from a multi-value property.
157 * @np: device node from which the property value is to be read.
158 * @propname: name of the property to be searched.
162 * Search for a property in a device node and read nth 64-bit value from
163 * it. Returns 0 on success, -EINVAL if the property does not exist,
164 * -ENODATA if property does not have a value, and -EOVERFLOW if the
165 * property data isn't large enough.
167 * The out_value is modified only if a valid u64 value can be decoded.
186 * of_property_read_variable_u8_array - Find and read an array of u8 from a
187 * property, with bounds on the minimum and maximum array size.
189 * @np: device node from which the property value is to be read.
190 * @propname: name of the property to be searched.
197 * Search for a property in a device node and read 8-bit value(s) from
198 * it. Returns number of elements read on success, -EINVAL if the property
199 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
200 * if the property data is smaller than sz_min or longer than sz_max.
203 * property = /bits/ 8 <0x50 0x60 0x70>;
205 * The out_values is modified only if a valid u8 value can be decoded.
226 while (count--) in of_property_read_variable_u8_array()
234 * of_property_read_variable_u16_array - Find and read an array of u16 from a
235 * property, with bounds on the minimum and maximum array size.
237 * @np: device node from which the property value is to be read.
238 * @propname: name of the property to be searched.
245 * Search for a property in a device node and read 16-bit value(s) from
246 * it. Returns number of elements read on success, -EINVAL if the property
247 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
248 * if the property data is smaller than sz_min or longer than sz_max.
251 * property = /bits/ 16 <0x5000 0x6000 0x7000>;
253 * The out_values is modified only if a valid u16 value can be decoded.
274 while (count--) in of_property_read_variable_u16_array()
282 * of_property_read_variable_u32_array - Find and read an array of 32 bit
283 * integers from a property, with bounds on the minimum and maximum array size.
285 * @np: device node from which the property value is to be read.
286 * @propname: name of the property to be searched.
293 * Search for a property in a device node and read 32-bit value(s) from
294 * it. Returns number of elements read on success, -EINVAL if the property
295 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
296 * if the property data is smaller than sz_min or longer than sz_max.
298 * The out_values is modified only if a valid u32 value can be decoded.
319 while (count--) in of_property_read_variable_u32_array()
327 * of_property_read_u64 - Find and read a 64 bit integer from a property
328 * @np: device node from which the property value is to be read.
329 * @propname: name of the property to be searched.
332 * Search for a property in a device node and read a 64-bit value from
333 * it. Returns 0 on success, -EINVAL if the property does not exist,
334 * -ENODATA if property does not have a value, and -EOVERFLOW if the
335 * property data isn't large enough.
337 * The out_value is modified only if a valid u64 value can be decoded.
356 * of_property_read_variable_u64_array - Find and read an array of 64 bit
357 * integers from a property, with bounds on the minimum and maximum array size.
359 * @np: device node from which the property value is to be read.
360 * @propname: name of the property to be searched.
367 * Search for a property in a device node and read 64-bit value(s) from
368 * it. Returns number of elements read on success, -EINVAL if the property
369 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
370 * if the property data is smaller than sz_min or longer than sz_max.
372 * The out_values is modified only if a valid u64 value can be decoded.
393 while (count--) { in of_property_read_variable_u64_array()
403 * of_property_read_string - Find and read a string from a property
404 * @np: device node from which the property value is to be read.
405 * @propname: name of the property to be searched.
409 * Search for a property in a device tree node and retrieve a null
410 * terminated string value (pointer to data, not a copy). Returns 0 on
411 * success, -EINVAL if the property does not exist, -ENODATA if property
412 * does not have a value, and -EILSEQ if the string is not null-terminated
413 * within the length of the property data.
415 * The out_string pointer is modified only if a valid string can be decoded.
420 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string()
422 return -EINVAL; in of_property_read_string()
423 if (!prop->value) in of_property_read_string()
424 return -ENODATA; in of_property_read_string()
425 if (strnlen(prop->value, prop->length) >= prop->length) in of_property_read_string()
426 return -EILSEQ; in of_property_read_string()
427 *out_string = prop->value; in of_property_read_string()
433 * of_property_match_string() - Find string in a list and return index
434 * @np: pointer to node containing string list property
435 * @propname: string list property name
438 * This function searches a string list property and returns the index
439 * of a specific string value.
444 const struct property *prop = of_find_property(np, propname, NULL); in of_property_match_string()
450 return -EINVAL; in of_property_match_string()
451 if (!prop->value) in of_property_match_string()
452 return -ENODATA; in of_property_match_string()
454 p = prop->value; in of_property_match_string()
455 end = p + prop->length; in of_property_match_string()
458 l = strnlen(p, end - p) + 1; in of_property_match_string()
460 return -EILSEQ; in of_property_match_string()
465 return -ENODATA; in of_property_match_string()
470 * of_property_read_string_helper() - Utility helper for parsing string properties
471 * @np: device node from which the property value is to be read.
472 * @propname: name of the property to be searched.
477 * Don't call this function directly. It is a utility helper for the
484 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string_helper()
489 return -EINVAL; in of_property_read_string_helper()
490 if (!prop->value) in of_property_read_string_helper()
491 return -ENODATA; in of_property_read_string_helper()
492 p = prop->value; in of_property_read_string_helper()
493 end = p + prop->length; in of_property_read_string_helper()
496 l = strnlen(p, end - p) + 1; in of_property_read_string_helper()
498 return -EILSEQ; in of_property_read_string_helper()
502 i -= skip; in of_property_read_string_helper()
503 return i <= 0 ? -ENODATA : i; in of_property_read_string_helper()
507 const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, in of_prop_next_u32()
516 curv = prop->value; in of_prop_next_u32()
521 if (curv >= prop->value + prop->length) in of_prop_next_u32()
530 const char *of_prop_next_string(struct property *prop, const char *cur) in of_prop_next_string()
538 return prop->value; in of_prop_next_string()
541 if (curv >= prop->value + prop->length) in of_prop_next_string()
549 * of_graph_parse_endpoint() - parse common endpoint node properties
550 * @node: pointer to endpoint device_node
553 * The caller should hold a reference to @node.
555 int of_graph_parse_endpoint(const struct device_node *node, in of_graph_parse_endpoint() argument
558 struct device_node *port_node = of_get_parent(node); in of_graph_parse_endpoint()
560 WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n", in of_graph_parse_endpoint()
561 __func__, node); in of_graph_parse_endpoint()
565 endpoint->local_node = node; in of_graph_parse_endpoint()
570 of_property_read_u32(port_node, "reg", &endpoint->port); in of_graph_parse_endpoint()
571 of_property_read_u32(node, "reg", &endpoint->id); in of_graph_parse_endpoint()
580 * of_graph_get_port_by_id() - get the port matching a given id
581 * @parent: pointer to the parent device node
584 * Return: A 'port' node pointer with refcount incremented. The caller
589 struct device_node *node, *port; in of_graph_get_port_by_id() local
591 node = of_get_child_by_name(parent, "ports"); in of_graph_get_port_by_id()
592 if (node) in of_graph_get_port_by_id()
593 parent = node; in of_graph_get_port_by_id()
605 of_node_put(node); in of_graph_get_port_by_id()
612 * of_graph_get_next_endpoint() - get next endpoint node
613 * @parent: pointer to the parent device node
614 * @prev: previous endpoint node, or NULL to get first
616 * Return: An 'endpoint' node pointer with refcount incremented. Refcount
617 * of the passed @prev node is decremented.
629 * Start by locating the port node. If no previous endpoint is specified in of_graph_get_next_endpoint()
630 * search for the first port node, otherwise get the previous endpoint in of_graph_get_next_endpoint()
631 * parent port node. in of_graph_get_next_endpoint()
634 struct device_node *node; in of_graph_get_next_endpoint() local
636 node = of_get_child_by_name(parent, "ports"); in of_graph_get_next_endpoint()
637 if (node) in of_graph_get_next_endpoint()
638 parent = node; in of_graph_get_next_endpoint()
641 of_node_put(node); in of_graph_get_next_endpoint()
644 pr_err("graph: no port node found in %pOF\n", parent); in of_graph_get_next_endpoint()
649 if (WARN_ONCE(!port, "%s(): endpoint %pOF has no parent node\n", in of_graph_get_next_endpoint()
656 * Now that we have a port node, get the next endpoint by in of_graph_get_next_endpoint()
657 * getting the next child. If the previous endpoint is NULL this in of_graph_get_next_endpoint()
658 * will return the first child. in of_graph_get_next_endpoint()
679 * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
680 * @parent: pointer to the parent device node
681 * @port_reg: identifier (value of reg property) of the parent port node
682 * @reg: identifier (value of reg property) of the endpoint node
684 * Return: An 'endpoint' node pointer which is identified by reg and at the same
685 * is the child of a port node identified by port_reg. reg and port_reg are
686 * ignored when they are -1. Use of_node_put() on the pointer when done.
692 struct device_node *node = NULL; in of_graph_get_endpoint_by_regs() local
694 for_each_endpoint_of_node(parent, node) { in of_graph_get_endpoint_by_regs()
695 of_graph_parse_endpoint(node, &endpoint); in of_graph_get_endpoint_by_regs()
696 if (((port_reg == -1) || (endpoint.port == port_reg)) && in of_graph_get_endpoint_by_regs()
697 ((reg == -1) || (endpoint.id == reg))) in of_graph_get_endpoint_by_regs()
698 return node; in of_graph_get_endpoint_by_regs()
706 * of_graph_get_remote_endpoint() - get remote endpoint node
707 * @node: pointer to a local endpoint device_node
709 * Return: Remote endpoint node associated with remote endpoint node linked
710 * to @node. Use of_node_put() on it when done.
712 struct device_node *of_graph_get_remote_endpoint(const struct device_node *node) in of_graph_get_remote_endpoint() argument
714 /* Get remote endpoint node. */ in of_graph_get_remote_endpoint()
715 return of_parse_phandle(node, "remote-endpoint", 0); in of_graph_get_remote_endpoint()
720 * of_graph_get_port_parent() - get port's parent node
721 * @node: pointer to a local endpoint device_node
723 * Return: device node associated with endpoint node linked
724 * to @node. Use of_node_put() on it when done.
726 struct device_node *of_graph_get_port_parent(struct device_node *node) in of_graph_get_port_parent() argument
730 if (!node) in of_graph_get_port_parent()
734 * Preserve usecount for passed in node as of_get_next_parent() in of_graph_get_port_parent()
737 of_node_get(node); in of_graph_get_port_parent()
739 /* Walk 3 levels up only if there is 'ports' node. */ in of_graph_get_port_parent()
740 for (depth = 3; depth && node; depth--) { in of_graph_get_port_parent()
741 node = of_get_next_parent(node); in of_graph_get_port_parent()
742 if (depth == 2 && !of_node_name_eq(node, "ports")) in of_graph_get_port_parent()
745 return node; in of_graph_get_port_parent()
750 * of_graph_get_remote_port_parent() - get remote port's parent node
751 * @node: pointer to a local endpoint device_node
753 * Return: Remote device node associated with remote endpoint node linked
754 * to @node. Use of_node_put() on it when done.
757 const struct device_node *node) in of_graph_get_remote_port_parent() argument
761 /* Get remote endpoint node. */ in of_graph_get_remote_port_parent()
762 np = of_graph_get_remote_endpoint(node); in of_graph_get_remote_port_parent()
773 * of_graph_get_remote_port() - get remote port node
774 * @node: pointer to a local endpoint device_node
776 * Return: Remote port node associated with remote endpoint node linked
777 * to @node. Use of_node_put() on it when done.
779 struct device_node *of_graph_get_remote_port(const struct device_node *node) in of_graph_get_remote_port() argument
783 /* Get remote endpoint node. */ in of_graph_get_remote_port()
784 np = of_graph_get_remote_endpoint(node); in of_graph_get_remote_port()
804 * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
805 * @node: pointer to parent device_node containing graph port/endpoint
806 * @port: identifier (value of reg property) of the parent port node
807 * @endpoint: identifier (value of reg property) of the endpoint node
809 * Return: Remote device node associated with remote endpoint node linked
810 * to @node. Use of_node_put() on it when done.
812 struct device_node *of_graph_get_remote_node(const struct device_node *node, in of_graph_get_remote_node() argument
817 endpoint_node = of_graph_get_endpoint_by_regs(node, port, endpoint); in of_graph_get_remote_node()
819 pr_debug("no valid endpoint (%d, %d) for node %pOF\n", in of_graph_get_remote_node()
820 port, endpoint, node); in of_graph_get_remote_node()
827 pr_debug("no valid remote node\n"); in of_graph_get_remote_node()
832 pr_debug("not available for remote node\n"); in of_graph_get_remote_node()
867 const struct device_node *node = to_of_node(fwnode); in of_fwnode_property_read_int_array() local
870 return of_property_count_elems_of_size(node, propname, in of_fwnode_property_read_int_array()
875 return of_property_read_u8_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
877 return of_property_read_u16_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
879 return of_property_read_u32_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
881 return of_property_read_u64_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
884 return -ENXIO; in of_fwnode_property_read_int_array()
892 const struct device_node *node = to_of_node(fwnode); in of_fwnode_property_read_string_array() local
895 of_property_read_string_array(node, propname, val, nval) : in of_fwnode_property_read_string_array()
896 of_property_count_strings(node, propname); in of_fwnode_property_read_string_array()
901 return kbasename(to_of_node(fwnode)->full_name); in of_fwnode_get_name()
907 if (!to_of_node(fwnode)->parent) in of_fwnode_get_name_prefix()
921 struct fwnode_handle *child) in of_fwnode_get_next_child_node() argument
924 to_of_node(child))); in of_fwnode_get_next_child_node()
931 const struct device_node *node = to_of_node(fwnode); in of_fwnode_get_named_child_node() local
932 struct device_node *child; in of_fwnode_get_named_child_node() local
934 for_each_available_child_of_node(node, child) in of_fwnode_get_named_child_node()
935 if (of_node_name_eq(child, childname)) in of_fwnode_get_named_child_node()
936 return of_fwnode_handle(child); in of_fwnode_get_named_child_node()
962 args->nargs = of_args.args_count; in of_fwnode_get_reference_args()
963 args->fwnode = of_fwnode_handle(of_args.np); in of_fwnode_get_reference_args()
966 args->args[i] = i < of_args.args_count ? of_args.args[i] : 0; in of_fwnode_get_reference_args()
996 /* Is this the "ports" node? If not, it's the port parent. */ in of_fwnode_graph_get_port_parent()
1006 const struct device_node *node = to_of_node(fwnode); in of_fwnode_graph_parse_endpoint() local
1007 struct device_node *port_node = of_get_parent(node); in of_fwnode_graph_parse_endpoint()
1009 endpoint->local_fwnode = fwnode; in of_fwnode_graph_parse_endpoint()
1011 of_property_read_u32(port_node, "reg", &endpoint->port); in of_fwnode_graph_parse_endpoint()
1012 of_property_read_u32(node, "reg", &endpoint->id); in of_fwnode_graph_parse_endpoint()
1027 struct device_node *child) in of_is_ancestor_of() argument
1029 of_node_get(child); in of_is_ancestor_of()
1030 while (child) { in of_is_ancestor_of()
1031 if (child == test_ancestor) { in of_is_ancestor_of()
1032 of_node_put(child); in of_is_ancestor_of()
1035 child = of_get_next_parent(child); in of_is_ancestor_of()
1041 * of_get_next_parent_dev - Add device link to supplier from supplier phandle
1042 * @np: device tree node
1044 * Given a device tree node (@np), this function finds its closest ancestor
1045 * device tree node that has a corresponding struct device.
1058 dev = get_dev_from_fwnode(&np->fwnode); in of_get_next_parent_dev()
1065 * of_link_to_phandle - Add device link to supplier from supplier phandle
1067 * @sup_np: phandle to supplier device tree node
1069 * Given a phandle to a supplier device tree node (@sup_np), this function
1070 * finds the device that owns the supplier device tree node and creates a
1072 * doesn't create device links for invalid scenarios such as trying to create a
1073 * link with a parent device as the consumer of its child device. In such
1077 * - 0 if link successfully created to supplier
1078 * - -EAGAIN if linking to the supplier should be reattempted
1079 * - -EINVAL if the supplier link is invalid and should not be created
1080 * - -ENODEV if there is no device that corresponds to the supplier phandle
1091 * Find the device node that contains the supplier phandle. It may be in of_link_to_phandle()
1096 /* Don't allow linking to a disabled supplier */ in of_link_to_phandle()
1109 dev_dbg(dev, "Not linking to %pOFP - No device\n", tmp_np); in of_link_to_phandle()
1110 return -ENODEV; in of_link_to_phandle()
1114 * Don't allow linking a device node as a consumer of one of its in of_link_to_phandle()
1115 * descendant nodes. By definition, a child node can't be a functional in of_link_to_phandle()
1116 * dependency for the parent node. in of_link_to_phandle()
1118 if (of_is_ancestor_of(dev->of_node, sup_np)) { in of_link_to_phandle()
1119 dev_dbg(dev, "Not linking to %pOFP - is descendant\n", sup_np); in of_link_to_phandle()
1121 return -EINVAL; in of_link_to_phandle()
1123 sup_dev = get_dev_from_fwnode(&sup_np->fwnode); in of_link_to_phandle()
1126 dev_dbg(dev, "Not linking to %pOFP - No struct device\n", in of_link_to_phandle()
1129 return -ENODEV; in of_link_to_phandle()
1138 return -EAGAIN; in of_link_to_phandle()
1145 dev_dbg(dev, "Not linking to %pOFP - cycle detected\n", in of_link_to_phandle()
1147 ret = -EINVAL; in of_link_to_phandle()
1153 ret = -EAGAIN; in of_link_to_phandle()
1162 ret = -EINVAL; in of_link_to_phandle()
1168 * parse_prop_cells - Property parsing function for suppliers
1170 * @np: Pointer to device tree node containing a list
1171 * @prop_name: Name of property to be parsed. Expected to hold phandle values
1172 * @index: For properties holding a list of phandles, this is the index
1174 * @list_name: Property name that is known to contain list of phandle(s) to
1176 * @cells_name: property name that specifies phandles' arguments count
1178 * This is a helper function to parse properties that have a known fixed name
1179 * and are a list of phandles and phandle arguments.
1182 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1184 * - NULL if no phandle found at index
1217 return -1; in strcmp_suffix()
1218 return strcmp(str + len - suffix_len, suffix); in strcmp_suffix()
1222 * parse_suffix_prop_cells - Suffix property parsing function for suppliers
1224 * @np: Pointer to device tree node containing a list
1225 * @prop_name: Name of property to be parsed. Expected to hold phandle values
1226 * @index: For properties holding a list of phandles, this is the index
1228 * @suffix: Property suffix that is known to contain list of phandle(s) to
1230 * @cells_name: property name that specifies phandles' arguments count
1232 * This is a helper function to parse properties that have a known fixed suffix
1233 * and are a list of phandles and phandle arguments.
1236 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1238 * - NULL if no phandle found at index
1265 * struct supplier_bindings - Property parsing functions for suppliers
1268 * parse_prop() finds the node corresponding to a supplier phandle
1269 * @parse_prop.np: Pointer to device node holding supplier phandle property
1270 * @parse_prop.prop_name: Name of property holding a phandle value
1271 * @parse_prop.index: For properties holding a list of phandles, this is the
1276 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1278 * - NULL if no phandle found at index
1285 DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
1286 DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
1287 DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
1288 DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
1289 DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells")
1290 DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL)
1291 DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
1292 DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
1293 DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells")
1295 DEFINE_SIMPLE_PROP(interrupts_extended, "interrupts-extended",
1296 "#interrupt-cells")
1297 DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
1298 DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
1299 DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
1300 DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
1301 DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL)
1302 DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL)
1303 DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL)
1304 DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL)
1305 DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
1306 DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
1307 DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
1308 DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
1309 DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
1310 DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
1311 DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
1316 if (strcmp(prop_name, "iommu-map")) in parse_iommu_maps()
1354 * of_link_property - Create device links to suppliers listed in a property
1356 * @con_np: The consumer device tree node which contains the property
1357 * @prop_name: Name of property to be parsed
1359 * This function checks if the property @prop_name that is present in the
1360 * @con_np device tree node is one of the known common device tree bindings
1368 * Any failed attempt to create a device link will NOT result in an immediate
1370 * devices even when attempts to create a link to one or more suppliers fail.
1382 if (dev->of_node == con_np) in of_link_property()
1388 while (!matched && s->parse_prop) { in of_link_property()
1389 while ((phandle = s->parse_prop(con_np, prop_name, i))) { in of_link_property()
1393 == -EAGAIN) in of_link_property()
1394 ret = -EAGAIN; in of_link_property()
1405 struct device_node *child; in of_link_to_suppliers() local
1406 struct property *p; in of_link_to_suppliers()
1410 if (of_link_property(dev, con_np, p->name)) in of_link_to_suppliers()
1411 ret = -ENODEV; in of_link_to_suppliers()
1413 for_each_available_child_of_node(con_np, child) in of_link_to_suppliers()
1414 if (of_link_to_suppliers(dev, child) && !ret) in of_link_to_suppliers()
1415 ret = -EAGAIN; in of_link_to_suppliers()