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/asm-powerpc | |
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/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/prom.h | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 1632baa17dc6..1134aeab2327 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -97,10 +97,6 @@ struct device_node { | |||
97 | 97 | ||
98 | extern struct device_node *of_chosen; | 98 | extern struct device_node *of_chosen; |
99 | 99 | ||
100 | /* flag descriptions */ | ||
101 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
102 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | ||
103 | |||
104 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 100 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
105 | { | 101 | { |
106 | return test_bit(flag, &n->_flags); | 102 | return test_bit(flag, &n->_flags); |
@@ -120,31 +116,7 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e | |||
120 | } | 116 | } |
121 | 117 | ||
122 | 118 | ||
123 | /* New style node lookup */ | ||
124 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
125 | const char *name); | ||
126 | #define for_each_node_by_name(dn, name) \ | ||
127 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
128 | dn = of_find_node_by_name(dn, name)) | ||
129 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
130 | const char *type); | ||
131 | #define for_each_node_by_type(dn, type) \ | ||
132 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
133 | dn = of_find_node_by_type(dn, type)) | ||
134 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
135 | const char *type, const char *compat); | ||
136 | #define for_each_compatible_node(dn, type, compatible) \ | ||
137 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | ||
138 | dn = of_find_compatible_node(dn, type, compatible)) | ||
139 | extern struct device_node *of_find_node_by_path(const char *path); | ||
140 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
141 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | 119 | extern struct device_node *of_find_all_nodes(struct device_node *prev); |
142 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
143 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
144 | struct device_node *prev); | ||
145 | extern struct property *of_find_property(const struct device_node *np, | ||
146 | const char *name, | ||
147 | int *lenp); | ||
148 | extern struct device_node *of_node_get(struct device_node *node); | 120 | extern struct device_node *of_node_get(struct device_node *node); |
149 | extern void of_node_put(struct device_node *node); | 121 | extern void of_node_put(struct device_node *node); |
150 | 122 | ||
@@ -166,17 +138,9 @@ extern void of_detach_node(const struct device_node *); | |||
166 | extern void finish_device_tree(void); | 138 | extern void finish_device_tree(void); |
167 | extern void unflatten_device_tree(void); | 139 | extern void unflatten_device_tree(void); |
168 | extern void early_init_devtree(void *); | 140 | extern void early_init_devtree(void *); |
169 | extern int of_device_is_compatible(const struct device_node *device, | ||
170 | const char *); | ||
171 | #define device_is_compatible(d, c) of_device_is_compatible((d), (c)) | 141 | #define device_is_compatible(d, c) of_device_is_compatible((d), (c)) |
172 | extern int machine_is_compatible(const char *compat); | 142 | extern int machine_is_compatible(const char *compat); |
173 | extern const void *of_get_property(const struct device_node *node, | ||
174 | const char *name, | ||
175 | int *lenp); | ||
176 | #define get_property(a, b, c) of_get_property((a), (b), (c)) | ||
177 | extern void print_properties(struct device_node *node); | 143 | extern void print_properties(struct device_node *node); |
178 | extern int of_n_addr_cells(struct device_node* np); | ||
179 | extern int of_n_size_cells(struct device_node* np); | ||
180 | extern int prom_n_intr_cells(struct device_node* np); | 144 | extern int prom_n_intr_cells(struct device_node* np); |
181 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | 145 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); |
182 | extern int prom_add_property(struct device_node* np, struct property* prop); | 146 | extern int prom_add_property(struct device_node* np, struct property* prop); |
@@ -230,7 +194,6 @@ static inline unsigned long of_read_ulong(const u32 *cell, int size) | |||
230 | 194 | ||
231 | /* Translate an OF address block into a CPU physical address | 195 | /* Translate an OF address block into a CPU physical address |
232 | */ | 196 | */ |
233 | #define OF_BAD_ADDR ((u64)-1) | ||
234 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | 197 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); |
235 | 198 | ||
236 | /* Extract an address from a device, returns the region size and | 199 | /* Extract an address from a device, returns the region size and |
@@ -357,5 +320,11 @@ extern int of_irq_to_resource(struct device_node *dev, int index, | |||
357 | */ | 320 | */ |
358 | extern void __iomem *of_iomap(struct device_node *device, int index); | 321 | extern void __iomem *of_iomap(struct device_node *device, int index); |
359 | 322 | ||
323 | /* | ||
324 | * NB: This is here while we transition from using asm/prom.h | ||
325 | * to linux/of.h | ||
326 | */ | ||
327 | #include <linux/of.h> | ||
328 | |||
360 | #endif /* __KERNEL__ */ | 329 | #endif /* __KERNEL__ */ |
361 | #endif /* _POWERPC_PROM_H */ | 330 | #endif /* _POWERPC_PROM_H */ |