summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-04-04 00:23:37 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-04-04 00:23:37 +0300
commit97badf873ab60e841243b66133ff9eff2a46ef29 (patch)
tree3504372747c1610d89f5e3909667603beaf1a335 /include/linux/device.h
parent9017f25254e474f2cc05df489e4f83b972d3d6fd (diff)
downloadlinux-97badf873ab60e841243b66133ff9eff2a46ef29.tar.xz
device property: Make it possible to use secondary firmware nodes
Add a secondary pointer to struct fwnode_handle so as to make it possible for a device to have two firmware nodes associated with it at the same time, for example, an ACPI node and a node with a set of properties provided by platform initialization code. In the future that will allow device property lookup to fall back from the primary firmware node to the secondary one if the given property is not present there to make it easier to provide defaults for device properties used by device drivers. Introduce two helper routines, set_primary_fwnode() and set_secondary_fwnode() allowing callers to add a primary/secondary firmware node to the given device in such a way that (1) If there's only one firmware node for that device, it will be pointed to by the device's firmware node pointer. (2) If both the primary and secondary firmware nodes are present, the primary one will be pointed to by the device's firmware node pointer, while the secondary one will be pointed to by the primary node's secondary pointer. (3) If one of these nodes is removed (by calling one of the new nelpers with NULL as the second argument), the other one will be preserved. Make ACPI use set_primary_fwnode() for attaching its firmware nodes to devices. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index badef20b876a..324d02add7b4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -940,6 +940,9 @@ extern void unlock_device_hotplug(void);
extern int lock_device_hotplug_sysfs(void);
extern int device_offline(struct device *dev);
extern int device_online(struct device *dev);
+extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
+extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
+
/*
* Root device objects for grouping under /sys/devices
*/