stm32: migrate clock structs in include/stm32_rcc.h
[oweals/u-boot.git] / include / dm / of_access.h
index d2827001e2be7e211a572594ac1e00199962c66b..c49d287dd6004d9727398d734129c16dbb784139 100644 (file)
@@ -60,6 +60,26 @@ int of_n_addr_cells(const struct device_node *np);
  */
 int of_n_size_cells(const struct device_node *np);
 
+/**
+ * of_simple_addr_cells() - Get the address cells property in a node
+ *
+ * This function matches fdt_address_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #address-cells property in this node, or 2 if none
+ */
+int of_simple_addr_cells(const struct device_node *np);
+
+/**
+ * of_simple_size_cells() - Get the size cells property in a node
+ *
+ * This function matches fdt_size_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #size-cells property in this node, or 2 if none
+ */
+int of_simple_size_cells(const struct device_node *np);
+
 /**
  * of_find_property() - find a property in a node
  *
@@ -332,6 +352,24 @@ int of_parse_phandle_with_args(const struct device_node *np,
                               const char *list_name, const char *cells_name,
                               int index, struct of_phandle_args *out_args);
 
+/**
+ * of_count_phandle_with_args() - Count the number of phandle in a list
+ *
+ * @np:                pointer to a 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 found, -ENOENT if
+ *     @list_name does not exist, -EINVAL if a phandle was not found,
+ *     @cells_name could not be found, the arguments were truncated or there
+ *     were too many arguments.
+ *
+ * Returns number of phandle found on success, on error returns appropriate
+ * errno value.
+ *
+ */
+int of_count_phandle_with_args(const struct device_node *np,
+                              const char *list_name, const char *cells_name);
+
 /**
  * of_alias_scan() - Scan all properties of the 'aliases' node
  *