diff options
author | Nathan Fontenot <nfont@linux.vnet.ibm.com> | 2012-10-02 12:57:57 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 20:56:41 -0500 |
commit | 1cf3d8b3d24cd383ddfd5442c83ec5c355ffc2f7 (patch) | |
tree | 0f4790e95f917c6b76d95c88b7b3d67445261893 /include/linux/of.h | |
parent | f59497208363f3dd9d62b79b7f7eafc95432de79 (diff) |
powerpc+of: Add of node/property notification chain for adds and removes
This patch moves the notification chain for updates to the device tree
from the powerpc/pseries code to the base OF code. This makes this
functionality available to all architectures.
Additionally the notification chain is updated to allow notifications
for property add/remove/update. To make this work a pointer to a new
struct (of_prop_reconfig) is passed to the routines in the notification chain.
The of_prop_reconfig property contains a pointer to the node containing the
property and a pointer to the property itself. In the case of property
updates, the property pointer refers to the new property.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 72843b72a2b2..fb5d87b66e3e 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/mod_devicetable.h> | 22 | #include <linux/mod_devicetable.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/topology.h> | 24 | #include <linux/topology.h> |
25 | #include <linux/notifier.h> | ||
25 | 26 | ||
26 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
27 | #include <asm/errno.h> | 28 | #include <asm/errno.h> |
@@ -272,11 +273,24 @@ extern int prom_remove_property(struct device_node *np, struct property *prop); | |||
272 | extern int prom_update_property(struct device_node *np, | 273 | extern int prom_update_property(struct device_node *np, |
273 | struct property *newprop); | 274 | struct property *newprop); |
274 | 275 | ||
275 | #if defined(CONFIG_OF_DYNAMIC) | ||
276 | /* For updating the device tree at runtime */ | 276 | /* For updating the device tree at runtime */ |
277 | extern void of_attach_node(struct device_node *); | 277 | #define OF_RECONFIG_ATTACH_NODE 0x0001 |
278 | extern void of_detach_node(struct device_node *); | 278 | #define OF_RECONFIG_DETACH_NODE 0x0002 |
279 | #endif | 279 | #define OF_RECONFIG_ADD_PROPERTY 0x0003 |
280 | #define OF_RECONFIG_REMOVE_PROPERTY 0x0004 | ||
281 | #define OF_RECONFIG_UPDATE_PROPERTY 0x0005 | ||
282 | |||
283 | struct of_prop_reconfig { | ||
284 | struct device_node *dn; | ||
285 | struct property *prop; | ||
286 | }; | ||
287 | |||
288 | extern int of_reconfig_notifier_register(struct notifier_block *); | ||
289 | extern int of_reconfig_notifier_unregister(struct notifier_block *); | ||
290 | extern int of_reconfig_notify(unsigned long, void *); | ||
291 | |||
292 | extern int of_attach_node(struct device_node *); | ||
293 | extern int of_detach_node(struct device_node *); | ||
280 | 294 | ||
281 | #define of_match_ptr(_ptr) (_ptr) | 295 | #define of_match_ptr(_ptr) (_ptr) |
282 | 296 | ||