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 | |||||
Alan Stern | cd59abf | 2007-09-21 15:36:56 -0400 | [diff] [blame] | 14 | extern struct list_head dpm_active; /* The active device list */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 16 | static inline struct device *to_device(struct list_head *entry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | { |
Alan Stern | cd59abf | 2007-09-21 15:36:56 -0400 | [diff] [blame] | 18 | return container_of(entry, struct device, power.entry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | } |
20 | |||||
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 21 | extern void device_pm_add(struct device *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | extern void device_pm_remove(struct device *); |
Rafael J. Wysocki | 775b64d | 2008-01-12 20:40:46 +0100 | [diff] [blame^] | 23 | extern void device_pm_schedule_removal(struct device *); |
24 | extern int pm_sleep_lock(void); | ||||
25 | extern void pm_sleep_unlock(void); | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 27 | #else /* CONFIG_PM_SLEEP */ |
28 | |||||
29 | |||||
30 | static inline void device_pm_add(struct device *dev) | ||||
31 | { | ||||
32 | } | ||||
33 | |||||
34 | static inline void device_pm_remove(struct device *dev) | ||||
35 | { | ||||
36 | } | ||||
37 | |||||
Rafael J. Wysocki | 775b64d | 2008-01-12 20:40:46 +0100 | [diff] [blame^] | 38 | static inline int pm_sleep_lock(void) |
39 | { | ||||
40 | return 0; | ||||
41 | } | ||||
42 | |||||
43 | static inline void pm_sleep_unlock(void) | ||||
44 | { | ||||
45 | } | ||||
46 | |||||
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 47 | #endif |
48 | |||||
49 | #ifdef CONFIG_PM | ||||
50 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | /* |
52 | * sysfs.c | ||||
53 | */ | ||||
54 | |||||
55 | extern int dpm_sysfs_add(struct device *); | ||||
56 | extern void dpm_sysfs_remove(struct device *); | ||||
57 | |||||
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 58 | #else /* CONFIG_PM */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 60 | static inline int dpm_sysfs_add(struct device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | { |
62 | return 0; | ||||
63 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Daniel Drake | dec13c1 | 2007-11-21 14:55:18 -0800 | [diff] [blame] | 65 | static inline void dpm_sysfs_remove(struct device *dev) |
66 | { | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | } |
68 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | #endif |