summaryrefslogtreecommitdiff
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-03-28 10:52:16 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-03-29 00:00:27 +0200
commitdfa672fbc0d9e83ff0dc1a75f1f5d0e59a30706b (patch)
tree06e8d3f68a8c47487717282ed0771fbb1a9d32b6 /include/linux/acpi.h
parentc02ed2e75ef4c74e41e421acb4ef1494671585e8 (diff)
ACPI / property: Add possiblity to retrieve parent firmware node
Sometimes it is useful to be able to navigate firmware node hierarchy upwards toward parent nodes. ACPI device nodes are pretty much already supported because ACPICA provides acpi_get_parent(). ACPI data nodes, however, are all below the same parent ACPI device. Their hierarchy is created by "linking" each other using references in the value field. Add parent pointer to the parent data node while we create them so it is easy to navigate the hierarchy backwards. We use this parent pointer in a new function acpi_node_get_parent() that is able to extract parent of both ACPI firmware node types. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 9b05886f9773..e74e8bdbb6af 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -999,6 +999,7 @@ int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
struct fwnode_handle *subnode);
+struct fwnode_handle *acpi_node_get_parent(struct fwnode_handle *fwnode);
struct acpi_probe_entry;
typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
@@ -1121,6 +1122,12 @@ static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
return NULL;
}
+static inline struct fwnode_handle *
+acpi_node_get_parent(struct fwnode_handle *fwnode)
+{
+ return NULL;
+}
+
#define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, valid, data, fn) \
static const void * __acpi_table_##name[] \
__attribute__((unused)) \