aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r--include/linux/platform_device.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 3c6675c2444b..212da17d06af 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -21,7 +21,7 @@ struct platform_device {
21 u32 num_resources; 21 u32 num_resources;
22 struct resource * resource; 22 struct resource * resource;
23 23
24 struct platform_device_id *id_entry; 24 const struct platform_device_id *id_entry;
25 25
26 /* arch specific additions */ 26 /* arch specific additions */
27 struct pdev_archdata archdata; 27 struct pdev_archdata archdata;
@@ -62,7 +62,7 @@ struct platform_driver {
62 int (*suspend)(struct platform_device *, pm_message_t state); 62 int (*suspend)(struct platform_device *, pm_message_t state);
63 int (*resume)(struct platform_device *); 63 int (*resume)(struct platform_device *);
64 struct device_driver driver; 64 struct device_driver driver;
65 struct platform_device_id *id_table; 65 const struct platform_device_id *id_table;
66}; 66};
67 67
68extern int platform_driver_register(struct platform_driver *); 68extern int platform_driver_register(struct platform_driver *);
@@ -77,12 +77,19 @@ extern int platform_driver_probe(struct platform_driver *driver,
77#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 77#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
78#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 78#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
79 79
80extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
81 int (*probe)(struct platform_device *),
82 struct resource *res, unsigned int n_res,
83 const void *data, size_t size);
84
80/* early platform driver interface */ 85/* early platform driver interface */
81struct early_platform_driver { 86struct early_platform_driver {
82 const char *class_str; 87 const char *class_str;
83 struct platform_driver *pdrv; 88 struct platform_driver *pdrv;
84 struct list_head list; 89 struct list_head list;
85 int requested_id; 90 int requested_id;
91 char *buffer;
92 int bufsize;
86}; 93};
87 94
88#define EARLY_PLATFORM_ID_UNSET -2 95#define EARLY_PLATFORM_ID_UNSET -2
@@ -102,21 +109,29 @@ extern int early_platform_driver_probe(char *class_str,
102 int nr_probe, int user_only); 109 int nr_probe, int user_only);
103extern void early_platform_cleanup(void); 110extern void early_platform_cleanup(void);
104 111
112#define early_platform_init(class_string, platdrv) \
113 early_platform_init_buffer(class_string, platdrv, NULL, 0)
105 114
106#ifndef MODULE 115#ifndef MODULE
107#define early_platform_init(class_string, platform_driver) \ 116#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
108static __initdata struct early_platform_driver early_driver = { \ 117static __initdata struct early_platform_driver early_driver = { \
109 .class_str = class_string, \ 118 .class_str = class_string, \
110 .pdrv = platform_driver, \ 119 .buffer = buf, \
120 .bufsize = bufsiz, \
121 .pdrv = platdrv, \
111 .requested_id = EARLY_PLATFORM_ID_UNSET, \ 122 .requested_id = EARLY_PLATFORM_ID_UNSET, \
112}; \ 123}; \
113static int __init early_platform_driver_setup_func(char *buf) \ 124static int __init early_platform_driver_setup_func(char *buffer) \
114{ \ 125{ \
115 return early_platform_driver_register(&early_driver, buf); \ 126 return early_platform_driver_register(&early_driver, buffer); \
116} \ 127} \
117early_param(class_string, early_platform_driver_setup_func) 128early_param(class_string, early_platform_driver_setup_func)
118#else /* MODULE */ 129#else /* MODULE */
119#define early_platform_init(class_string, platform_driver) 130#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
131static inline char *early_platform_driver_setup_func(void) \
132{ \
133 return bufsiz ? buf : NULL; \
134}
120#endif /* MODULE */ 135#endif /* MODULE */
121 136
122#endif /* _PLATFORM_DEVICE_H_ */ 137#endif /* _PLATFORM_DEVICE_H_ */