[PATCH 05/11] PM: Enable early suspend through /sys/power/state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If EARLYSUSPEND is enabled then writes to /sys/power/state no longerblocks, and the kernel will try to enter the requested state everytime no wakelocks are held. Write "on" to resume normal operation.
Signed-off-by: Arve Hjønnevåg <arve@xxxxxxxxxxx>--- kernel/power/main.c |   14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/kernel/power/main.c b/kernel/power/main.cindex 2399888..f2139ca 100644--- a/kernel/power/main.c+++ b/kernel/power/main.c@@ -388,6 +388,9 @@ static void suspend_finish(void)   static const char * const pm_states[PM_SUSPEND_MAX] = {+#ifdef CONFIG_EARLYSUSPEND+	[PM_SUSPEND_ON]		= "on",+#endif 	[PM_SUSPEND_STANDBY]	= "standby", 	[PM_SUSPEND_MEM]	= "mem", };@@ -505,7 +508,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;@@ -527,8 +534,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;-- 1.6.1
_______________________________________________linux-pm mailing listlinux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux