diff options
Diffstat (limited to 'include/dm/ofnode.h')
| -rw-r--r-- | include/dm/ofnode.h | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 15ad5199c2f..210ddb2e5d7 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -15,6 +15,8 @@  /* Enable checks to protect against invalid calls */  #undef OF_CHECKS +struct resource; +  /**   * ofnode - reference to a device tree node   * @@ -433,6 +435,23 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,  				   struct ofnode_phandle_args *out_args);  /** + * ofnode_count_phandle_with_args() - Count number of phandle in a list + * + * This function is useful to count phandles into a list. + * Returns number of phandle on success, on error returns appropriate + * errno value. + * + * @node:	device tree node containing a list + * @list_name:	property name that contains a list + * @cells_name:	property name that specifies phandles' arguments count + * @return number of phandle on success, -ENOENT if @list_name does not + *      exist, -EINVAL if a phandle was not found, @cells_name could not + *      be found. + */ +int ofnode_count_phandle_with_args(ofnode node, const char *list_name, +				   const char *cells_name); + +/**   * ofnode_path() - find a node by full path   *   * @path: Full path to node, e.g. "/bus/spi@1" @@ -605,4 +624,6 @@ int ofnode_read_simple_size_cells(ofnode node);   */  bool ofnode_pre_reloc(ofnode node); +int ofnode_read_resource(ofnode node, uint index, struct resource *res); +  #endif | 
