Loading drivers/of/address.c +33 −0 Original line number Diff line number Diff line Loading @@ -676,6 +676,23 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, } EXPORT_SYMBOL(of_get_address); const __be32 *of_get_address_by_name(struct device_node *dev, const char *name, u64 *size, unsigned int *flags) { int index; if (!name) return NULL; /* Try to read "reg-names" property and get the index by name */ index = of_property_match_string(dev, "reg-names", name); if (index < 0) return NULL; return of_get_address(dev, index, size, flags); } EXPORT_SYMBOL(of_get_address_by_name); static int __of_address_to_resource(struct device_node *dev, const __be32 *addrp, u64 size, unsigned int flags, const char *name, struct resource *r) Loading Loading @@ -769,6 +786,22 @@ void __iomem *of_iomap(struct device_node *np, int index) } EXPORT_SYMBOL(of_iomap); void __iomem *of_iomap_by_name(struct device_node *np, const char *name) { int index; if (!name) return NULL; /* Try to read "reg-names" property and get the index by name */ index = of_property_match_string(np, "reg-names", name); if (index < 0) return NULL; return of_iomap(np, index); } EXPORT_SYMBOL(of_iomap_by_name); /* * of_io_request_and_map - Requests a resource and maps the memory mapped IO * for a given device_node Loading include/linux/of_address.h +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ extern struct device_node *of_find_matching_node_by_address( const struct of_device_id *matches, u64 base_address); extern void __iomem *of_iomap(struct device_node *device, int index); extern void __iomem *of_iomap_by_name(struct device_node *device, const char *name); void __iomem *of_io_request_and_map(struct device_node *device, int index, const char *name); Loading @@ -46,6 +48,8 @@ void __iomem *of_io_request_and_map(struct device_node *device, */ extern const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, unsigned int *flags); extern const __be32 *of_get_address_by_name(struct device_node *dev, const char *name, u64 *size, unsigned int *flags); extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, struct device_node *node); Loading Loading
drivers/of/address.c +33 −0 Original line number Diff line number Diff line Loading @@ -676,6 +676,23 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, } EXPORT_SYMBOL(of_get_address); const __be32 *of_get_address_by_name(struct device_node *dev, const char *name, u64 *size, unsigned int *flags) { int index; if (!name) return NULL; /* Try to read "reg-names" property and get the index by name */ index = of_property_match_string(dev, "reg-names", name); if (index < 0) return NULL; return of_get_address(dev, index, size, flags); } EXPORT_SYMBOL(of_get_address_by_name); static int __of_address_to_resource(struct device_node *dev, const __be32 *addrp, u64 size, unsigned int flags, const char *name, struct resource *r) Loading Loading @@ -769,6 +786,22 @@ void __iomem *of_iomap(struct device_node *np, int index) } EXPORT_SYMBOL(of_iomap); void __iomem *of_iomap_by_name(struct device_node *np, const char *name) { int index; if (!name) return NULL; /* Try to read "reg-names" property and get the index by name */ index = of_property_match_string(np, "reg-names", name); if (index < 0) return NULL; return of_iomap(np, index); } EXPORT_SYMBOL(of_iomap_by_name); /* * of_io_request_and_map - Requests a resource and maps the memory mapped IO * for a given device_node Loading
include/linux/of_address.h +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ extern struct device_node *of_find_matching_node_by_address( const struct of_device_id *matches, u64 base_address); extern void __iomem *of_iomap(struct device_node *device, int index); extern void __iomem *of_iomap_by_name(struct device_node *device, const char *name); void __iomem *of_io_request_and_map(struct device_node *device, int index, const char *name); Loading @@ -46,6 +48,8 @@ void __iomem *of_io_request_and_map(struct device_node *device, */ extern const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, unsigned int *flags); extern const __be32 *of_get_address_by_name(struct device_node *dev, const char *name, u64 *size, unsigned int *flags); extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, struct device_node *node); Loading