blob: c7cb4fc3735c5594cdb26530c81d92fbcacaf438 [file] [log] [blame]
Alan Stern3b98aea2008-08-07 13:06:12 -04001static inline void device_pm_init(struct device *dev)
2{
3 dev->power.status = DPM_ON;
4}
5
Rafael J. Wysocki296699d2007-07-29 23:27:18 +02006#ifdef CONFIG_PM_SLEEP
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8/*
9 * main.c
10 */
11
Rafael J. Wysocki1eede072008-05-20 23:00:01 +020012extern struct list_head dpm_list; /* The active device list */
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Daniel Drakedec13c12007-11-21 14:55:18 -080014static inline struct device *to_device(struct list_head *entry)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015{
Alan Sterncd59abf2007-09-21 15:36:56 -040016 return container_of(entry, struct device, power.entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017}
18
Alan Stern3b98aea2008-08-07 13:06:12 -040019extern void device_pm_add(struct device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020extern void device_pm_remove(struct device *);
Cornelia Huckffa6a702009-03-04 12:44:00 +010021extern void device_pm_move_before(struct device *, struct device *);
22extern void device_pm_move_after(struct device *, struct device *);
23extern void device_pm_move_last(struct device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Daniel Drakedec13c12007-11-21 14:55:18 -080025#else /* CONFIG_PM_SLEEP */
26
Alan Stern3b98aea2008-08-07 13:06:12 -040027static inline void device_pm_add(struct device *dev) {}
Rafael J. Wysocki58aca232008-03-12 00:57:22 +010028static inline void device_pm_remove(struct device *dev) {}
Cornelia Huckffa6a702009-03-04 12:44:00 +010029static inline void device_pm_move_before(struct device *deva,
30 struct device *devb) {}
31static inline void device_pm_move_after(struct device *deva,
32 struct device *devb) {}
33static inline void device_pm_move_last(struct device *dev) {}
Rafael J. Wysocki775b64d2008-01-12 20:40:46 +010034
Daniel Drakedec13c12007-11-21 14:55:18 -080035#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