diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-05-01 02:19:07 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-07-19 23:10:22 -0400 |
commit | 76c1ce7870fd9b05431da1bbd47fdafcc029a25b (patch) | |
tree | 349971fadc4ae331bf70d862566f1de39cb3a24d /include/linux | |
parent | 9a79b2274186fade17134929d4f85b70d59a3840 (diff) |
Split out common parts of prom.h
This creates linux/of.h and includes asm/prom.h from it.
We also include linux/of.h from asm/prom.h while we transition.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/of.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h new file mode 100644 index 000000000000..47734ffd9745 --- /dev/null +++ b/include/linux/of.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #ifndef _LINUX_OF_H | ||
2 | #define _LINUX_OF_H | ||
3 | /* | ||
4 | * Definitions for talking to the Open Firmware PROM on | ||
5 | * Power Macintosh and other computers. | ||
6 | * | ||
7 | * Copyright (C) 1996-2005 Paul Mackerras. | ||
8 | * | ||
9 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | ||
10 | * Updates for SPARC64 by David S. Miller | ||
11 | * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp. | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version | ||
16 | * 2 of the License, or (at your option) any later version. | ||
17 | */ | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | #include <asm/bitops.h> | ||
21 | #include <asm/prom.h> | ||
22 | |||
23 | /* flag descriptions */ | ||
24 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
25 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | ||
26 | |||
27 | #define OF_BAD_ADDR ((u64)-1) | ||
28 | |||
29 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
30 | const char *name); | ||
31 | #define for_each_node_by_name(dn, name) \ | ||
32 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
33 | dn = of_find_node_by_name(dn, name)) | ||
34 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
35 | const char *type); | ||
36 | #define for_each_node_by_type(dn, type) \ | ||
37 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
38 | dn = of_find_node_by_type(dn, type)) | ||
39 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
40 | const char *type, const char *compat); | ||
41 | #define for_each_compatible_node(dn, type, compatible) \ | ||
42 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | ||
43 | dn = of_find_compatible_node(dn, type, compatible)) | ||
44 | extern struct device_node *of_find_node_by_path(const char *path); | ||
45 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
46 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
47 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
48 | struct device_node *prev); | ||
49 | extern struct property *of_find_property(const struct device_node *np, | ||
50 | const char *name, | ||
51 | int *lenp); | ||
52 | extern int of_device_is_compatible(const struct device_node *device, | ||
53 | const char *); | ||
54 | extern const void *of_get_property(const struct device_node *node, | ||
55 | const char *name, | ||
56 | int *lenp); | ||
57 | #define get_property(a, b, c) of_get_property((a), (b), (c)) | ||
58 | extern int of_n_addr_cells(struct device_node *np); | ||
59 | extern int of_n_size_cells(struct device_node *np); | ||
60 | |||
61 | #endif /* _LINUX_OF_H */ | ||