summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-09-13 13:32:39 +0200
committerJonas ABERG <jonas.aberg@stericsson.com>2011-09-29 08:34:43 +0200
commit0cddfb2b35dbb6f054bfdbc486a4f84dfe8efd1a (patch)
tree92f5496786ff9c69b70863cab991792d81e0bfee /drivers/cpuidle
parent2c1d6edf73274e56e3194dac75c59e82e88688bd (diff)
ARM: ux500: Remove powersave
Since we don't know really the status of powersave related feature on this development track, let's remove everything, except: - prcmu driver: New location, which is the same as linux-next - cpufreq: new location, same as linux-next - regulator: keep as is for the moment, needed for the system to work. - clocks: same as for regulator. - pm-runtime: keep it as is. Later patches will re-add powersave, based upon what exists on SI u8500-android-2.3_v3.15 MTU from plat-nomadik is now used instead of own copy in mach. Change-Id: I8ceaa65e5e0905fcd85bf8e793b4a5ab2d2df64c Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32048
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/governors/menu.c128
1 files changed, 21 insertions, 107 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index ed28f774ca4..c47f3d09c1e 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -19,8 +19,6 @@
#include <linux/tick.h>
#include <linux/sched.h>
#include <linux/math64.h>
-#include <linux/cpu.h>
-#include <linux/sysfs.h>
#define BUCKETS 12
#define INTERVALS 8
@@ -123,8 +121,6 @@ struct menu_device {
int interval_ptr;
};
-static int tune_multiplier = 1024;
-static int forced_state;
#define LOAD_INT(x) ((x) >> FSHIFT)
#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
@@ -174,9 +170,6 @@ static inline int performance_multiplier(void)
{
int mult = 1;
- if (tune_multiplier <= 1)
- return tune_multiplier;
-
/* for higher loadavg, we are more reluctant */
mult += 2 * get_loadavg();
@@ -184,9 +177,6 @@ static inline int performance_multiplier(void)
/* for IO wait tasks (per cpu!) we add 5x each */
mult += 10 * nr_iowait_cpu(smp_processor_id());
- if (tune_multiplier != 1024)
- mult = (tune_multiplier * mult) / 1024;
-
return mult;
}
@@ -291,34 +281,26 @@ static int menu_select(struct cpuidle_device *dev)
if (data->expected_us > 5)
data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
- WARN((forced_state >= dev->state_count), \
- "Forced state value out of range.\n");
-
- if ((forced_state != 0) && (forced_state < dev->state_count)) {
- data->exit_us = dev->states[forced_state].exit_latency;
- data->last_state_idx = forced_state;
- } else {
- /*
- * Find the idle state with the lowest power while satisfying
- * our constraints.
- */
- for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) {
- struct cpuidle_state *s = &dev->states[i];
-
- if (s->flags & CPUIDLE_FLAG_IGNORE)
- continue;
- if (s->target_residency > data->predicted_us)
- continue;
- if (s->exit_latency > latency_req)
- continue;
- if (s->exit_latency * multiplier > data->predicted_us)
- continue;
-
- if (s->power_usage < power_usage) {
- power_usage = s->power_usage;
- data->last_state_idx = i;
- data->exit_us = s->exit_latency;
- }
+ /*
+ * Find the idle state with the lowest power while satisfying
+ * our constraints.
+ */
+ for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) {
+ struct cpuidle_state *s = &dev->states[i];
+
+ if (s->flags & CPUIDLE_FLAG_IGNORE)
+ continue;
+ if (s->target_residency > data->predicted_us)
+ continue;
+ if (s->exit_latency > latency_req)
+ continue;
+ if (s->exit_latency * multiplier > data->predicted_us)
+ continue;
+
+ if (s->power_usage < power_usage) {
+ power_usage = s->power_usage;
+ data->last_state_idx = i;
+ data->exit_us = s->exit_latency;
}
}
@@ -399,63 +381,6 @@ static void menu_update(struct cpuidle_device *dev)
data->interval_ptr = 0;
}
-int cpuidle_set_multiplier(unsigned int value)
-{
-
- if (value > 1024)
- tune_multiplier = 1024;
- else
- tune_multiplier = value;
-
- return 0;
-}
-EXPORT_SYMBOL(cpuidle_set_multiplier);
-
-/* Writing 0 will remove the forced state. */
-int cpuidle_force_state(unsigned int state)
-{
- forced_state = state;
-
- return 0;
-}
-EXPORT_SYMBOL(cpuidle_force_state);
-
-static ssize_t show_multiplier(struct sysdev_class *class,
- struct sysdev_class_attribute *attr,
- char *buf)
-{
- return sprintf(buf, "%d\n", tune_multiplier);
-}
-
-static ssize_t store_multiplier(struct sysdev_class *class,
- struct sysdev_class_attribute *attr,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
- ret = sscanf(buf, "%u", &input);
-
- if (ret != 1)
- return -EINVAL;
-
- cpuidle_set_multiplier(input);
-
- return count;
-}
-
-
-static SYSDEV_CLASS_ATTR(multiplier, 0644, show_multiplier, store_multiplier);
-
-static struct attribute *dbs_attributes[] = {
- &attr_multiplier.attr,
- NULL
-};
-
-static struct attribute_group dbs_attr_group = {
- .attrs = dbs_attributes,
- .name = "cpuidle",
-};
-
/**
* menu_enable_device - scans a CPU's states and does setup
* @dev: the CPU
@@ -483,15 +408,7 @@ static struct cpuidle_governor menu_governor = {
*/
static int __init init_menu(void)
{
- int ret;
-
- ret = cpuidle_register_governor(&menu_governor);
-
- sysfs_merge_group(&(cpu_sysdev_class.kset.kobj),
- &dbs_attr_group);
-
- return ret;
-
+ return cpuidle_register_governor(&menu_governor);
}
/**
@@ -499,9 +416,6 @@ static int __init init_menu(void)
*/
static void __exit exit_menu(void)
{
- sysfs_unmerge_group(&(cpu_sysdev_class.kset.kobj),
- &dbs_attr_group);
-
cpuidle_unregister_governor(&menu_governor);
}