Commit 912fd3b6 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] cpufreq (4/5): update x86 drivers to compile with new "userspace" governor

Update x86 drivers so that they can live with the new cpufreq governor
"userspace".

sparc64 doesn't need any change, and I'll send the corresponding patch
for ARM to Russell King.
parent 405c230a
......@@ -18,20 +18,6 @@ config CPU_FREQ
source "drivers/cpufreq/Kconfig"
config CPU_FREQ_24_API
bool "/proc/sys/cpu/ interface (2.4. / OLD)"
depends on CPU_FREQ
help
This enables the /proc/sys/cpu/ sysctl interface for controlling
CPUFreq, as known from the 2.4.-kernel patches for CPUFreq. 2.5
uses a sysfs interface instead. Please note that some drivers do
not work well with the 2.4. /proc/sys/cpu sysctl interface,
so if in doubt, say N here.
For details, take a look at linux/Documentation/cpufreq.
If in doubt, say N.
config CPU_FREQ_TABLE
tristate "CPU frequency table helpers"
depends on CPU_FREQ
......
/*
* acpi_processor_perf.c - ACPI Processor P-States Driver ($Revision: 71 $)
* acpi_processor_perf.c - ACPI Processor P-States Driver ($Revision: 1.3 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -51,7 +51,6 @@ MODULE_LICENSE("GPL");
static struct acpi_processor_performance *performance;
static struct cpufreq_driver acpi_cpufreq_driver;
static int
......@@ -580,9 +579,7 @@ acpi_cpufreq_cpu_init (
policy->cpuinfo.transition_latency = perf->states[i].transition_latency;
}
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
#ifdef CONFIG_CPU_FREQ_24_API
acpi_cpufreq_driver.cpu_cur_freq[policy->cpu] = perf->states[pr->limit.state.px].core_frequency * 1000;
#endif
policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
/* table init */
for (i=0; i<=perf->state_count; i++)
......
......@@ -31,8 +31,6 @@
#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */
#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */
static struct cpufreq_driver elanfreq_driver;
/* Module parameter */
static int max_freq;
......@@ -220,9 +218,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API
elanfreq_driver.cpu_cur_freq[policy->cpu] = elanfreq_get_cpu_frequency();
#endif
policy->cur = elanfreq_get_cpu_frequency();
return cpufreq_frequency_table_cpuinfo(policy, &elanfreq_table[0]);;
}
......
......@@ -106,8 +106,6 @@
#define PWRSVE_ISA (1<<3) /* stop ISA clock */
#define PWRSVE (1<<4) /* active idle */
static struct cpufreq_driver gx_suspmod_driver;
struct gxfreq_params {
u8 on_duration;
u8 off_duration;
......@@ -435,9 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
else
policy->min = maxfreq / POLICY_MIN_DIV;
policy->max = maxfreq;
#ifdef CONFIG_CPU_FREQ_24_API
gx_suspmod_driver.cpu_cur_freq[policy->cpu] = curfreq;
#endif
policy->cur = curfreq;
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.min_freq = maxfreq / max_duration;
policy->cpuinfo.max_freq = maxfreq;
......
/*
* $Id: longhaul.c,v 1.86 2003/02/12 13:59:11 davej Exp $
* $Id: longhaul.c,v 1.87 2003/02/22 10:23:46 db Exp $
*
* (C) 2001 Dave Jones. <davej@suse.de>
* (C) 2002 Padraig Brady. <padraig@antefacto.com>
......@@ -582,15 +582,6 @@ static int longhaul_target (struct cpufreq_policy *policy,
return 0;
}
static int longhaul_cpu_init (struct cpufreq_policy *policy);
static struct cpufreq_driver longhaul_driver = {
.verify = longhaul_verify,
.target = longhaul_target,
.init = longhaul_cpu_init,
.name = "longhaul",
};
static int longhaul_cpu_init (struct cpufreq_policy *policy)
{
struct cpuinfo_x86 *c = cpu_data;
......@@ -648,13 +639,18 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API
longhaul_driver.cpu_cur_freq[0] = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
#endif
policy->cur = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
return cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
}
static struct cpufreq_driver longhaul_driver = {
.verify = longhaul_verify,
.target = longhaul_target,
.init = longhaul_cpu_init,
.name = "longhaul",
};
static int __init longhaul_init (void)
{
struct cpuinfo_x86 *c = cpu_data;
......
/*
* $Id: longrun.c,v 1.22 2003/02/10 17:31:50 db Exp $
* $Id: longrun.c,v 1.25 2003/02/28 16:03:50 db Exp $
*
* (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
*
......@@ -244,10 +244,6 @@ static int longrun_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
longrun_get_policy(policy);
#ifdef CONFIG_CPU_FREQ_24_API
longrun_driver.cpu_cur_freq[policy->cpu] = longrun_low_freq; /* dummy value */
#endif
return 0;
}
......
......@@ -49,8 +49,6 @@ enum {
static int has_N44_O17_errata[NR_CPUS];
static int stock_freq;
static struct cpufreq_driver p4clockmod_driver;
static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
{
......@@ -220,9 +218,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = 1000;
#ifdef CONFIG_CPU_FREQ_24_API
p4clockmod_driver.cpu_cur_freq[policy->cpu] = stock_freq;
#endif
policy->cur = stock_freq;
return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]);
}
......
/*
* $Id: powernow-k6.c,v 1.46 2003/01/20 17:31:47 db Exp $
* $Id: powernow-k6.c,v 1.48 2003/02/22 10:23:46 db Exp $
* This file was part of Powertweak Linux (http://powertweak.sf.net)
* and is shared with the Linux Kernel module.
*
......@@ -25,7 +25,6 @@
#define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long
as it is unused */
static struct cpufreq_driver powernow_k6_driver;
static unsigned int busfreq; /* FSB, in 10 kHz */
static unsigned int max_multiplier;
......@@ -168,9 +167,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API
powernow_k6_driver.cpu_cur_freq[policy->cpu] = busfreq * max_multiplier;
#endif
policy->cur = busfreq * max_multiplier;
return cpufreq_frequency_table_cpuinfo(policy, &clock_ratio[0]);
}
......
/*
* $Id: powernow-k7.c,v 1.31 2003/02/12 21:16:35 davej Exp $
* $Id: powernow-k7.c,v 1.34 2003/02/22 10:23:46 db Exp $
*
* (C) 2003 Dave Jones <davej@suse.de>
*
......@@ -72,8 +72,6 @@ static int fid_codes[32] = {
150, 225, 160, 165, 170, 180, -1, -1,
};
static struct cpufreq_driver powernow_driver;
static struct cpufreq_frequency_table *powernow_table;
static unsigned int can_scale_bus;
......@@ -369,13 +367,18 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = latency;
#ifdef CONFIG_CPU_FREQ_24_API
powernow_driver.cpu_cur_freq[policy->cpu] = maximum_speed;
#endif
policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
}
static struct cpufreq_driver powernow_driver = {
.verify = powernow_verify,
.target = powernow_target,
.init = powernow_cpu_init,
.name = "powernow-k7",
};
static int __init powernow_init (void)
{
if (check_powernow()==0)
......@@ -391,14 +394,6 @@ static void __exit powernow_exit (void)
kfree(powernow_table);
}
static struct cpufreq_driver powernow_driver = {
.verify = powernow_verify,
.target = powernow_target,
.init = powernow_cpu_init,
.name = "powernow-k7",
};
MODULE_AUTHOR ("Dave Jones <davej@suse.de>");
MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors.");
MODULE_LICENSE ("GPL");
......
/*
* $Id: speedstep.c,v 1.68 2003/01/20 17:31:47 db Exp $
* $Id: speedstep.c,v 1.70 2003/02/22 10:23:46 db Exp $
*
* (C) 2001 Dave Jones, Arjan van de ven.
* (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
......@@ -30,8 +30,6 @@
#include <asm/msr.h>
static struct cpufreq_driver speedstep_driver;
/* speedstep_chipset:
* It is necessary to know which chipset is used. As accesses to
* this device occur at various places in this module, we need a
......@@ -629,9 +627,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
policy->policy = (speed == speedstep_low_freq) ?
CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API
speedstep_driver.cpu_cur_freq[policy->cpu] = speed;
#endif
policy->cur = speed;
return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]);
}
......@@ -686,7 +682,7 @@ static int __init speedstep_init(void)
return -ENODEV;
}
dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.68 $\n");
dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.70 $\n");
/* activate speedstep support */
if (speedstep_activate())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment