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 ...@@ -18,20 +18,6 @@ config CPU_FREQ
source "drivers/cpufreq/Kconfig" 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 config CPU_FREQ_TABLE
tristate "CPU frequency table helpers" tristate "CPU frequency table helpers"
depends on CPU_FREQ 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 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
...@@ -51,7 +51,6 @@ MODULE_LICENSE("GPL"); ...@@ -51,7 +51,6 @@ MODULE_LICENSE("GPL");
static struct acpi_processor_performance *performance; static struct acpi_processor_performance *performance;
static struct cpufreq_driver acpi_cpufreq_driver;
static int static int
...@@ -580,9 +579,7 @@ acpi_cpufreq_cpu_init ( ...@@ -580,9 +579,7 @@ acpi_cpufreq_cpu_init (
policy->cpuinfo.transition_latency = perf->states[i].transition_latency; policy->cpuinfo.transition_latency = perf->states[i].transition_latency;
} }
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
acpi_cpufreq_driver.cpu_cur_freq[policy->cpu] = perf->states[pr->limit.state.px].core_frequency * 1000;
#endif
/* table init */ /* table init */
for (i=0; i<=perf->state_count; i++) for (i=0; i<=perf->state_count; i++)
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */ #define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */
#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */ #define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */
static struct cpufreq_driver elanfreq_driver;
/* Module parameter */ /* Module parameter */
static int max_freq; static int max_freq;
...@@ -220,9 +218,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) ...@@ -220,9 +218,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = elanfreq_get_cpu_frequency();
elanfreq_driver.cpu_cur_freq[policy->cpu] = elanfreq_get_cpu_frequency();
#endif
return cpufreq_frequency_table_cpuinfo(policy, &elanfreq_table[0]);; return cpufreq_frequency_table_cpuinfo(policy, &elanfreq_table[0]);;
} }
......
...@@ -106,8 +106,6 @@ ...@@ -106,8 +106,6 @@
#define PWRSVE_ISA (1<<3) /* stop ISA clock */ #define PWRSVE_ISA (1<<3) /* stop ISA clock */
#define PWRSVE (1<<4) /* active idle */ #define PWRSVE (1<<4) /* active idle */
static struct cpufreq_driver gx_suspmod_driver;
struct gxfreq_params { struct gxfreq_params {
u8 on_duration; u8 on_duration;
u8 off_duration; u8 off_duration;
...@@ -435,9 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy) ...@@ -435,9 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
else else
policy->min = maxfreq / POLICY_MIN_DIV; policy->min = maxfreq / POLICY_MIN_DIV;
policy->max = maxfreq; policy->max = maxfreq;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = curfreq;
gx_suspmod_driver.cpu_cur_freq[policy->cpu] = curfreq;
#endif
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.min_freq = maxfreq / max_duration; policy->cpuinfo.min_freq = maxfreq / max_duration;
policy->cpuinfo.max_freq = maxfreq; 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) 2001 Dave Jones. <davej@suse.de>
* (C) 2002 Padraig Brady. <padraig@antefacto.com> * (C) 2002 Padraig Brady. <padraig@antefacto.com>
...@@ -582,15 +582,6 @@ static int longhaul_target (struct cpufreq_policy *policy, ...@@ -582,15 +582,6 @@ static int longhaul_target (struct cpufreq_policy *policy,
return 0; 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) static int longhaul_cpu_init (struct cpufreq_policy *policy)
{ {
struct cpuinfo_x86 *c = cpu_data; struct cpuinfo_x86 *c = cpu_data;
...@@ -648,13 +639,18 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy) ...@@ -648,13 +639,18 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
longhaul_driver.cpu_cur_freq[0] = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
#endif
return cpufreq_frequency_table_cpuinfo(policy, longhaul_table); 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) static int __init longhaul_init (void)
{ {
struct cpuinfo_x86 *c = cpu_data; 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> * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
* *
...@@ -244,10 +244,6 @@ static int longrun_cpu_init(struct cpufreq_policy *policy) ...@@ -244,10 +244,6 @@ static int longrun_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
longrun_get_policy(policy); 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; return 0;
} }
......
...@@ -49,8 +49,6 @@ enum { ...@@ -49,8 +49,6 @@ enum {
static int has_N44_O17_errata[NR_CPUS]; static int has_N44_O17_errata[NR_CPUS];
static int stock_freq; static int stock_freq;
static struct cpufreq_driver p4clockmod_driver;
static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) 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) ...@@ -220,9 +218,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = 1000; policy->cpuinfo.transition_latency = 1000;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = stock_freq;
p4clockmod_driver.cpu_cur_freq[policy->cpu] = stock_freq;
#endif
return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]); 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) * This file was part of Powertweak Linux (http://powertweak.sf.net)
* and is shared with the Linux Kernel module. * and is shared with the Linux Kernel module.
* *
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long #define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long
as it is unused */ as it is unused */
static struct cpufreq_driver powernow_k6_driver;
static unsigned int busfreq; /* FSB, in 10 kHz */ static unsigned int busfreq; /* FSB, in 10 kHz */
static unsigned int max_multiplier; static unsigned int max_multiplier;
...@@ -168,9 +167,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) ...@@ -168,9 +167,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = busfreq * max_multiplier;
powernow_k6_driver.cpu_cur_freq[policy->cpu] = busfreq * max_multiplier;
#endif
return cpufreq_frequency_table_cpuinfo(policy, &clock_ratio[0]); 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> * (C) 2003 Dave Jones <davej@suse.de>
* *
...@@ -72,8 +72,6 @@ static int fid_codes[32] = { ...@@ -72,8 +72,6 @@ static int fid_codes[32] = {
150, 225, 160, 165, 170, 180, -1, -1, 150, 225, 160, 165, 170, 180, -1, -1,
}; };
static struct cpufreq_driver powernow_driver;
static struct cpufreq_frequency_table *powernow_table; static struct cpufreq_frequency_table *powernow_table;
static unsigned int can_scale_bus; static unsigned int can_scale_bus;
...@@ -369,13 +367,18 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) ...@@ -369,13 +367,18 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = latency; policy->cpuinfo.transition_latency = latency;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = maximum_speed;
powernow_driver.cpu_cur_freq[policy->cpu] = maximum_speed;
#endif
return cpufreq_frequency_table_cpuinfo(policy, powernow_table); 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) static int __init powernow_init (void)
{ {
if (check_powernow()==0) if (check_powernow()==0)
...@@ -391,14 +394,6 @@ static void __exit powernow_exit (void) ...@@ -391,14 +394,6 @@ static void __exit powernow_exit (void)
kfree(powernow_table); 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_AUTHOR ("Dave Jones <davej@suse.de>");
MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors."); MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors.");
MODULE_LICENSE ("GPL"); 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) 2001 Dave Jones, Arjan van de ven.
* (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include <asm/msr.h> #include <asm/msr.h>
static struct cpufreq_driver speedstep_driver;
/* speedstep_chipset: /* speedstep_chipset:
* It is necessary to know which chipset is used. As accesses to * It is necessary to know which chipset is used. As accesses to
* this device occur at various places in this module, we need a * 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) ...@@ -629,9 +627,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
policy->policy = (speed == speedstep_low_freq) ? policy->policy = (speed == speedstep_low_freq) ?
CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE; CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
#ifdef CONFIG_CPU_FREQ_24_API policy->cur = speed;
speedstep_driver.cpu_cur_freq[policy->cpu] = speed;
#endif
return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]); return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]);
} }
...@@ -686,7 +682,7 @@ static int __init speedstep_init(void) ...@@ -686,7 +682,7 @@ static int __init speedstep_init(void)
return -ENODEV; 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 */ /* activate speedstep support */
if (speedstep_activate()) 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