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

Showing the changes to drivers (1 of 2 files). Show all

Unified · Split

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
958958 }
959959 EXPORT_SYMBOL(fwnode_irq_get);
960960
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+ */
968+void __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+}
975+EXPORT_SYMBOL(fwnode_iomap);
976+
961977 /**
962978 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node
963979 * @fwnode: Pointer to the parent firmware node

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