History

device property: Add fwnode_iomap()

This patch introduces a new helper routine - fwnode_iomap(), which allows to map the memory mapped IO for a given device node. This implementation does not cover the ACPI case and may be expanded in the future. The main purpose here is to be able to develop resource provider agnostic drivers.

Anand Ashok Dumbre committed 4 years ago

Commit eca6e2d1 parent 8ebbfb92 files · +18 −0Browse files

Unified · Split

2 files
  1. drivers/base/property.c +16 −0
  2. include/linux/property.h +2 −0
drivers/base/property.c+16−0
@@ -958,6 +958,22 @@ int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index) · 957 unmodified lines
958}958}
959EXPORT_SYMBOL(fwnode_irq_get);959EXPORT_SYMBOL(fwnode_irq_get);
960 960
961/**
962 * fwnode_iomap - Maps the memory mapped IO for a given fwnode
963 * @fwnode: Pointer to the firmware node
964 * @index: Index of the IO range
965 *
966 * Returns a pointer to the mapped memory.
967 */
968void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index)
969{
970 if (IS_ENABLED(CONFIG_OF_ADDRESS) && is_of_node(fwnode))
971 return of_iomap(to_of_node(fwnode), index);
972
973 return NULL;
974}
975EXPORT_SYMBOL(fwnode_iomap);
976
961/**977/**
962 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node978 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node
963 * @fwnode: Pointer to the parent firmware node979 * @fwnode: Pointer to the parent firmware node
include/linux/property.h+2−0
@@ -122,6 +122,8 @@ void fwnode_handle_put(struct fwnode_handle *fwnode); · 121 unmodified lines
122 122
123int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);123int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);
124 124
125void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index);
126
125unsigned int device_get_child_node_count(struct device *dev);127unsigned int device_get_child_node_count(struct device *dev);
126 128
127static inline bool device_property_read_bool(struct device *dev,129static inline bool device_property_read_bool(struct device *dev,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t