diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-03-08 17:21:49 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-08 17:21:52 +0100 |
commit | 86cb2ec7b22a0a89b8660110dc03321fadbef45f (patch) | |
tree | c4162b0ab7c4e3602e2b7a6a6fd47c55c3315fea /include/linux/pm_wakeup.h | |
parent | 7f0030b211579939461468f25b80c73e293c46e0 (diff) | |
parent | a5abba989deceb731047425812d268daf7536575 (diff) | |
download | linux-86cb2ec7b22a0a89b8660110dc03321fadbef45f.tar.gz linux-86cb2ec7b22a0a89b8660110dc03321fadbef45f.tar.bz2 linux-86cb2ec7b22a0a89b8660110dc03321fadbef45f.zip |
Merge commit 'v2.6.38-rc8' into perf/core
Merge reason: Merge latest fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/pm_wakeup.h')
-rw-r--r-- | include/linux/pm_wakeup.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 9cff00dd6b63..03a67db03d01 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h @@ -109,11 +109,6 @@ static inline bool device_can_wakeup(struct device *dev) return dev->power.can_wakeup; } -static inline bool device_may_wakeup(struct device *dev) -{ - return false; -} - static inline struct wakeup_source *wakeup_source_create(const char *name) { return NULL; @@ -134,24 +129,32 @@ static inline void wakeup_source_unregister(struct wakeup_source *ws) {} static inline int device_wakeup_enable(struct device *dev) { - return -EINVAL; + dev->power.should_wakeup = true; + return 0; } static inline int device_wakeup_disable(struct device *dev) { + dev->power.should_wakeup = false; return 0; } -static inline int device_init_wakeup(struct device *dev, bool val) +static inline int device_set_wakeup_enable(struct device *dev, bool enable) { - dev->power.can_wakeup = val; - return val ? -EINVAL : 0; + dev->power.should_wakeup = enable; + return 0; } +static inline int device_init_wakeup(struct device *dev, bool val) +{ + device_set_wakeup_capable(dev, val); + device_set_wakeup_enable(dev, val); + return 0; +} -static inline int device_set_wakeup_enable(struct device *dev, bool enable) +static inline bool device_may_wakeup(struct device *dev) { - return -EINVAL; + return dev->power.can_wakeup && dev->power.should_wakeup; } static inline void __pm_stay_awake(struct wakeup_source *ws) {} |