Lines Matching +full:int +full:- +full:property
3 * Copyright (C) 1996-2005 Paul Mackerras.
12 * Modified for U-Boot
15 * SPDX-License-Identifier: GPL-2.0+
24 * of_find_all_nodes - Get next node in global list
37 /* Dummy functions to mirror Linux. These are not used in U-Boot */
42 * of_n_addr_cells() - Get the number of address cells for a node
44 * This walks back up the tree to find the closest #address-cells property
50 int of_n_addr_cells(const struct device_node *np);
53 * of_n_size_cells() - Get the number of size cells for a node
55 * This walks back up the tree to find the closest #size-cells property
61 int of_n_size_cells(const struct device_node *np);
64 * of_simple_addr_cells() - Get the address cells property in a node
69 * @return value of #address-cells property in this node, or 2 if none
71 int of_simple_addr_cells(const struct device_node *np);
74 * of_simple_size_cells() - Get the size cells property in a node
79 * @return value of #size-cells property in this node, or 2 if none
81 int of_simple_size_cells(const struct device_node *np);
84 * of_find_property() - find a property in a node
86 * @np: Pointer to device node holding property
87 * @name: Name of property
88 * @lenp: If non-NULL, returns length of property
89 * @return pointer to property, or NULL if not found
91 struct property *of_find_property(const struct device_node *np,
92 const char *name, int *lenp);
95 * of_get_property() - get a property value
97 * Find a property with a given name for a given node and return the value.
99 * @np: Pointer to device node holding property
100 * @name: Name of property
101 * @lenp: If non-NULL, returns length of property
102 * @return pointer to property value, or NULL if not found
105 int *lenp);
108 * of_get_first_property()- get to the pointer of the first property
110 * Get pointer to the first property of the node, it is used to iterate
111 * and read all the property with of_get_next_property_by_prop().
114 * @return pointer to property or NULL if not found
116 const struct property *of_get_first_property(const struct device_node *np);
119 * of_get_next_property() - get to the pointer of the next property
121 * Get pointer to the next property of the node, it is used to iterate
122 * and read all the property with of_get_property_by_prop().
125 * @property: pointer of the current property
126 * @return pointer to next property or NULL if not found
128 const struct property *of_get_next_property(const struct device_node *np,
129 const struct property *property);
132 * of_get_property_by_prop() - get a property value of a node property
134 * Get value for the property identified by node and property pointer.
137 * @property: pointer of the property to read
138 * @propname: place to property name on success
140 * @return pointer to property value or NULL if error
143 const struct property *property,
145 int *lenp);
148 * of_device_is_compatible() - Check if the node matches given constraints
177 int of_device_is_compatible(const struct device_node *np, const char *compat,
181 * of_device_is_available() - check if a device is available for use
185 * @return true if the status property is absent or set to "okay", false
191 * of_get_parent() - Get a node's parent, if any
199 * of_find_node_opts_by_path() - Find a node matching a full OF path
202 * '/', the name of a property of the /aliases node (an alias). In the
223 * of_find_compatible_node() - find a node based on its compatible string
225 * Find a node based on type and one of the tokens in its "compatible" property
238 * of_find_node_by_phandle() - Find a node given a phandle
247 * of_read_u32() - Find and read a 32-bit integer from a property
249 * Search for a property in a device node and read a 32-bit value from
252 * @np: device node from which the property value is to be read.
253 * @propname: name of the property to be searched.
256 * @return 0 on success, -EINVAL if the property does not exist,
257 * -ENODATA if property does not have a value, and -EOVERFLOW if the
258 * property data isn't large enough.
260 int of_read_u32(const struct device_node *np, const char *propname, u32 *outp);
263 * of_property_read_u64 - Find and read a 64 bit integer from a property
264 * @np: device node from which the property value is to be read.
265 * @propname: name of the property to be searched.
268 * Search for a property in a device node and read a 64-bit value from
269 * it. Returns 0 on success, -EINVAL if the property does not exist,
270 * -ENODATA if property does not have a value, and -EOVERFLOW if the
271 * property data isn't large enough.
275 int of_property_read_u64(const struct device_node *np, const char *propname,
279 * of_read_u32_array() - Find and read an array of 32 bit integers
281 * Search for a property in a device node and read 32-bit value(s) from
284 * @np: device node from which the property value is to be read.
285 * @propname: name of the property to be searched.
288 * @return 0 on success, -EINVAL if the property does not exist, -ENODATA
289 * if property does not have a value, and -EOVERFLOW is longer than sz.
291 int of_read_u32_array(const struct device_node *np, const char *propname,
295 * of_write_u32_array() - Find and write an array of 32 bit integers
297 * Search for a property in a device node and write 32-bit value(s) to
300 * @np: device node from which the property value is to be read.
301 * @propname: name of the property to be searched.
304 * @return 0 on success, -EINVAL if the property does not exist, -ENODATA
305 * if property does not have a value, and -EOVERFLOW is longer than sz.
307 int of_write_u32_array(const struct device_node *np, const char *propname,
311 * of_property_match_string() - Find string in a list and return index
313 * This function searches a string list property and returns the index
316 * @np: pointer to node containing string list property
317 * @propname: string list property name
319 * @return 0 on success, -EINVAL if the property does not exist, -ENODATA
320 * if property does not have a value, and -EOVERFLOW is longer than sz.
322 int of_property_match_string(const struct device_node *np, const char *propname,
325 int of_property_read_string_helper(const struct device_node *np,
327 size_t sz, int index);
330 * of_property_read_string_index() - Find and read a string from a multiple
331 * strings property.
332 * @np: device node from which the property value is to be read.
333 * @propname: name of the property to be searched.
338 * Search for a property in a device tree node and retrieve a null
340 * contained in that property.
341 * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
342 * property does not have a value, and -EILSEQ if the string is not
343 * null-terminated within the length of the property data.
347 static inline int of_property_read_string_index(const struct device_node *np, in of_property_read_string_index()
349 int index, const char **output) in of_property_read_string_index()
351 int rc = of_property_read_string_helper(np, propname, output, 1, index); in of_property_read_string_index()
356 * of_property_count_strings() - Find and return the number of strings from a
357 * multiple strings property.
358 * @np: device node from which the property value is to be read.
359 * @propname: name of the property to be searched.
361 * Search for a property in a device tree node and retrieve the number of null
363 * success, -EINVAL if the property does not exist, -ENODATA if property
364 * does not have a value, and -EILSEQ if the string is not null-terminated
365 * within the length of the property data.
367 static inline int of_property_count_strings(const struct device_node *np, in of_property_count_strings()
374 * of_parse_phandle - Resolve a phandle property to a device_node pointer
375 * @np: Pointer to device node holding phandle property
376 * @phandle_name: Name of property holding a phandle value
384 const char *phandle_name, int index);
387 * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
390 * @list_name: property name that contains a list
391 * @cells_name: property name that specifies phandles' arguments count
394 * @return 0 on success (with @out_args filled out if not NULL), -ENOENT if
395 * @list_name does not exist, -EINVAL if a phandle was not found,
403 * Caller is responsible to call of_node_put() on the returned out_args->np
409 * #list-cells = <2>;
413 * #list-cells = <1>;
421 * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
423 int of_parse_phandle_with_args(const struct device_node *np,
425 int index, struct of_phandle_args *out_args);
428 * of_count_phandle_with_args() - Count the number of phandle in a list
431 * @list_name: property name that contains a list
432 * @cells_name: property name that specifies phandles' arguments count
433 * @return number of phandle found, -ENOENT if
434 * @list_name does not exist, -EINVAL if a phandle was not found,
442 int of_count_phandle_with_args(const struct device_node *np,
446 * of_alias_scan() - Scan all properties of the 'aliases' node
452 * @return 9 if OK, -ENOMEM if not enough memory
454 int of_alias_scan(void);
457 * of_alias_get_id - Get alias id for the given device_node
464 * @return alias ID, if found, else -ENODEV
466 int of_alias_get_id(const struct device_node *np, const char *stem);
469 * of_alias_get_dev - Get device_node by given stem and alias id
477 struct device_node *of_alias_get_dev(const char *stem, int id);
480 * of_alias_dump - Dump of alias nodes added in aliases_lookup.
485 * of_get_stdout() - Get node to use for stdout
487 * @return node referred to by stdout-path alias, or NULL if none