diff options
author | Tom Rini <trini@konsulko.com> | 2019-09-08 21:14:22 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-09-08 21:15:13 -0400 |
commit | 40e362a9ab5f1d409822942ee89d4473c2e01ee6 (patch) | |
tree | ad63f4fdcc210a0a758e41528fb2f15ecedf6a31 /include/dm/read.h | |
parent | 2f760735c170c854ffca76be5607cec5c56fdc4f (diff) | |
parent | cd45d6f3955c919b7f10793014db3dbcfd7df3bb (diff) | |
download | u-boot-WIP/08Sep2019.tar.gz |
Merge tag 'mmc-9-6-2019' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcWIP/08Sep2019
Bug fixes to mmc_spi
Add Aspeed SD driver
Fix dw_mmc timeout calculation
Fix timeout values passed to mmc_wait_dat0
sdhci dt caps/mask update
[trini: Fix evb-ast2500_defconfig CONFIG_MMC line]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/dm/read.h')
-rw-r--r-- | include/dm/read.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/dm/read.h b/include/dm/read.h index 0c62d62f11..803daf7620 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -44,6 +44,7 @@ static inline bool dev_of_valid(struct udevice *dev) } #ifndef CONFIG_DM_DEV_READ_INLINE + /** * dev_read_u32() - read a 32-bit integer from a device's DT property * @@ -97,6 +98,26 @@ int dev_read_s32_default(struct udevice *dev, const char *propname, int def); int dev_read_u32u(struct udevice *dev, const char *propname, uint *outp); /** + * dev_read_u64() - read a 64-bit integer from a device's DT property + * + * @dev: device to read DT property from + * @propname: name of the property to read from + * @outp: place to put value (if found) + * @return 0 if OK, -ve on error + */ +int dev_read_u64(struct udevice *dev, const char *propname, u64 *outp); + +/** + * dev_read_u64_default() - read a 64-bit integer from a device's DT property + * + * @dev: device to read DT property from + * @propname: name of the property to read from + * @def: default value to return if the property has no value + * @return property value, or @def if not found + */ +u64 dev_read_u64_default(struct udevice *dev, const char *propname, u64 def); + +/** * dev_read_string() - Read a string from a device's DT property * * @dev: device to read DT property from @@ -601,6 +622,18 @@ static inline int dev_read_u32u(struct udevice *dev, return 0; } +static inline int dev_read_u64(struct udevice *dev, + const char *propname, u64 *outp) +{ + return ofnode_read_u64(dev_ofnode(dev), propname, outp); +} + +static inline u64 dev_read_u64_default(struct udevice *dev, + const char *propname, u64 def) +{ + return ofnode_read_u64_default(dev_ofnode(dev), propname, def); +} + static inline const char *dev_read_string(struct udevice *dev, const char *propname) { |