aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_device.h
diff options
context:
space:
mode:
authorFelix Blyakher <felixb@sgi.com>2009-06-10 18:07:47 -0400
committerFelix Blyakher <felixb@sgi.com>2009-06-10 18:07:47 -0400
commit4e73e0eb633f8a1b5cbf20e7f42c6dbfec1d1ca7 (patch)
tree0cea46e43f0625244c3d06a71d6559e5ec5419ca /include/linux/platform_device.h
parent4156e735d3abde8e9243b5d22f7999dd3fffab2e (diff)
parent07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r--include/linux/platform_device.h43
1 files changed, 42 insertions, 1 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 76e470a299bf..b67bb5d7b221 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -20,7 +20,6 @@ struct platform_device {
20 struct device dev; 20 struct device dev;
21 u32 num_resources; 21 u32 num_resources;
22 struct resource * resource; 22 struct resource * resource;
23 void *platform_data;
24 23
25 struct platform_device_id *id_entry; 24 struct platform_device_id *id_entry;
26}; 25};
@@ -77,4 +76,46 @@ extern int platform_driver_probe(struct platform_driver *driver,
77#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 76#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
78#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 77#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
79 78
79/* early platform driver interface */
80struct early_platform_driver {
81 const char *class_str;
82 struct platform_driver *pdrv;
83 struct list_head list;
84 int requested_id;
85};
86
87#define EARLY_PLATFORM_ID_UNSET -2
88#define EARLY_PLATFORM_ID_ERROR -3
89
90extern int early_platform_driver_register(struct early_platform_driver *epdrv,
91 char *buf);
92extern void early_platform_add_devices(struct platform_device **devs, int num);
93
94static inline int is_early_platform_device(struct platform_device *pdev)
95{
96 return !pdev->dev.driver;
97}
98
99extern void early_platform_driver_register_all(char *class_str);
100extern int early_platform_driver_probe(char *class_str,
101 int nr_probe, int user_only);
102extern void early_platform_cleanup(void);
103
104
105#ifndef MODULE
106#define early_platform_init(class_string, platform_driver) \
107static __initdata struct early_platform_driver early_driver = { \
108 .class_str = class_string, \
109 .pdrv = platform_driver, \
110 .requested_id = EARLY_PLATFORM_ID_UNSET, \
111}; \
112static int __init early_platform_driver_setup_func(char *buf) \
113{ \
114 return early_platform_driver_register(&early_driver, buf); \
115} \
116early_param(class_string, early_platform_driver_setup_func)
117#else /* MODULE */
118#define early_platform_init(class_string, platform_driver)
119#endif /* MODULE */
120
80#endif /* _PLATFORM_DEVICE_H_ */ 121#endif /* _PLATFORM_DEVICE_H_ */