Lines Matching +full:string +full:- +full:array +full:- +full:property
1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) 1996-2005 Paul Mackerras.
29 #include <linux/string.h>
68 node_name = kbasename(np->full_name); in of_node_name_eq()
69 len = strchrnul(node_name, '@') - node_name; in of_node_name_eq()
80 return strncmp(kbasename(np->full_name), prefix, strlen(prefix)) == 0; in of_node_name_prefix()
108 for (; np; np = np->parent) { in of_bus_n_addr_cells()
109 if (!of_property_read_u32(np, "#address-cells", &cells)) in of_bus_n_addr_cells()
112 * Default root value and walking parent nodes for "#address-cells" in of_bus_n_addr_cells()
117 "Missing '#address-cells' in %pOF\n", np); in of_bus_n_addr_cells()
124 if (np->parent) in of_n_addr_cells()
125 np = np->parent; in of_n_addr_cells()
135 for (; np; np = np->parent) { in of_bus_n_size_cells()
136 if (!of_property_read_u32(np, "#size-cells", &cells)) in of_bus_n_size_cells()
139 * Default root value and walking parent nodes for "#size-cells" in of_bus_n_size_cells()
144 "Missing '#size-cells' in %pOF\n", np); in of_bus_n_size_cells()
151 if (np->parent) in of_n_size_cells()
152 np = np->parent; in of_n_size_cells()
189 if (np && handle == np->phandle) in __of_phandle_cache_inv_entry()
209 if (np->phandle && !phandle_cache[of_phandle_cache_hash(np->phandle)]) in of_core_init()
210 phandle_cache[of_phandle_cache_hash(np->phandle)] = np; in of_core_init()
216 proc_symlink("device-tree", NULL, "/sys/firmware/devicetree/base"); in of_core_init()
219 static struct property *__of_find_property(const struct device_node *np, in __of_find_property()
222 struct property *pp; in __of_find_property()
227 for (pp = np->properties; pp; pp = pp->next) { in __of_find_property()
228 if (of_prop_cmp(pp->name, name) == 0) { in __of_find_property()
230 *lenp = pp->length; in __of_find_property()
238 struct property *of_find_property(const struct device_node *np, in of_find_property()
242 struct property *pp; in of_find_property()
258 } else if (prev->child) { in __of_find_all_nodes()
259 np = prev->child; in __of_find_all_nodes()
263 while (np->parent && !np->sibling) in __of_find_all_nodes()
264 np = np->parent; in __of_find_all_nodes()
265 np = np->sibling; /* Might be null at the end of the tree */ in __of_find_all_nodes()
271 * of_find_all_nodes - Get next node in global list
293 * Find a property with a given name for a given node
299 const struct property *pp = __of_find_property(np, name, lenp); in __of_get_property()
301 return pp ? pp->value : NULL; in __of_get_property()
305 * Find a property with a given name for a given node
311 const struct property *pp = of_find_property(np, name, lenp); in of_get_property()
313 return pp ? pp->value : NULL; in of_get_property()
318 * __of_device_is_compatible() - Check if the node matches given constraints
320 * @compat: required compatible string, NULL or "" for any match
326 * passing NULL or an empty string as the constraint.
350 const struct property *prop; in __of_device_is_compatible()
360 score = INT_MAX/2 - (index << 2); in __of_device_is_compatible()
385 /** Checks if the given "compat" string matches one of the strings in
386 * the device's "compatible" property
402 * a NULL terminated array of strings. Returns the best match
425 * of_machine_compatible_match - Test root of device tree against a compatible array
426 …* @compats: NULL terminated array of compatible strings to look for in root node's compatible prop…
429 * compatible property.
447 * of_machine_read_compatible - Get the compatible string of this machine
448 * @compatible: address at which the address of the compatible string will be
462 * of_machine_read_model - Get the model string of this machine
463 * @model: address at which the address of the model string will be stored
475 * of_machine_get_match - Test root of device tree against an of_device_id array
476 * @matches: NULL terminated array of of_device_id match structures to search in
496 * of_machine_get_match_data - Tell if root of device tree has a matching of_match structure
497 * @matches: NULL terminated array of of_device_id match structures to search in
509 return match->data; in of_machine_get_match_data()
531 if ((*strings)[len - 1] == '-') { in __of_device_is_status()
545 * __of_device_is_available - check if a device is available for use
549 * Return: True if the status property is absent or set to "okay" or "ok",
564 * __of_device_is_reserved - check if a device is reserved
568 * Return: True if the status property is set to "reserved", false otherwise
578 * of_device_is_available - check if a device is available for use
582 * Return: True if the status property is absent or set to "okay" or "ok",
599 * __of_device_is_fail - check if a device has status "fail" or "fail-..."
603 * Return: True if the status property is set to "fail" or "fail-..." (for any
608 static const char * const fail[] = {"fail", "fail-", NULL}; in __of_device_is_fail()
614 * of_device_is_big_endian - check if a device has BE registers
618 * Return: True if the device has a "big-endian" property, or if the kernel
619 * was compiled for BE *and* the device has a "native-endian" property.
627 if (of_property_read_bool(device, "big-endian")) in of_device_is_big_endian()
630 of_property_read_bool(device, "native-endian")) in of_device_is_big_endian()
637 * of_get_parent - Get a node's parent if any
652 np = of_node_get(node->parent); in of_get_parent()
659 * of_get_next_parent - Iterate to a node's parent
678 parent = of_node_get(node->parent); in of_get_next_parent()
693 next = prev ? prev->sibling : node->child; in __of_get_next_child()
703 * of_get_next_child - Iterate a node childs
725 * of_get_next_child_with_prefix - Find the next child node with prefix
747 next = prev ? prev->sibling : node->child; in of_get_next_child_with_prefix()
748 for (; next; next = next->sibling) { in of_get_next_child_with_prefix()
771 next = prev ? prev->sibling : node->child; in of_get_next_status_child()
772 for (; next; next = next->sibling) { in of_get_next_status_child()
784 * of_get_next_available_child - Find the next available child node
799 * of_get_next_reserved_child - Find the next reserved child node
814 * of_get_next_cpu_node - Iterate on cpu nodes
817 * Unusable CPUs (those with the status property set to "fail" or "fail-...")
835 next = prev->sibling; in of_get_next_cpu_node()
837 next = node->child; in of_get_next_cpu_node()
840 for (; next; next = next->sibling) { in of_get_next_cpu_node()
856 * of_get_compatible_child - Find compatible child node
858 * @compatible: compatible string
860 * Lookup child node whose compatible property contains the given compatible
861 * string.
881 * of_get_child_by_name - Find the child node by name for a given parent
904 * of_get_available_child_by_name - Find the available child node by name for a given parent
941 const char *name = kbasename(child->full_name); in __of_find_node_by_path()
967 * of_find_node_opts_by_path - Find a node matching a full OF path
969 * start with '/', the name of a property of the /aliases
973 * an options string appended to the end of the path with
987 const struct property *pp; in of_find_node_opts_by_path()
1004 len = p - path; in of_find_node_opts_by_path()
1011 if (strlen(pp->name) == len && !strncmp(pp->name, path, len)) { in of_find_node_opts_by_path()
1012 np = of_find_node_by_path(pp->value); in of_find_node_opts_by_path()
1032 * of_find_node_by_name - Find a node by its "name" property
1037 * @name: The name string to match against
1059 * of_find_node_by_type - Find a node by its "device_type" property
1065 * @type: The type string to match against
1087 * of_find_compatible_node - Find a node based on type and one of the
1088 * tokens in its "compatible" property
1093 * @type: The type string to match "device_type" or NULL to ignore
1094 * @compatible: The string to match to one of the tokens in the device
1118 * of_find_node_with_property - Find a node which has a property with
1124 * @prop_name: The name of the property to look for.
1158 for (; matches->name[0] || matches->type[0] || matches->compatible[0]; matches++) { in __of_match_node()
1159 score = __of_device_is_compatible(node, matches->compatible, in __of_match_node()
1160 matches->type, matches->name); in __of_match_node()
1171 * of_match_node - Tell if a device_node has a matching of_match structure
1172 * @matches: array of of device match structures to search in
1191 * of_find_matching_node_and_match - Find a node based on an of_device_id
1197 * @matches: array of of device match structures to search in
1230 * of_alias_from_compatible - Lookup appropriate alias for a device node
1236 * Based on the value of the compatible property, this routine will attempt
1239 * from the first entry in the compatible list property.
1254 return -ENODEV; in of_alias_from_compatible()
1262 * of_find_node_by_phandle - Find a node given a phandle
1282 handle == phandle_cache[handle_hash]->phandle) in of_find_node_by_phandle()
1287 if (np->phandle == handle && in of_find_node_by_phandle()
1303 printk("%s %pOF", msg, args->np); in of_print_phandle_args()
1304 for (i = 0; i < args->args_count; i++) { in of_print_phandle_args()
1307 pr_cont("%c%08x", delim, args->args[i]); in of_print_phandle_args()
1328 return -EINVAL; in of_phandle_iterator_init()
1332 return -ENOENT; in of_phandle_iterator_init()
1334 it->cells_name = cells_name; in of_phandle_iterator_init()
1335 it->cell_count = cell_count; in of_phandle_iterator_init()
1336 it->parent = np; in of_phandle_iterator_init()
1337 it->list_end = list + size / sizeof(*list); in of_phandle_iterator_init()
1338 it->phandle_end = list; in of_phandle_iterator_init()
1339 it->cur = list; in of_phandle_iterator_init()
1349 if (it->node) { in of_phandle_iterator_next()
1350 of_node_put(it->node); in of_phandle_iterator_next()
1351 it->node = NULL; in of_phandle_iterator_next()
1354 if (!it->cur || it->phandle_end >= it->list_end) in of_phandle_iterator_next()
1355 return -ENOENT; in of_phandle_iterator_next()
1357 it->cur = it->phandle_end; in of_phandle_iterator_next()
1360 it->phandle = be32_to_cpup(it->cur++); in of_phandle_iterator_next()
1362 if (it->phandle) { in of_phandle_iterator_next()
1365 * Find the provider node and parse the #*-cells property to in of_phandle_iterator_next()
1368 it->node = of_find_node_by_phandle(it->phandle); in of_phandle_iterator_next()
1370 if (it->cells_name) { in of_phandle_iterator_next()
1371 if (!it->node) { in of_phandle_iterator_next()
1373 it->parent, it->phandle); in of_phandle_iterator_next()
1377 if (of_property_read_u32(it->node, it->cells_name, in of_phandle_iterator_next()
1382 * of the cells_name property in of_phandle_iterator_next()
1384 if (it->cell_count >= 0) { in of_phandle_iterator_next()
1385 count = it->cell_count; in of_phandle_iterator_next()
1388 it->parent, in of_phandle_iterator_next()
1389 it->cells_name, in of_phandle_iterator_next()
1390 it->node); in of_phandle_iterator_next()
1395 count = it->cell_count; in of_phandle_iterator_next()
1400 * property data length in of_phandle_iterator_next()
1402 if (it->cur + count > it->list_end) { in of_phandle_iterator_next()
1403 if (it->cells_name) in of_phandle_iterator_next()
1405 it->parent, it->cells_name, in of_phandle_iterator_next()
1406 count, it->list_end - it->cur); in of_phandle_iterator_next()
1409 it->parent, of_node_full_name(it->node), in of_phandle_iterator_next()
1410 count, it->list_end - it->cur); in of_phandle_iterator_next()
1415 it->phandle_end = it->cur + count; in of_phandle_iterator_next()
1416 it->cur_count = count; in of_phandle_iterator_next()
1421 if (it->node) { in of_phandle_iterator_next()
1422 of_node_put(it->node); in of_phandle_iterator_next()
1423 it->node = NULL; in of_phandle_iterator_next()
1426 return -EINVAL; in of_phandle_iterator_next()
1436 count = it->cur_count; in of_phandle_iterator_args()
1442 args[i] = be32_to_cpup(it->cur++); in of_phandle_iterator_args()
1457 return -EINVAL; in __of_parse_phandle_with_args()
1465 * or return -ENOENT for an empty entry. in __of_parse_phandle_with_args()
1467 rc = -ENOENT; in __of_parse_phandle_with_args()
1476 out_args->args, in __of_parse_phandle_with_args()
1478 out_args->np = it.node; in __of_parse_phandle_with_args()
1479 out_args->args_count = c; in __of_parse_phandle_with_args()
1493 * -ENOENT : index is for empty phandle in __of_parse_phandle_with_args()
1494 * -EINVAL : parsing error on data in __of_parse_phandle_with_args()
1504 * of_parse_phandle_with_args_map() - Find a node pointed by phandle in a list and remap it
1506 * @list_name: property name that contains a list
1507 * @stem_name: stem of property names that specify phandles' arguments count
1515 * a <@stem_name>-map property.
1517 * Caller is responsible to call of_node_put() on the returned @_out_args->np
1523 * #list-cells = <2>;
1527 * #list-cells = <1>;
1531 * #list-cells = <1>;
1532 * list-map = <0 &phandle2 3>,
1535 * list-map-mask = <0x3>;
1550 char *cells_name __free(kfree) = kasprintf(GFP_KERNEL, "#%s-cells", stem_name); in of_parse_phandle_with_args_map()
1551 char *map_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map", stem_name); in of_parse_phandle_with_args_map()
1552 char *mask_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-mask", stem_name); in of_parse_phandle_with_args_map()
1553 char *pass_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-pass-thru", stem_name); in of_parse_phandle_with_args_map()
1556 static const __be32 dummy_mask[] = { [0 ... (MAX_PHANDLE_ARGS - 1)] = cpu_to_be32(~0) }; in of_parse_phandle_with_args_map()
1557 static const __be32 dummy_pass[] = { [0 ... (MAX_PHANDLE_ARGS - 1)] = cpu_to_be32(0) }; in of_parse_phandle_with_args_map()
1566 return -EINVAL; in of_parse_phandle_with_args_map()
1569 return -ENOMEM; in of_parse_phandle_with_args_map()
1571 ret = __of_parse_phandle_with_args(np, list_name, cells_name, -1, index, in of_parse_phandle_with_args_map()
1576 /* Get the #<list>-cells property */ in of_parse_phandle_with_args_map()
1577 cur = out_args->np; in of_parse_phandle_with_args_map()
1582 /* Precalculate the match array - this simplifies match loop */ in of_parse_phandle_with_args_map()
1584 initial_match_array[i] = cpu_to_be32(out_args->args[i]); in of_parse_phandle_with_args_map()
1586 ret = -EINVAL; in of_parse_phandle_with_args_map()
1588 /* Get the <list>-map property */ in of_parse_phandle_with_args_map()
1592 of_node_put(out_args->np); in of_parse_phandle_with_args_map()
1597 /* Get the <list>-map-mask property (optional) */ in of_parse_phandle_with_args_map()
1601 /* Iterate through <list>-map property */ in of_parse_phandle_with_args_map()
1606 for (i = 0; i < list_size; i++, map_len--) in of_parse_phandle_with_args_map()
1612 map_len--; in of_parse_phandle_with_args_map()
1616 ret = -EINVAL; in of_parse_phandle_with_args_map()
1630 ret = -EINVAL; in of_parse_phandle_with_args_map()
1634 /* Move forward by new node's #<list>-cells amount */ in of_parse_phandle_with_args_map()
1636 map_len -= new_size; in of_parse_phandle_with_args_map()
1639 ret = -ENOENT; in of_parse_phandle_with_args_map()
1643 /* Get the <list>-map-pass-thru property (optional) */ in of_parse_phandle_with_args_map()
1649 * Successfully parsed a <list>-map translation; copy new in of_parse_phandle_with_args_map()
1651 * bits specified in <list>-map-pass-thru. in of_parse_phandle_with_args_map()
1654 __be32 val = *(map - new_size + i); in of_parse_phandle_with_args_map()
1658 val |= cpu_to_be32(out_args->args[i]) & pass[i]; in of_parse_phandle_with_args_map()
1662 out_args->args[i] = be32_to_cpu(val); in of_parse_phandle_with_args_map()
1664 out_args->args_count = list_size = new_size; in of_parse_phandle_with_args_map()
1666 out_args->np = new; in of_parse_phandle_with_args_map()
1679 * of_count_phandle_with_args() - Find the number of phandles references in a property
1681 * @list_name: property name that contains a list
1682 * @cells_name: property name that specifies phandles' arguments count
1684 * Return: The number of phandle + argument tuples within a property. It
1686 * arguments into a single property. The number of arguments is encoded
1687 * by a property in the phandle-target node. For example, a gpios
1688 * property would contain a list of GPIO specifies consisting of a
1690 * determined by the #gpio-cells property in the node pointed to by the
1711 return -ENOENT; in of_count_phandle_with_args()
1716 rc = of_phandle_iterator_init(&it, np, list_name, cells_name, -1); in of_count_phandle_with_args()
1723 if (rc != -ENOENT) in of_count_phandle_with_args()
1730 static struct property *__of_remove_property_from_list(struct property **list, struct property *pro… in __of_remove_property_from_list()
1732 struct property **next; in __of_remove_property_from_list()
1734 for (next = list; *next; next = &(*next)->next) { in __of_remove_property_from_list()
1736 *next = prop->next; in __of_remove_property_from_list()
1737 prop->next = NULL; in __of_remove_property_from_list()
1745 * __of_add_property - Add a property to a node without lock operations
1747 * @prop: Property to add
1749 int __of_add_property(struct device_node *np, struct property *prop) in __of_add_property()
1753 struct property **next; in __of_add_property()
1757 __of_remove_property_from_list(&np->deadprops, prop); in __of_add_property()
1759 prop->next = NULL; in __of_add_property()
1760 next = &np->properties; in __of_add_property()
1762 if (of_prop_cmp(prop->name, (*next)->name) == 0) { in __of_add_property()
1764 rc = -EEXIST; in __of_add_property()
1767 next = &(*next)->next; in __of_add_property()
1781 * of_add_property - Add a property to a node
1783 * @prop: Property to add
1785 int of_add_property(struct device_node *np, struct property *prop) in of_add_property()
1800 int __of_remove_property(struct device_node *np, struct property *prop) in __of_remove_property()
1803 int rc = -ENODEV; in __of_remove_property()
1807 if (__of_remove_property_from_list(&np->properties, prop)) { in __of_remove_property()
1808 /* Found the property, add it to deadprops list */ in __of_remove_property()
1809 prop->next = np->deadprops; in __of_remove_property()
1810 np->deadprops = prop; in __of_remove_property()
1823 * of_remove_property - Remove a property from a node.
1825 * @prop: Property to remove
1828 * who-knows-how-many pointers to the data using get-property.
1829 * Instead we just move the property to the "dead properties"
1832 int of_remove_property(struct device_node *np, struct property *prop) in of_remove_property()
1837 return -ENODEV; in of_remove_property()
1850 int __of_update_property(struct device_node *np, struct property *newprop, in __of_update_property()
1851 struct property **oldpropp) in __of_update_property()
1853 struct property **next, *oldprop; in __of_update_property()
1858 __of_remove_property_from_list(&np->deadprops, newprop); in __of_update_property()
1860 for (next = &np->properties; *next; next = &(*next)->next) { in __of_update_property()
1861 if (of_prop_cmp((*next)->name, newprop->name) == 0) in __of_update_property()
1868 newprop->next = oldprop->next; in __of_update_property()
1870 oldprop->next = np->deadprops; in __of_update_property()
1871 np->deadprops = oldprop; in __of_update_property()
1874 newprop->next = NULL; in __of_update_property()
1886 * of_update_property - Update a property in a node, if the property does
1890 * who-knows-how-many pointers to the data using get-property.
1891 * Instead we just move the property to the "dead properties" list,
1892 * and add the new property to the property list
1894 int of_update_property(struct device_node *np, struct property *newprop) in of_update_property()
1896 struct property *oldprop; in of_update_property()
1899 if (!newprop->name) in of_update_property()
1900 return -EINVAL; in of_update_property()
1915 ap->np = np; in of_alias_add()
1916 ap->id = id; in of_alias_add()
1917 strscpy(ap->stem, stem, stem_len + 1); in of_alias_add()
1918 list_add_tail(&ap->link, &aliases_lookup); in of_alias_add()
1920 ap->alias, ap->stem, ap->id, np); in of_alias_add()
1924 * of_alias_scan - Scan all properties of the 'aliases' node
1933 const struct property *pp; in of_alias_scan()
1941 /* linux,stdout-path and /aliases/stdout are for legacy compatibility */ in of_alias_scan()
1944 if (of_property_read_string(of_chosen, "stdout-path", &name)) in of_alias_scan()
1945 of_property_read_string(of_chosen, "linux,stdout-path", in of_alias_scan()
1952 fwnode_set_flag(&of_stdout->fwnode, FWNODE_FLAG_BEST_EFFORT); in of_alias_scan()
1959 const char *start = pp->name; in of_alias_scan()
1966 if (is_pseudo_property(pp->name)) in of_alias_scan()
1969 np = of_find_node_by_path(pp->value); in of_alias_scan()
1974 * the 'stem' string */ in of_alias_scan()
1975 while (end > start && isdigit(*(end - 1))) in of_alias_scan()
1976 end--; in of_alias_scan()
1977 len = end - start; in of_alias_scan()
1991 ap->alias = start; in of_alias_scan()
1997 * of_alias_get_id - Get alias id for the given device_node
2009 int id = -ENODEV; in of_alias_get_id()
2013 if (strcmp(app->stem, stem) != 0) in of_alias_get_id()
2016 if (np == app->np) { in of_alias_get_id()
2017 id = app->id; in of_alias_get_id()
2028 * of_alias_get_highest_id - Get highest alias id for the given stem
2037 int id = -ENODEV; in of_alias_get_highest_id()
2041 if (strcmp(app->stem, stem) != 0) in of_alias_get_highest_id()
2044 if (app->id > id) in of_alias_get_highest_id()
2045 id = app->id; in of_alias_get_highest_id()
2054 * of_console_check() - Test and setup console for DT setup
2059 * Check if the given device node matches the stdout-path property in the
2078 * of_find_next_cache_node - Find a node's subsidiary cache
2089 cache_node = of_parse_phandle(np, "l2-cache", 0); in of_find_next_cache_node()
2091 cache_node = of_parse_phandle(np, "next-level-cache", 0); in of_find_next_cache_node()
2096 /* OF on pmac has nodes instead of properties named "l2-cache" in of_find_next_cache_node()
2108 * of_find_last_cache_level - Find the level at which the last cache is
2127 of_property_read_u32(prev, "cache-level", &cache_level); in of_find_last_cache_level()
2134 * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
2140 * #iommu-cells = <2>;
2143 * iommu-map = <0x0000 &smmu 0x0000 0x1>,
2160 * of_map_id - Translate an ID through a downstream mapping.
2163 * @map_name: property name of the map to use.
2164 * @cells_name: property name of target specifier cells.
2165 * @map_mask_name: optional property name of the mask to use.
2167 * If non-NULL, the map property must exist (-ENODEV if absent). If
2168 * ``*filter_np`` is also non-NULL, only entries targeting that node match.
2170 * @arg->args_count will be set to the number of output specifier cells
2172 * @arg->args[0..args_count-1] will contain the translated output
2173 * specifier values. If a map entry was matched, @arg->np will be set
2177 * Given a device ID, look up the appropriate implementation-defined
2179 * ID, as per the "iommu-map" and "msi-map" bindings.
2194 return -EINVAL; in of_map_id()
2195 /* Ensure bypass/no-match success never returns a stale target node. */ in of_map_id()
2196 arg->np = NULL; in of_map_id()
2201 return -ENODEV; in of_map_id()
2203 arg->args[0] = id; in of_map_id()
2204 arg->args_count = 1; in of_map_id()
2216 * Can be overridden by "{iommu,msi}-map-mask" property. in of_map_id()
2229 if (map_len - offset < 2) in of_map_id()
2235 pr_err("%pOF: Invalid %s translation - %s (0x%x) ignores id-base (0x%x)\n", in of_map_id()
2237 return -EFAULT; in of_map_id()
2243 return -ENODEV; in of_map_id()
2246 * Assume 1-cell output specifier if the target node lacks the in of_map_id()
2247 * #cells property, for backward compatibility with controllers in of_map_id()
2248 * that predate the property (e.g. arm,gic-v2m-frame). in of_map_id()
2257 return -EINVAL; in of_map_id()
2263 pr_warn_once("%pOF: %s has 1-cell entries targeting 2-cell %s, treating as 1-cell output\n", in of_map_id()
2269 if (map_len - offset < 3 + cells) { in of_map_id()
2277 id_len = be32_to_cpup(map + offset - 1); in of_map_id()
2278 id_off = masked_id - id_base; in of_map_id()
2289 pr_err("%pOF: Unsupported %s - cannot handle %d-ID range with %d-cell output specifier\n", in of_map_id()
2292 return -EINVAL; in of_map_id()
2300 arg->np = phandle_node; in of_map_id()
2302 arg->args[i] = id_off + be32_to_cpu(out_base[i]); in of_map_id()
2303 arg->args_count = cells; in of_map_id()
2305 …pr_debug("%pOF: %s, using mask %08x, id-base: %08x, out-base: %08x, length: %08x, id: %08x -> %08x… in of_map_id()
2317 arg->args[0] = id; in of_map_id()
2318 arg->args_count = 1; in of_map_id()
2323 return -EINVAL; in of_map_id()
2328 * of_map_iommu_id - Translate an ID using "iommu-map" bindings.
2331 * stream/device ID) used as the lookup key in the iommu-map table.
2333 * @arg->args_count will be set to the number of output specifier cells
2334 * and @arg->args[0..args_count-1] will contain the translated output
2335 * specifier values. If a map entry was matched, @arg->np holds a
2339 * Convenience wrapper around of_map_id() using "iommu-map", "#iommu-cells",
2340 * and "iommu-map-mask".
2347 return of_map_id(np, id, "iommu-map", "#iommu-cells", "iommu-map-mask", NULL, arg); in of_map_iommu_id()
2352 * of_map_msi_id - Translate an ID using "msi-map" bindings.
2355 * stream/device ID) used as the lookup key in the msi-map table.
2357 * If non-NULL, the map property must exist (-ENODEV if absent). If
2358 * ``*filter_np`` is also non-NULL, only entries targeting that node match.
2360 * @arg->args_count will be set to the number of output specifier cells
2361 * and @arg->args[0..args_count-1] will contain the translated output
2362 * specifier values. If a map entry was matched, @arg->np holds a
2366 * Convenience wrapper around of_map_id() using "msi-map", "#msi-cells",
2367 * and "msi-map-mask".
2374 return of_map_id(np, id, "msi-map", "#msi-cells", "msi-map-mask", filter_np, arg); in of_map_msi_id()