summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-10-06 13:59:01 -0400
committerTom Rini <[email protected]>2020-10-06 13:59:01 -0400
commit42378e3cd2432e0353cdcc1789039293e4b46252 (patch)
tree0d7f41a9e50432c32aca3cd7e611cfea70f9efc4 /include/dm
parent5dcf7cc590b348f1e730ec38242df64c179f10a8 (diff)
parent175e8322bcee64127a24acdac12c54f5ddb95f82 (diff)
Merge tag 'dm-pull-6oct20' of git://git.denx.de/u-boot-dm
bloblist enhancement for alignment Update ofnode/dev_read phandle function sandbox keyboard enhancements and fixes
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/of_access.h4
-rw-r--r--include/dm/ofnode.h12
-rw-r--r--include/dm/read.h8
3 files changed, 15 insertions, 9 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h
index 2fa65c9332e..cc382b1671c 100644
--- a/include/dm/of_access.h
+++ b/include/dm/of_access.h
@@ -450,6 +450,7 @@ int of_parse_phandle_with_args(const struct device_node *np,
* @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
+ * @cells_count: Cell count to use if @cells_name is NULL
* @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
@@ -460,7 +461,8 @@ int of_parse_phandle_with_args(const struct device_node *np,
*
*/
int of_count_phandle_with_args(const struct device_node *np,
- const char *list_name, const char *cells_name);
+ const char *list_name, const char *cells_name,
+ int cells_count);
/**
* of_alias_scan() - Scan all properties of the 'aliases' node
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 8df2facf998..4b7af370560 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -10,6 +10,7 @@
/* TODO([email protected]): Drop fdtdec.h include */
#include <fdtdec.h>
#include <dm/of.h>
+#include <log.h>
/* Enable checks to protect against invalid calls */
#undef OF_CHECKS
@@ -84,7 +85,7 @@ struct ofprop {
};
/**
- * _ofnode_to_np() - convert an ofnode to a live DT node pointer
+ * ofnode_to_np() - convert an ofnode to a live DT node pointer
*
* This cannot be called if the reference contains an offset.
*
@@ -127,7 +128,7 @@ static inline bool ofnode_valid(ofnode node)
if (of_live_active())
return node.np != NULL;
else
- return node.of_offset != -1;
+ return node.of_offset >= 0;
}
/**
@@ -182,8 +183,8 @@ static inline bool ofnode_is_np(ofnode node)
* live tree is in use.
*/
assert(!ofnode_valid(node) ||
- (of_live_active() ? _ofnode_to_np(node)
- : _ofnode_to_np(node)));
+ (of_live_active() ? ofnode_to_np(node)
+ : ofnode_to_np(node)));
#endif
return of_live_active() && ofnode_valid(node);
}
@@ -555,12 +556,13 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
* @node: device tree node containing a list
* @list_name: property name that contains a list
* @cells_name: property name that specifies phandles' arguments count
+ * @cells_count: Cell count to use if @cells_name is NULL
* @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);
+ const char *cells_name, int cell_count);
/**
* ofnode_path() - find a node by full path
diff --git a/include/dm/read.h b/include/dm/read.h
index 67db94adfc1..0585eb12281 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -429,12 +429,14 @@ int dev_read_phandle_with_args(const struct udevice *dev, const char *list_name,
* @dev: device whose node containing a list
* @list_name: property name that contains a list
* @cells_name: property name that specifies phandles' arguments count
+ * @cells_count: Cell count to use if @cells_name is NULL
* @Returns number of phandle found on success, on error returns appropriate
* errno value.
*/
int dev_count_phandle_with_args(const struct udevice *dev,
- const char *list_name, const char *cells_name);
+ const char *list_name, const char *cells_name,
+ int cell_count);
/**
* dev_read_addr_cells() - Get the number of address cells for a device's node
@@ -880,10 +882,10 @@ static inline int dev_read_phandle_with_args(const struct udevice *dev,
}
static inline int dev_count_phandle_with_args(const struct udevice *dev,
- const char *list_name, const char *cells_name)
+ const char *list_name, const char *cells_name, int cell_count)
{
return ofnode_count_phandle_with_args(dev_ofnode(dev), list_name,
- cells_name);
+ cells_name, cell_count);
}
static inline int dev_read_addr_cells(const struct udevice *dev)