summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-08-09 21:58:35 -0700
committerPatrick Mochel <mochel@osdl.org>2003-08-09 21:58:35 -0700
commit98247e0a408b4b551441bee5068eaa59ee646a11 (patch)
tree3f2a22f19059d91895c9dd34fa804566eeef7a74 /include
parenta40b9b0b335c466d587ba43f6337d432ea524a72 (diff)
[power] Add PM usage counting
- Add ->pm_users and ->pm_parent fields to struct dev_pm_info. - Add function device_pm_set_parent() The default power parent for a device is the device's physical parent, but a driver may change it to represent a tranversal power dependency. Though it's not incorporated into the suspend/resume sequences yet, the core will respect the power tree, rather than the physical/electrical one. Also added is a power usage count for devices, which indicates how many devices are dependent on that one for power (how many children it has in the power tree). The core will use this count to determine whether or not a device can be put into a low power state or not.
Diffstat (limited to 'include')
-rw-r--r--include/linux/pm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 9750051e4b4e..6942ad5d5cb3 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -25,6 +25,7 @@
#include <linux/config.h>
#include <linux/list.h>
+#include <asm/atomic.h>
/*
* Power management requests
@@ -188,15 +189,20 @@ static inline void pm_dev_idle(struct pm_dev *dev) {}
extern void (*pm_idle)(void);
extern void (*pm_power_off)(void);
+struct device;
struct dev_pm_info {
#ifdef CONFIG_PM
u32 power_state;
u8 * saved_state;
+ atomic_t pm_users;
+ struct device * pm_parent;
struct list_head entry;
#endif
};
+extern void device_pm_set_parent(struct device * dev, struct device * parent);
+
extern int device_pm_suspend(u32 state);
extern int device_pm_power_down(u32 state);
extern void device_pm_power_up(void);