diff options
Diffstat (limited to 'include/linux/platform_device.h')
| -rw-r--r-- | include/linux/platform_device.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 76e470a299bf..72736fd8223c 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -77,4 +77,46 @@ 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 | ||
| 80 | /* early platform driver interface */ | ||
| 81 | struct early_platform_driver { | ||
| 82 | const char *class_str; | ||
| 83 | struct platform_driver *pdrv; | ||
| 84 | struct list_head list; | ||
| 85 | int requested_id; | ||
| 86 | }; | ||
| 87 | |||
| 88 | #define EARLY_PLATFORM_ID_UNSET -2 | ||
| 89 | #define EARLY_PLATFORM_ID_ERROR -3 | ||
| 90 | |||
| 91 | extern int early_platform_driver_register(struct early_platform_driver *epdrv, | ||
| 92 | char *buf); | ||
| 93 | extern void early_platform_add_devices(struct platform_device **devs, int num); | ||
| 94 | |||
| 95 | static inline int is_early_platform_device(struct platform_device *pdev) | ||
| 96 | { | ||
| 97 | return !pdev->dev.driver; | ||
| 98 | } | ||
| 99 | |||
| 100 | extern void early_platform_driver_register_all(char *class_str); | ||
| 101 | extern int early_platform_driver_probe(char *class_str, | ||
| 102 | int nr_probe, int user_only); | ||
| 103 | extern void early_platform_cleanup(void); | ||
| 104 | |||
| 105 | |||
| 106 | #ifndef MODULE | ||
| 107 | #define early_platform_init(class_string, platform_driver) \ | ||
| 108 | static __initdata struct early_platform_driver early_driver = { \ | ||
| 109 | .class_str = class_string, \ | ||
| 110 | .pdrv = platform_driver, \ | ||
| 111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | ||
| 112 | }; \ | ||
| 113 | static int __init early_platform_driver_setup_func(char *buf) \ | ||
| 114 | { \ | ||
| 115 | return early_platform_driver_register(&early_driver, buf); \ | ||
| 116 | } \ | ||
| 117 | early_param(class_string, early_platform_driver_setup_func) | ||
| 118 | #else /* MODULE */ | ||
| 119 | #define early_platform_init(class_string, platform_driver) | ||
| 120 | #endif /* MODULE */ | ||
| 121 | |||
| 80 | #endif /* _PLATFORM_DEVICE_H_ */ | 122 | #endif /* _PLATFORM_DEVICE_H_ */ |
