summaryrefslogtreecommitdiff
path: root/include/linux/of_address.h
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2014-04-24 19:30:02 +0400
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2014-05-06 02:11:13 +0400
commit18308c94723e162ed121942335bc186e66820a7a (patch)
tree48ac9d3721d820bdace974332f3925cc5dc2c02b /include/linux/of_address.h
parent8febcaa2aac184d7e729acb75e9c4b80b04ad1b9 (diff)
downloadlinux-18308c94723e162ed121942335bc186e66820a7a.tar.xz
of: introduce of_dma_get_range() helper
The of_dma_get_range() allows to find "dma-range" property for the specified device and parse it. dma-ranges format: DMA addr (dma_addr) : naddr cells CPU addr (phys_addr_t) : pna cells size : nsize cells Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Olof Johansson <olof@lixom.net> Cc: Grant Likely <grant.likely@linaro.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'include/linux/of_address.h')
-rw-r--r--include/linux/of_address.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 5f6ed6b182b8..4d7b325af2ca 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -63,6 +63,8 @@ extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
extern struct of_pci_range *of_pci_range_parser_one(
struct of_pci_range_parser *parser,
struct of_pci_range *range);
+extern int of_dma_get_range(struct device_node *np, u64 *dma_addr,
+ u64 *paddr, u64 *size);
#else /* CONFIG_OF_ADDRESS */
static inline struct device_node *of_find_matching_node_by_address(
struct device_node *from,
@@ -90,6 +92,12 @@ static inline struct of_pci_range *of_pci_range_parser_one(
{
return NULL;
}
+
+static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr,
+ u64 *paddr, u64 *size)
+{
+ return -ENODEV;
+}
#endif /* CONFIG_OF_ADDRESS */
#ifdef CONFIG_OF