1#ifndef _LINUX_OF_PLATFORM_H
2#define _LINUX_OF_PLATFORM_H
3
4
5
6
7
8
9
10
11
12
13
14#include <linux/device.h>
15#include <linux/mod_devicetable.h>
16#include <linux/pm.h>
17#include <linux/of_device.h>
18#include <linux/platform_device.h>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42struct of_dev_auxdata {
43 char *compatible;
44 resource_size_t phys_addr;
45 char *name;
46 void *platform_data;
47};
48
49
50#define OF_DEV_AUXDATA(_compat,_phys,_name,_pdata) \
51 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
52 .platform_data = _pdata }
53
54extern const struct of_device_id of_default_bus_match_table[];
55
56
57extern struct platform_device *of_device_alloc(struct device_node *np,
58 const char *bus_id,
59 struct device *parent);
60extern struct platform_device *of_find_device_by_node(struct device_node *np);
61
62
63extern struct platform_device *of_platform_device_create(struct device_node *np,
64 const char *bus_id,
65 struct device *parent);
66
67extern int of_platform_bus_probe(struct device_node *root,
68 const struct of_device_id *matches,
69 struct device *parent);
70#ifdef CONFIG_OF_ADDRESS
71extern int of_platform_populate(struct device_node *root,
72 const struct of_device_id *matches,
73 const struct of_dev_auxdata *lookup,
74 struct device *parent);
75extern int of_platform_default_populate(struct device_node *root,
76 const struct of_dev_auxdata *lookup,
77 struct device *parent);
78extern void of_platform_depopulate(struct device *parent);
79#else
80static inline int of_platform_populate(struct device_node *root,
81 const struct of_device_id *matches,
82 const struct of_dev_auxdata *lookup,
83 struct device *parent)
84{
85 return -ENODEV;
86}
87static inline int of_platform_default_populate(struct device_node *root,
88 const struct of_dev_auxdata *lookup,
89 struct device *parent)
90{
91 return -ENODEV;
92}
93static inline void of_platform_depopulate(struct device *parent) { }
94#endif
95
96#if defined(CONFIG_OF_DYNAMIC) && defined(CONFIG_OF_ADDRESS)
97extern void of_platform_register_reconfig_notifier(void);
98#else
99static inline void of_platform_register_reconfig_notifier(void) { }
100#endif
101
102#endif
103