blob: 379da4e958e0d00fc637b00cac5215f41fb6cd45 [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 *);
23
Daniel Drakedec13c12007-11-21 14:55:18 -080024#else /* CONFIG_PM_SLEEP */
25
26
27static inline void device_pm_add(struct device *dev)
28{
29}
30
31static inline void device_pm_remove(struct device *dev)
32{
33}
34
35#endif
36
37#ifdef CONFIG_PM
38
Linus Torvalds1da177e2005-04-16 15:20:36 -070039/*
40 * sysfs.c
41 */
42
43extern int dpm_sysfs_add(struct device *);
44extern void dpm_sysfs_remove(struct device *);
45
Daniel Drakedec13c12007-11-21 14:55:18 -080046#else /* CONFIG_PM */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Daniel Drakedec13c12007-11-21 14:55:18 -080048static inline int dpm_sysfs_add(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049{
50 return 0;
51}
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Daniel Drakedec13c12007-11-21 14:55:18 -080053static inline void dpm_sysfs_remove(struct device *dev)
54{
Linus Torvalds1da177e2005-04-16 15:20:36 -070055}
56
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#endif