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
65 * Return: The number of elements on sucess, -EINVAL if the property does not
66 * exist or its length does not match a multiple of elem_size and -ENODATA if
67 * the property does not have a value.
72 struct property *prop = of_find_property(np, propname, NULL); in of_property_count_elems_of_size()
75 return -EINVAL; in of_property_count_elems_of_size()
76 if (!prop->value) in of_property_count_elems_of_size()
77 return -ENODATA; in of_property_count_elems_of_size()
79 if (prop->length % elem_size != 0) { in of_property_count_elems_of_size()
80 pr_err("size of %s in node %pOF is not a multiple of %d\n", in of_property_count_elems_of_size()
82 return -EINVAL; in of_property_count_elems_of_size()
85 return prop->length / elem_size; in of_property_count_elems_of_size()
92 * @np: device node from which the property value is to be read.
93 * @propname: name of the property to be searched.
94 * @min: minimum allowed length of property value
95 * @max: maximum allowed length of property value (0 means unlimited)
98 * Search for a property in a device node and valid the requested size.
100 * Return: The property value on success, -EINVAL if the property does not
101 * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
102 * property data is too small or too large.
108 struct property *prop = of_find_property(np, propname, NULL); in of_find_property_value_of_size()
111 return ERR_PTR(-EINVAL); in of_find_property_value_of_size()
112 if (!prop->value) in of_find_property_value_of_size()
113 return ERR_PTR(-ENODATA); in of_find_property_value_of_size()
114 if (prop->length < min) in of_find_property_value_of_size()
115 return ERR_PTR(-EOVERFLOW); in of_find_property_value_of_size()
116 if (max && prop->length > max) in of_find_property_value_of_size()
117 return ERR_PTR(-EOVERFLOW); in of_find_property_value_of_size()
120 *len = prop->length; in of_find_property_value_of_size()
122 return prop->value; in of_find_property_value_of_size()
126 * of_property_read_u32_index - Find and read a u32 from a multi-value property.
128 * @np: device node from which the property value is to be read.
129 * @propname: name of the property to be searched.
133 * Search for a property in a device node and read nth 32-bit value from
136 * Return: 0 on success, -EINVAL if the property does not exist,
137 * -ENODATA if property does not have a value, and -EOVERFLOW if the
138 * property data isn't large enough.
140 * The out_value is modified only if a valid u32 value can be decoded.
160 * of_property_read_u64_index - Find and read a u64 from a multi-value property.
162 * @np: device node from which the property value is to be read.
163 * @propname: name of the property to be searched.
167 * Search for a property in a device node and read nth 64-bit value from
170 * Return: 0 on success, -EINVAL if the property does not exist,
171 * -ENODATA if property does not have a value, and -EOVERFLOW if the
172 * property data isn't large enough.
174 * The out_value is modified only if a valid u64 value can be decoded.
193 * of_property_read_variable_u8_array - Find and read an array of u8 from a
194 * property, with bounds on the minimum and maximum array size.
196 * @np: device node from which the property value is to be read.
197 * @propname: name of the property to be searched.
204 * Search for a property in a device node and read 8-bit value(s) from
208 * ``property = /bits/ 8 <0x50 0x60 0x70>;``
210 * Return: The number of elements read on success, -EINVAL if the property
211 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
212 * if the property data is smaller than sz_min or longer than sz_max.
214 * The out_values is modified only if a valid u8 value can be decoded.
235 while (count--) in of_property_read_variable_u8_array()
243 * of_property_read_variable_u16_array - Find and read an array of u16 from a
244 * property, with bounds on the minimum and maximum array size.
246 * @np: device node from which the property value is to be read.
247 * @propname: name of the property to be searched.
254 * Search for a property in a device node and read 16-bit value(s) from
258 * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
260 * Return: The number of elements read on success, -EINVAL if the property
261 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
262 * if the property data is smaller than sz_min or longer than sz_max.
264 * The out_values is modified only if a valid u16 value can be decoded.
285 while (count--) in of_property_read_variable_u16_array()
293 * of_property_read_variable_u32_array - Find and read an array of 32 bit
294 * integers from a property, with bounds on the minimum and maximum array size.
296 * @np: device node from which the property value is to be read.
297 * @propname: name of the property to be searched.
304 * Search for a property in a device node and read 32-bit value(s) from
307 * Return: The number of elements read on success, -EINVAL if the property
308 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
309 * if the property data is smaller than sz_min or longer than sz_max.
311 * The out_values is modified only if a valid u32 value can be decoded.
332 while (count--) in of_property_read_variable_u32_array()
340 * of_property_read_u64 - Find and read a 64 bit integer from a property
341 * @np: device node from which the property value is to be read.
342 * @propname: name of the property to be searched.
345 * Search for a property in a device node and read a 64-bit value from
348 * Return: 0 on success, -EINVAL if the property does not exist,
349 * -ENODATA if property does not have a value, and -EOVERFLOW if the
350 * property data isn't large enough.
352 * The out_value is modified only if a valid u64 value can be decoded.
371 * of_property_read_variable_u64_array - Find and read an array of 64 bit
372 * integers from a property, with bounds on the minimum and maximum array size.
374 * @np: device node from which the property value is to be read.
375 * @propname: name of the property to be searched.
382 * Search for a property in a device node and read 64-bit value(s) from
385 * Return: The number of elements read on success, -EINVAL if the property
386 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
387 * if the property data is smaller than sz_min or longer than sz_max.
389 * The out_values is modified only if a valid u64 value can be decoded.
410 while (count--) { in of_property_read_variable_u64_array()
420 * of_property_read_string - Find and read a string from a property
421 * @np: device node from which the property value is to be read.
422 * @propname: name of the property to be searched.
426 * Search for a property in a device tree node and retrieve a null
427 * terminated string value (pointer to data, not a copy).
429 * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
430 * property does not have a value, and -EILSEQ if the string is not
431 * null-terminated within the length of the property data.
433 * The out_string pointer is modified only if a valid string can be decoded.
438 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string()
440 return -EINVAL; in of_property_read_string()
441 if (!prop->value) in of_property_read_string()
442 return -ENODATA; in of_property_read_string()
443 if (strnlen(prop->value, prop->length) >= prop->length) in of_property_read_string()
444 return -EILSEQ; in of_property_read_string()
445 *out_string = prop->value; in of_property_read_string()
451 * of_property_match_string() - Find string in a list and return index
452 * @np: pointer to node containing string list property
453 * @propname: string list property name
456 * This function searches a string list property and returns the index
457 * of a specific string value.
462 const struct property *prop = of_find_property(np, propname, NULL); in of_property_match_string()
468 return -EINVAL; in of_property_match_string()
469 if (!prop->value) in of_property_match_string()
470 return -ENODATA; in of_property_match_string()
472 p = prop->value; in of_property_match_string()
473 end = p + prop->length; in of_property_match_string()
476 l = strnlen(p, end - p) + 1; in of_property_match_string()
478 return -EILSEQ; in of_property_match_string()
483 return -ENODATA; in of_property_match_string()
488 * of_property_read_string_helper() - Utility helper for parsing string properties
489 * @np: device node from which the property value is to be read.
490 * @propname: name of the property to be searched.
495 * Don't call this function directly. It is a utility helper for the
502 const struct property *prop = of_find_property(np, propname, NULL); in of_property_read_string_helper()
507 return -EINVAL; in of_property_read_string_helper()
508 if (!prop->value) in of_property_read_string_helper()
509 return -ENODATA; in of_property_read_string_helper()
510 p = prop->value; in of_property_read_string_helper()
511 end = p + prop->length; in of_property_read_string_helper()
514 l = strnlen(p, end - p) + 1; in of_property_read_string_helper()
516 return -EILSEQ; in of_property_read_string_helper()
520 i -= skip; in of_property_read_string_helper()
521 return i <= 0 ? -ENODATA : i; in of_property_read_string_helper()
525 const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, in of_prop_next_u32()
534 curv = prop->value; in of_prop_next_u32()
539 if (curv >= prop->value + prop->length) in of_prop_next_u32()
548 const char *of_prop_next_string(struct property *prop, const char *cur) in of_prop_next_string()
556 return prop->value; in of_prop_next_string()
559 if (curv >= prop->value + prop->length) in of_prop_next_string()
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, in of_graph_parse_endpoint() argument
576 struct device_node *port_node = of_get_parent(node); in of_graph_parse_endpoint()
578 WARN_ONCE(!port_node, "%s(): endpoint %pOF has no parent node\n", in of_graph_parse_endpoint()
579 __func__, node); in of_graph_parse_endpoint()
583 endpoint->local_node = node; in of_graph_parse_endpoint()
588 of_property_read_u32(port_node, "reg", &endpoint->port); in of_graph_parse_endpoint()
589 of_property_read_u32(node, "reg", &endpoint->id); in of_graph_parse_endpoint()
598 * of_graph_get_port_by_id() - get the port matching a given 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; in of_graph_get_port_by_id() local
609 node = of_get_child_by_name(parent, "ports"); in of_graph_get_port_by_id()
610 if (node) in of_graph_get_port_by_id()
611 parent = node; in of_graph_get_port_by_id()
623 of_node_put(node); in of_graph_get_port_by_id()
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 in of_graph_get_next_endpoint()
648 * search for the first port node, otherwise get the previous endpoint in of_graph_get_next_endpoint()
649 * parent port node. in of_graph_get_next_endpoint()
652 struct device_node *node; in of_graph_get_next_endpoint() local
654 node = of_get_child_by_name(parent, "ports"); in of_graph_get_next_endpoint()
655 if (node) in of_graph_get_next_endpoint()
656 parent = node; in of_graph_get_next_endpoint()
659 of_node_put(node); in of_graph_get_next_endpoint()
662 pr_err("graph: no port node found in %pOF\n", parent); in of_graph_get_next_endpoint()
667 if (WARN_ONCE(!port, "%s(): endpoint %pOF has no parent node\n", in of_graph_get_next_endpoint()
674 * Now that we have a port node, get the next endpoint by in of_graph_get_next_endpoint()
675 * getting the next child. If the previous endpoint is NULL this in of_graph_get_next_endpoint()
676 * will return the first child. in of_graph_get_next_endpoint()
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
704 * ignored when they are -1. Use of_node_put() on the pointer when done.
710 struct device_node *node = NULL; in of_graph_get_endpoint_by_regs() local
712 for_each_endpoint_of_node(parent, node) { in of_graph_get_endpoint_by_regs()
713 of_graph_parse_endpoint(node, &endpoint); in of_graph_get_endpoint_by_regs()
714 if (((port_reg == -1) || (endpoint.port == port_reg)) && in of_graph_get_endpoint_by_regs()
715 ((reg == -1) || (endpoint.id == reg))) in of_graph_get_endpoint_by_regs()
716 return node; in of_graph_get_endpoint_by_regs()
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) in of_graph_get_remote_endpoint() argument
732 /* Get remote endpoint node. */ in of_graph_get_remote_endpoint()
733 return of_parse_phandle(node, "remote-endpoint", 0); in of_graph_get_remote_endpoint()
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) in of_graph_get_port_parent() argument
748 if (!node) in of_graph_get_port_parent()
752 * Preserve usecount for passed in node as of_get_next_parent() in of_graph_get_port_parent()
755 of_node_get(node); in of_graph_get_port_parent()
757 /* Walk 3 levels up only if there is 'ports' node. */ in of_graph_get_port_parent()
758 for (depth = 3; depth && node; depth--) { in of_graph_get_port_parent()
759 node = of_get_next_parent(node); in of_graph_get_port_parent()
760 if (depth == 2 && !of_node_name_eq(node, "ports")) in of_graph_get_port_parent()
763 return node; in of_graph_get_port_parent()
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) in of_graph_get_remote_port_parent() argument
779 /* Get remote endpoint node. */ in of_graph_get_remote_port_parent()
780 np = of_graph_get_remote_endpoint(node); in of_graph_get_remote_port_parent()
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) in of_graph_get_remote_port() argument
801 /* Get remote endpoint node. */ in of_graph_get_remote_port()
802 np = of_graph_get_remote_endpoint(node); in of_graph_get_remote_port()
822 * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
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, in of_graph_get_remote_node() argument
835 endpoint_node = of_graph_get_endpoint_by_regs(node, port, endpoint); in of_graph_get_remote_node()
837 pr_debug("no valid endpoint (%d, %d) for node %pOF\n", in of_graph_get_remote_node()
838 port, endpoint, node); in of_graph_get_remote_node()
845 pr_debug("no valid remote node\n"); in of_graph_get_remote_node()
850 pr_debug("not available for remote node\n"); in of_graph_get_remote_node()
885 const struct device_node *node = to_of_node(fwnode); in of_fwnode_property_read_int_array() local
888 return of_property_count_elems_of_size(node, propname, in of_fwnode_property_read_int_array()
893 return of_property_read_u8_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
895 return of_property_read_u16_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
897 return of_property_read_u32_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
899 return of_property_read_u64_array(node, propname, val, nval); in of_fwnode_property_read_int_array()
902 return -ENXIO; in of_fwnode_property_read_int_array()
910 const struct device_node *node = to_of_node(fwnode); in of_fwnode_property_read_string_array() local
913 of_property_read_string_array(node, propname, val, nval) : in of_fwnode_property_read_string_array()
914 of_property_count_strings(node, propname); in of_fwnode_property_read_string_array()
919 return kbasename(to_of_node(fwnode)->full_name); in of_fwnode_get_name()
925 if (!to_of_node(fwnode)->parent) in of_fwnode_get_name_prefix()
939 struct fwnode_handle *child) in of_fwnode_get_next_child_node() argument
942 to_of_node(child))); in of_fwnode_get_next_child_node()
949 const struct device_node *node = to_of_node(fwnode); in of_fwnode_get_named_child_node() local
950 struct device_node *child; in of_fwnode_get_named_child_node() local
952 for_each_available_child_of_node(node, child) in of_fwnode_get_named_child_node()
953 if (of_node_name_eq(child, childname)) in of_fwnode_get_named_child_node()
954 return of_fwnode_handle(child); in of_fwnode_get_named_child_node()
982 args->nargs = of_args.args_count; in of_fwnode_get_reference_args()
983 args->fwnode = of_fwnode_handle(of_args.np); in of_fwnode_get_reference_args()
986 args->args[i] = i < of_args.args_count ? of_args.args[i] : 0; in of_fwnode_get_reference_args()
1016 /* Is this the "ports" node? If not, it's the port parent. */ in of_fwnode_graph_get_port_parent()
1026 const struct device_node *node = to_of_node(fwnode); in of_fwnode_graph_parse_endpoint() local
1027 struct device_node *port_node = of_get_parent(node); in of_fwnode_graph_parse_endpoint()
1029 endpoint->local_fwnode = fwnode; in of_fwnode_graph_parse_endpoint()
1031 of_property_read_u32(port_node, "reg", &endpoint->port); in of_fwnode_graph_parse_endpoint()
1032 of_property_read_u32(node, "reg", &endpoint->id); in of_fwnode_graph_parse_endpoint()
1047 struct device_node *child) in of_is_ancestor_of() argument
1049 of_node_get(child); in of_is_ancestor_of()
1050 while (child) { in of_is_ancestor_of()
1051 if (child == test_ancestor) { in of_is_ancestor_of()
1052 of_node_put(child); in of_is_ancestor_of()
1055 child = of_get_next_parent(child); in of_is_ancestor_of()
1061 * of_get_next_parent_dev - Add device link to supplier from supplier phandle
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.
1078 dev = get_dev_from_fwnode(&np->fwnode); in of_get_next_parent_dev()
1085 * of_link_to_phandle - Add device link to supplier from supplier phandle
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
1092 * doesn't create device links for invalid scenarios such as trying to create a
1093 * link with a parent device as the consumer of its child device. In such
1097 * - 0 if link successfully created to supplier
1098 * - -EAGAIN if linking to the supplier should be reattempted
1099 * - -EINVAL if the supplier link is invalid and should not be created
1100 * - -ENODEV if there is no device that corresponds to the supplier phandle
1111 * Find the device node that contains the supplier phandle. It may be in of_link_to_phandle()
1116 /* Don't allow linking to a disabled supplier */ in of_link_to_phandle()
1129 dev_dbg(dev, "Not linking to %pOFP - No device\n", tmp_np); in of_link_to_phandle()
1130 return -ENODEV; in of_link_to_phandle()
1134 * Don't allow linking a device node as a consumer of one of its in of_link_to_phandle()
1135 * descendant nodes. By definition, a child node can't be a functional in of_link_to_phandle()
1136 * dependency for the parent node. in of_link_to_phandle()
1138 if (of_is_ancestor_of(dev->of_node, sup_np)) { in of_link_to_phandle()
1139 dev_dbg(dev, "Not linking to %pOFP - is descendant\n", sup_np); in of_link_to_phandle()
1141 return -EINVAL; in of_link_to_phandle()
1143 sup_dev = get_dev_from_fwnode(&sup_np->fwnode); in of_link_to_phandle()
1146 dev_dbg(dev, "Not linking to %pOFP - No struct device\n", in of_link_to_phandle()
1149 return -ENODEV; in of_link_to_phandle()
1158 return -EAGAIN; in of_link_to_phandle()
1165 dev_dbg(dev, "Not linking to %pOFP - cycle detected\n", in of_link_to_phandle()
1167 ret = -EINVAL; in of_link_to_phandle()
1173 ret = -EAGAIN; in of_link_to_phandle()
1182 ret = -EINVAL; in of_link_to_phandle()
1188 * parse_prop_cells - Property parsing function for suppliers
1190 * @np: Pointer to device tree node containing a list
1191 * @prop_name: Name of property to be parsed. Expected to hold phandle values
1192 * @index: For properties holding a list of phandles, this is the index
1194 * @list_name: Property name that is known to contain list of phandle(s) to
1196 * @cells_name: property name that specifies phandles' arguments count
1198 * This is a helper function to parse properties that have a known fixed name
1199 * and are a list of phandles and phandle arguments.
1202 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1204 * - NULL if no phandle found at index
1237 return -1; in strcmp_suffix()
1238 return strcmp(str + len - suffix_len, suffix); in strcmp_suffix()
1242 * parse_suffix_prop_cells - Suffix property parsing function for suppliers
1244 * @np: Pointer to device tree node containing a list
1245 * @prop_name: Name of property to be parsed. Expected to hold phandle values
1246 * @index: For properties holding a list of phandles, this is the index
1248 * @suffix: Property suffix that is known to contain list of phandle(s) to
1250 * @cells_name: property name that specifies phandles' arguments count
1252 * This is a helper function to parse properties that have a known fixed suffix
1253 * and are a list of phandles and phandle arguments.
1256 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1258 * - NULL if no phandle found at index
1285 * struct supplier_bindings - Property parsing functions for suppliers
1288 * parse_prop() finds the node corresponding to a supplier phandle
1289 * @parse_prop.np: Pointer to device node holding supplier phandle property
1290 * @parse_prop.prop_name: Name of property holding a phandle value
1291 * @parse_prop.index: For properties holding a list of phandles, this is the
1296 * - phandle node pointer with refcount incremented. Caller must of_node_put()
1298 * - NULL if no phandle found at index
1305 DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
1306 DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
1307 DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
1308 DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
1309 DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
1310 DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL)
1311 DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
1312 DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
1313 DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells")
1315 DEFINE_SIMPLE_PROP(interrupts_extended, "interrupts-extended",
1316 "#interrupt-cells")
1317 DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
1318 DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
1319 DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
1320 DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
1321 DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL)
1322 DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL)
1323 DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL)
1324 DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL)
1325 DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
1326 DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
1327 DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
1328 DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
1329 DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
1330 DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
1335 if (!strcmp_suffix(prop_name, ",nr-gpios")) in parse_gpios()
1338 return parse_suffix_prop_cells(np, prop_name, index, "-gpios", in parse_gpios()
1339 "#gpio-cells"); in parse_gpios()
1345 if (strcmp(prop_name, "iommu-map")) in parse_iommu_maps()
1383 * of_link_property - Create device links to suppliers listed in a property
1385 * @con_np: The consumer device tree node which contains the property
1386 * @prop_name: Name of property to be parsed
1388 * This function checks if the property @prop_name that is present in the
1389 * @con_np device tree node is one of the known common device tree bindings
1397 * Any failed attempt to create a device link will NOT result in an immediate
1399 * devices even when attempts to create a link to one or more suppliers fail.
1411 if (dev->of_node == con_np) in of_link_property()
1417 while (!matched && s->parse_prop) { in of_link_property()
1418 while ((phandle = s->parse_prop(con_np, prop_name, i))) { in of_link_property()
1422 == -EAGAIN) in of_link_property()
1423 ret = -EAGAIN; in of_link_property()
1434 struct device_node *child; in of_link_to_suppliers() local
1435 struct property *p; in of_link_to_suppliers()
1439 if (of_link_property(dev, con_np, p->name)) in of_link_to_suppliers()
1440 ret = -ENODEV; in of_link_to_suppliers()
1442 for_each_available_child_of_node(con_np, child) in of_link_to_suppliers()
1443 if (of_link_to_suppliers(dev, child) && !ret) in of_link_to_suppliers()
1444 ret = -EAGAIN; in of_link_to_suppliers()