Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * shutdown.c |
| 3 | */ |
| 4 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | extern void device_shutdown(void); |
| 6 | |
| 7 | |
Rafael J. Wysocki | 296699d | 2007-07-29 23:27:18 +0200 | [diff] [blame^] | 8 | #ifdef CONFIG_PM_SLEEP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
| 10 | /* |
| 11 | * main.c |
| 12 | */ |
| 13 | |
| 14 | /* |
| 15 | * Used to synchronize global power management operations. |
| 16 | */ |
Matthias Kaehlcke | 11048dc | 2007-05-23 14:19:41 -0700 | [diff] [blame] | 17 | extern struct mutex dpm_mtx; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
| 19 | /* |
| 20 | * Used to serialize changes to the dpm_* lists. |
| 21 | */ |
Matthias Kaehlcke | 11048dc | 2007-05-23 14:19:41 -0700 | [diff] [blame] | 22 | extern struct mutex dpm_list_mtx; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | /* |
| 25 | * The PM lists. |
| 26 | */ |
| 27 | extern struct list_head dpm_active; |
| 28 | extern struct list_head dpm_off; |
| 29 | extern struct list_head dpm_off_irq; |
| 30 | |
| 31 | |
| 32 | static inline struct dev_pm_info * to_pm_info(struct list_head * entry) |
| 33 | { |
| 34 | return container_of(entry, struct dev_pm_info, entry); |
| 35 | } |
| 36 | |
| 37 | static inline struct device * to_device(struct list_head * entry) |
| 38 | { |
| 39 | return container_of(to_pm_info(entry), struct device, power); |
| 40 | } |
| 41 | |
| 42 | extern int device_pm_add(struct device *); |
| 43 | extern void device_pm_remove(struct device *); |
| 44 | |
| 45 | /* |
| 46 | * sysfs.c |
| 47 | */ |
| 48 | |
| 49 | extern int dpm_sysfs_add(struct device *); |
| 50 | extern void dpm_sysfs_remove(struct device *); |
| 51 | |
| 52 | /* |
| 53 | * resume.c |
| 54 | */ |
| 55 | |
| 56 | extern void dpm_resume(void); |
| 57 | extern void dpm_power_up(void); |
| 58 | extern int resume_device(struct device *); |
| 59 | |
| 60 | /* |
| 61 | * suspend.c |
| 62 | */ |
| 63 | extern int suspend_device(struct device *, pm_message_t); |
| 64 | |
Rafael J. Wysocki | 296699d | 2007-07-29 23:27:18 +0200 | [diff] [blame^] | 65 | #else /* CONFIG_PM_SLEEP */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
| 67 | |
| 68 | static inline int device_pm_add(struct device * dev) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | static inline void device_pm_remove(struct device * dev) |
| 73 | { |
| 74 | |
| 75 | } |
| 76 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | #endif |