diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:40:54 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:40:54 +0200 |
commit | 9ab67899804448f2bea4087bb6e9e4d952a79258 (patch) | |
tree | 29ca9054d473e57f6d79638d1d3982f1ffcffcca /kernel/power/main.c | |
parent | 0de20dc0be1f147959b10903c76f2f41139f417a (diff) | |
parent | f5968c8833f0985b76d38593892acd6558bab149 (diff) |
Merge linux-linaro-3.0-2011.07-1-android-1 into..
..linux-linaro-3.0-2011.07-1_glk3.0
Conflicts:
arch/arm/common/Makefile
drivers/misc/Kconfig
drivers/misc/Makefile
kernel/printk.c
Change-Id: I126f34edb1879981909072beefb2738cad26f951
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 2981af4ce7c..ff29679510d 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -170,7 +170,11 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) { #ifdef CONFIG_SUSPEND +#ifdef CONFIG_EARLYSUSPEND + suspend_state_t state = PM_SUSPEND_ON; +#else suspend_state_t state = PM_SUSPEND_STANDBY; +#endif const char * const *s; #endif char *p; @@ -192,8 +196,15 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, break; } if (state < PM_SUSPEND_MAX && *s) +#ifdef CONFIG_EARLYSUSPEND + if (state == PM_SUSPEND_ON || valid_state(state)) { + error = 0; + request_suspend_state(state); + } +#else error = enter_state(state); #endif +#endif Exit: return error ? error : n; @@ -297,6 +308,11 @@ power_attr(pm_trace_dev_match); #endif /* CONFIG_PM_TRACE */ +#ifdef CONFIG_USER_WAKELOCK +power_attr(wake_lock); +power_attr(wake_unlock); +#endif + static struct attribute * g[] = { &state_attr.attr, #ifdef CONFIG_PM_TRACE @@ -309,6 +325,10 @@ static struct attribute * g[] = { #ifdef CONFIG_PM_DEBUG &pm_test_attr.attr, #endif +#ifdef CONFIG_USER_WAKELOCK + &wake_lock_attr.attr, + &wake_unlock_attr.attr, +#endif #endif NULL, }; |