blob: 10c20840395e8bcebb69c5488af327c8c5c3e77b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * shutdown.c
3 */
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005extern void device_shutdown(void);
6
7
Rafael J. Wysocki296699d2007-07-29 23:27:18 +02008#ifdef CONFIG_PM_SLEEP
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10/*
11 * main.c
12 */
13
Alan Sterncd59abf2007-09-21 15:36:56 -040014extern struct list_head dpm_active; /* The active device list */
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Daniel Drakedec13c12007-11-21 14:55:18 -080016static inline struct device *to_device(struct list_head *entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070017{
Alan Sterncd59abf2007-09-21 15:36:56 -040018 return container_of(entry, struct device, power.entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -070019}
20
Daniel Drakedec13c12007-11-21 14:55:18 -080021extern void device_pm_add(struct device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022extern void device_pm_remove(struct device *);
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010023extern void device_pm_schedule_removal(struct device *);
24extern int pm_sleep_lock(void);
25extern void pm_sleep_unlock(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Daniel Drakedec13c12007-11-21 14:55:18 -080027#else /* CONFIG_PM_SLEEP */
28
29
30static inline void device_pm_add(struct device *dev)
31{
32}
33
34static inline void device_pm_remove(struct device *dev)
35{
36}
37
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010038static inline int pm_sleep_lock(void)
39{
40 return 0;
41}
42
43static inline void pm_sleep_unlock(void)
44{
45}
46
Daniel Drakedec13c12007-11-21 14:55:18 -080047#endif
48
49#ifdef CONFIG_PM
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/*
52 * sysfs.c
53 */
54
55extern int dpm_sysfs_add(struct device *);
56extern void dpm_sysfs_remove(struct device *);
57
Daniel Drakedec13c12007-11-21 14:55:18 -080058#else /* CONFIG_PM */
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Daniel Drakedec13c12007-11-21 14:55:18 -080060static inline int dpm_sysfs_add(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061{
62 return 0;
63}
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Daniel Drakedec13c12007-11-21 14:55:18 -080065static inline void dpm_sysfs_remove(struct device *dev)
66{
Linus Torvalds1da177e2005-04-16 15:20:36 -070067}
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069#endif