xref: /openbmc/linux/drivers/base/base.h (revision f86db396)
1a1bdc7aaSBen Dooks 
2a1bdc7aaSBen Dooks /* initialisation functions */
3a1bdc7aaSBen Dooks 
4a1bdc7aaSBen Dooks extern int devices_init(void);
5a1bdc7aaSBen Dooks extern int buses_init(void);
6a1bdc7aaSBen Dooks extern int classes_init(void);
7a1bdc7aaSBen Dooks extern int firmware_init(void);
84039483fSMichael Holzheu #ifdef CONFIG_SYS_HYPERVISOR
94039483fSMichael Holzheu extern int hypervisor_init(void);
104039483fSMichael Holzheu #else
114039483fSMichael Holzheu static inline int hypervisor_init(void) { return 0; }
124039483fSMichael Holzheu #endif
13a1bdc7aaSBen Dooks extern int platform_bus_init(void);
14a1bdc7aaSBen Dooks extern int system_bus_init(void);
15a1bdc7aaSBen Dooks extern int cpu_dev_init(void);
16a1bdc7aaSBen Dooks extern int attribute_container_init(void);
17a1bdc7aaSBen Dooks 
181da177e4SLinus Torvalds extern int bus_add_device(struct device * dev);
19f86db396SAndrew Morton extern int bus_attach_device(struct device * dev);
201da177e4SLinus Torvalds extern void bus_remove_device(struct device * dev);
211740757eSGreg Kroah-Hartman extern struct bus_type *get_bus(struct bus_type * bus);
221740757eSGreg Kroah-Hartman extern void put_bus(struct bus_type * bus);
231da177e4SLinus Torvalds 
241da177e4SLinus Torvalds extern int bus_add_driver(struct device_driver *);
251da177e4SLinus Torvalds extern void bus_remove_driver(struct device_driver *);
261da177e4SLinus Torvalds 
2707e4a3e2Smochel@digitalimplant.org extern void driver_detach(struct device_driver * drv);
28afdce75fSGreg Kroah-Hartman extern int driver_probe_device(struct device_driver *, struct device *);
2907e4a3e2Smochel@digitalimplant.org 
30f67d115fSAdrian Bunk extern void sysdev_shutdown(void);
31f67d115fSAdrian Bunk extern int sysdev_suspend(pm_message_t state);
32f67d115fSAdrian Bunk extern int sysdev_resume(void);
33f67d115fSAdrian Bunk 
341da177e4SLinus Torvalds static inline struct class_device *to_class_dev(struct kobject *obj)
351da177e4SLinus Torvalds {
361da177e4SLinus Torvalds 	return container_of(obj, struct class_device, kobj);
371da177e4SLinus Torvalds }
381da177e4SLinus Torvalds 
391da177e4SLinus Torvalds static inline
401da177e4SLinus Torvalds struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
411da177e4SLinus Torvalds {
421da177e4SLinus Torvalds 	return container_of(_attr, struct class_device_attribute, attr);
431da177e4SLinus Torvalds }
441da177e4SLinus Torvalds 
45aa49b913SGreg Kroah-Hartman extern char *make_class_name(const char *name, struct kobject *kobj);
461da177e4SLinus Torvalds 
47