Move source tree closer to the 2.6.32.17 mainline
/drivers/cpufreq/cpufreq_ondemand.c
blob:26e4759aaa6bf3a54588f3607192d033ca03d60f -> blob:4b34ade2332baaa50bb1ca1af9c45e1a9893d321
--- drivers/cpufreq/cpufreq_ondemand.c
+++ drivers/cpufreq/cpufreq_ondemand.c
@@ -22,8 +22,6 @@
#include <linux/tick.h>
#include <linux/ktime.h>
#include <linux/sched.h>
-#include <linux/input.h>
-#include <linux/workqueue.h>
/*
* dbs is used in this file as a shortform for demandbased switching
@@ -578,9 +576,7 @@ static void do_dbs_timer(struct work_str
/* We want all CPUs to do sampling nearly on same jiffy */
int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
- if (num_online_cpus() > 1)
- delay -= jiffies % delay;
-
+ delay -= jiffies % delay;
mutex_lock(&dbs_info->timer_mutex);
/* Common NORMAL_SAMPLE setup */
@@ -618,84 +614,6 @@ static inline void dbs_timer_exit(struct
cancel_delayed_work_sync(&dbs_info->work);
}
-static void dbs_refresh_callback(struct work_struct *unused)
-{
- struct cpufreq_policy *policy;
- struct cpu_dbs_info_s *this_dbs_info;
-
- if (lock_policy_rwsem_write(0) < 0)
- return;
-
- this_dbs_info = &per_cpu(od_cpu_dbs_info, 0);
- policy = this_dbs_info->cur_policy;
-
- if (policy->cur < policy->max) {
- __cpufreq_driver_target(policy, policy->max,
- CPUFREQ_RELATION_L);
- this_dbs_info->prev_cpu_idle = get_cpu_idle_time(0,
- &this_dbs_info->prev_cpu_wall);
- }
- unlock_policy_rwsem_write(0);
-}
-
-static DECLARE_WORK(dbs_refresh_work, dbs_refresh_callback);
-
-static void dbs_input_event(struct input_handle *handle, unsigned int type,
- unsigned int code, int value)
-{
- schedule_work(&dbs_refresh_work);
-}
-
-static int dbs_input_connect(struct input_handler *handler,
- struct input_dev *dev, const struct input_device_id *id)
-{
- struct input_handle *handle;
- int error;
-
- handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
- if (!handle)
- return -ENOMEM;
-
- handle->dev = dev;
- handle->handler = handler;
- handle->name = "cpufreq";
-
- error = input_register_handle(handle);
- if (error)
- goto err2;
-
- error = input_open_device(handle);
- if (error)
- goto err1;
-
- return 0;
-err1:
- input_unregister_handle(handle);
-err2:
- kfree(handle);
- return error;
-}
-
-static void dbs_input_disconnect(struct input_handle *handle)
-{
- input_close_device(handle);
- input_unregister_handle(handle);
- kfree(handle);
-}
-
-static const struct input_device_id dbs_ids[] = {
- { .driver_info = 1 },
- { },
-};
-
-static struct input_handler dbs_input_handler = {
- .event = dbs_input_event,
- .connect = dbs_input_connect,
- .disconnect = dbs_input_disconnect,
- .name = "cpufreq_ond",
- .id_table = dbs_ids,
-};
-
static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
unsigned int event)
{
@@ -759,7 +677,6 @@ static int cpufreq_governor_dbs(struct c
max(min_sampling_rate,
latency * LATENCY_MULTIPLIER);
}
- rc = input_register_handler(&dbs_input_handler);
mutex_unlock(&dbs_mutex);
mutex_init(&this_dbs_info->timer_mutex);
@@ -773,7 +690,6 @@ static int cpufreq_governor_dbs(struct c
sysfs_remove_group(&policy->kobj, &dbs_attr_group_old);
mutex_destroy(&this_dbs_info->timer_mutex);
dbs_enable--;
- input_unregister_handler(&dbs_input_handler);
mutex_unlock(&dbs_mutex);
if (!dbs_enable)
sysfs_remove_group(cpufreq_global_kobject,