summaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-10-25 22:51:48 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-10-25 22:51:48 +0100
commitab736d7dc17e681be001648607be20c549b6229c (patch)
tree1bdb29dd23105897329c3b796f2e88877ef6d8b8 /include/acpi
parent32b88194f71d6ae7768a29f87fbba454728273ee (diff)
parent205ad97fc5a6386214323641dd28b822cb6fc624 (diff)
downloadlinux-stable-ab736d7dc17e681be001648607be20c549b6229c.tar.gz
linux-stable-ab736d7dc17e681be001648607be20c549b6229c.tar.bz2
linux-stable-ab736d7dc17e681be001648607be20c549b6229c.zip
Merge branch 'device-properties'
* device-properties: ACPI / property: Fix subnode lookup scope for data-only subnodes acpi-dma: Add support for "dma-names" device property device property: Add fwnode_property_match_string() ACPI / property: Extend device_get_next_child_node() to data-only nodes ACPI / gpio: Split acpi_get_gpiod_by_index() ACPI / property: Extend fwnode_property_* to data-only subnodes ACPI / property: Expose data-only subnodes via sysfs ACPI / property: Add support for data-only subnodes ACPI / property: Add routine for extraction of _DSD properties
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 5ba8fb64f664..e234725eadc7 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -343,6 +343,7 @@ struct acpi_device_data {
const union acpi_object *pointer;
const union acpi_object *properties;
const union acpi_object *of_compatible;
+ struct list_head subnodes;
};
struct acpi_gpio_mapping;
@@ -378,6 +379,17 @@ struct acpi_device {
void (*remove)(struct acpi_device *);
};
+/* Non-device subnode */
+struct acpi_data_node {
+ const char *name;
+ acpi_handle handle;
+ struct fwnode_handle fwnode;
+ struct acpi_device_data data;
+ struct list_head sibling;
+ struct kobject kobj;
+ struct completion kobj_done;
+};
+
static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
{
bool ret = false;
@@ -413,15 +425,32 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
static inline bool is_acpi_node(struct fwnode_handle *fwnode)
{
+ return fwnode && (fwnode->type == FWNODE_ACPI
+ || fwnode->type == FWNODE_ACPI_DATA);
+}
+
+static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
+{
return fwnode && fwnode->type == FWNODE_ACPI;
}
-static inline struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode)
+static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
{
- return is_acpi_node(fwnode) ?
+ return is_acpi_device_node(fwnode) ?
container_of(fwnode, struct acpi_device, fwnode) : NULL;
}
+static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
+{
+ return fwnode && fwnode->type == FWNODE_ACPI_DATA;
+}
+
+static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
+{
+ return is_acpi_data_node(fwnode) ?
+ container_of(fwnode, struct acpi_data_node, fwnode) : NULL;
+}
+
static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
{
return &adev->fwnode;