diff options
author | Tom Rini <trini@konsulko.com> | 2019-02-11 11:15:34 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-11 11:15:34 -0500 |
commit | f94fa0e94f36c740d3c7aa314c89a750c742185b (patch) | |
tree | 42077386d60386628bed02011566ddf990913eb8 /include/dm/read.h | |
parent | f49929772c5ea22e4af987bfb1e5ae13e9895093 (diff) | |
parent | c4bd12a7dad43ed9de3070c7c5e8b690d8c03a79 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-i2c
- DM I2C improvements
Diffstat (limited to 'include/dm/read.h')
-rw-r--r-- | include/dm/read.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/read.h b/include/dm/read.h index 389e30e7fb4..60b727cbd82 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -510,6 +510,17 @@ int dev_read_resource_byname(struct udevice *dev, const char *name, * @return the translated address; OF_BAD_ADDR on error */ u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr); + +/** + * dev_read_alias_highest_id - Get highest alias id for the given stem + * @stem: Alias stem to be examined + * + * The function travels the lookup table to get the highest alias id for the + * given alias stem. + * @return alias ID, if found, else -1 + */ +int dev_read_alias_highest_id(const char *stem); + #else /* CONFIG_DM_DEV_READ_INLINE is enabled */ static inline int dev_read_u32(struct udevice *dev, @@ -740,6 +751,11 @@ static inline u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_a return ofnode_translate_address(dev_ofnode(dev), in_addr); } +static inline int dev_read_alias_highest_id(const char *stem) +{ + return fdtdec_get_alias_highest_id(gd->fdt_blob, stem); +} + #endif /* CONFIG_DM_DEV_READ_INLINE */ /** |