diff options
author | Rob Herring <robh@kernel.org> | 2023-03-28 23:16:00 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-04-14 01:46:35 +0300 |
commit | ff61bacd77f258bd2ed145efb69e5449b115d4fe (patch) | |
tree | 66a4d268d0aa376f86b6fe023be2568a63319b72 /include/linux/of_address.h | |
parent | b50c788a56964a900ebcc817c8a5ad35ddad87b6 (diff) | |
download | linux-ff61bacd77f258bd2ed145efb69e5449b115d4fe.tar.xz |
of/address: Add of_property_read_reg() helper
Add a helper, of_property_read_reg(), to read "reg" entries untranslated
address and size. This function is intended mainly for cases with an
untranslatable "reg" address (i.e. not MMIO). There's also a few
translatable cases such as address cells containing a bus chip-select
number.
Link: https://lore.kernel.org/r/20230328-dt-address-helpers-v1-5-e2456c3e77ab@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'include/linux/of_address.h')
-rw-r--r-- | include/linux/of_address.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 5292f62c1baa..26a19daf0d09 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -72,6 +72,8 @@ void __iomem *of_io_request_and_map(struct device_node *device, extern const __be32 *__of_get_address(struct device_node *dev, int index, int bar_no, u64 *size, unsigned int *flags); +int of_property_read_reg(struct device_node *np, int idx, u64 *addr, u64 *size); + extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, struct device_node *node); extern int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, @@ -106,6 +108,11 @@ static inline const __be32 *__of_get_address(struct device_node *dev, int index, return NULL; } +static inline int of_property_read_reg(struct device_node *np, int idx, u64 *addr, u64 *size) +{ + return -ENOSYS; +} + static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser, struct device_node *node) { |