blob: e32d3bdb92c1dbf45d02c161130fcafbdd0044d9 [file] [log] [blame]
Rafael J. Wysocki296699d2007-07-29 23:27:18 +02001#ifdef CONFIG_PM_SLEEP
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3/*
4 * main.c
5 */
6
Alan Sterncd59abf2007-09-21 15:36:56 -04007extern struct list_head dpm_active; /* The active device list */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Daniel Drakedec13c12007-11-21 14:55:18 -08009static inline struct device *to_device(struct list_head *entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070010{
Alan Sterncd59abf2007-09-21 15:36:56 -040011 return container_of(entry, struct device, power.entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -070012}
13
Daniel Drakedec13c12007-11-21 14:55:18 -080014extern void device_pm_add(struct device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070015extern void device_pm_remove(struct device *);
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010016extern int pm_sleep_lock(void);
17extern void pm_sleep_unlock(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Daniel Drakedec13c12007-11-21 14:55:18 -080019#else /* CONFIG_PM_SLEEP */
20
21
22static inline void device_pm_add(struct device *dev)
23{
24}
25
26static inline void device_pm_remove(struct device *dev)
27{
28}
29
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010030static inline int pm_sleep_lock(void)
31{
32 return 0;
33}
34
35static inline void pm_sleep_unlock(void)
36{
37}
38
Daniel Drakedec13c12007-11-21 14:55:18 -080039#endif
40
41#ifdef CONFIG_PM
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043/*
44 * sysfs.c
45 */
46
47extern int dpm_sysfs_add(struct device *);
48extern void dpm_sysfs_remove(struct device *);
49
Daniel Drakedec13c12007-11-21 14:55:18 -080050#else /* CONFIG_PM */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Daniel Drakedec13c12007-11-21 14:55:18 -080052static inline int dpm_sysfs_add(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053{
54 return 0;
55}
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Daniel Drakedec13c12007-11-21 14:55:18 -080057static inline void dpm_sysfs_remove(struct device *dev)
58{
Linus Torvalds1da177e2005-04-16 15:20:36 -070059}
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif