diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-01-23 16:25:23 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-02-26 14:39:10 -0500 |
commit | 5a2eb8585f3b38e01e30aacaa8b985a1520a993d (patch) | |
tree | 471b33cc48cf48ed491e8b3f2934bfb3fa9e81e1 /include/linux/device.h | |
parent | 0e06b4a891c6a108412fe24b4500f499da2cf8a1 (diff) |
PM: Add facility for advanced testing of async suspend/resume
Add configuration switch CONFIG_PM_ADVANCED_DEBUG for compiling in
extra PM debugging/testing code allowing one to access some
PM-related attributes of devices from the user space via sysfs.
If CONFIG_PM_ADVANCED_DEBUG is set, add sysfs attribute power/async
for every device allowing the user space to access the device's
power.async_suspend flag and modify it, if desired.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 70adc5f3f50a..b30527db3ac0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -478,6 +478,17 @@ static inline void device_enable_async_suspend(struct device *dev) | |||
478 | dev->power.async_suspend = true; | 478 | dev->power.async_suspend = true; |
479 | } | 479 | } |
480 | 480 | ||
481 | static inline void device_disable_async_suspend(struct device *dev) | ||
482 | { | ||
483 | if (dev->power.status == DPM_ON) | ||
484 | dev->power.async_suspend = false; | ||
485 | } | ||
486 | |||
487 | static inline bool device_async_suspend_enabled(struct device *dev) | ||
488 | { | ||
489 | return !!dev->power.async_suspend; | ||
490 | } | ||
491 | |||
481 | void driver_init(void); | 492 | void driver_init(void); |
482 | 493 | ||
483 | /* | 494 | /* |