aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorKalimochoAz <calimochoazucarado@gmail.com>2012-04-18 19:30:31 +0200
committerKalimochoAz <calimochoazucarado@gmail.com>2012-04-20 10:05:51 +0200
commit8619dc1984ebfde99d06ec8276e024d47313b128 (patch)
tree2450431e31dd5bb8a5188ed640f1d255543a5deb /kernel
parent730864c6e011b335349689c199ef3e32e30722e3 (diff)
downloadkernel_samsung_crespo-8619dc1984ebfde99d06ec8276e024d47313b128.zip
kernel_samsung_crespo-8619dc1984ebfde99d06ec8276e024d47313b128.tar.gz
kernel_samsung_crespo-8619dc1984ebfde99d06ec8276e024d47313b128.tar.bz2
Add 800Mhz as maxXPU Speed for DEEPIdle Stability.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/earlysuspend.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/kernel/power/earlysuspend.c b/kernel/power/earlysuspend.c
index b15f02e..34af445 100644
--- a/kernel/power/earlysuspend.c
+++ b/kernel/power/earlysuspend.c
@@ -20,9 +20,18 @@
#include <linux/syscalls.h> /* sys_sync */
#include <linux/wakelock.h>
#include <linux/workqueue.h>
-
+#ifdef CONFIG_CPU_DIDLE
+#include <linux/cpufreq.h>
+#include <linux/deep_idle.h>
+#endif
#include "power.h"
+#ifdef CONFIG_CPU_DIDLE
+static unsigned long lMinOldFreq;
+static unsigned long lPolicyMinOldFreq;
+unsigned int uIsSuspended;
+#endif
+
enum {
DEBUG_USER_STATE = 1U << 0,
DEBUG_SUSPEND = 1U << 2,
@@ -156,6 +165,7 @@ void request_suspend_state(suspend_state_t new_state)
spin_lock_irqsave(&state_lock, irqflags);
old_sleep = state & SUSPEND_REQUESTED;
+
if (debug_mask & DEBUG_USER_STATE) {
struct timespec ts;
struct rtc_time tm;
@@ -178,6 +188,34 @@ void request_suspend_state(suspend_state_t new_state)
queue_work(suspend_work_queue, &late_resume_work);
}
requested_suspend_state = new_state;
+#ifdef CONFIG_CPU_DIDLE
+ /* Increases the CPU min speed if we have deepidle enabled and we go into
+ suspend mode. This is fully independent of the governor, so we can add
+ or remove our favourite governor */
+ struct cpufreq_policy *policy;
+
+ if (deepidle_is_enabled()) {
+ policy = cpufreq_cpu_get(0);
+ if ((new_state == PM_SUSPEND_MEM) && (uIsSuspended == 0)) {
+ lMinOldFreq = policy->max;
+ lPolicyMinOldFreq = policy->user_policy.max;
+ policy->user_policy.max = 800000;
+ policy->max = 800000;
+ cpufreq_cpu_put(policy);
+ uIsSuspended = 1;
+ } else {
+ if (lMinOldFreq < 100000) {
+ lMinOldFreq = policy->max;
+ lPolicyMinOldFreq = policy->user_policy.max;
+ uIsSuspended = 0;
+ }
+ policy->max = lMinOldFreq;
+ policy->user_policy.max = lPolicyMinOldFreq;
+ cpufreq_cpu_put(policy);
+ uIsSuspended = 0;
+ }
+ }
+#endif
spin_unlock_irqrestore(&state_lock, irqflags);
}