From 912fd3b6d7f248896ed2501fad53fa006a487df7 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 28 Feb 2003 16:54:31 -0800 Subject: [PATCH] [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. --- arch/i386/kernel/cpu/cpufreq/Kconfig | 14 ------------- arch/i386/kernel/cpu/cpufreq/acpi.c | 7 ++----- arch/i386/kernel/cpu/cpufreq/elanfreq.c | 6 +----- arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 6 +----- arch/i386/kernel/cpu/cpufreq/longhaul.c | 22 +++++++++------------ arch/i386/kernel/cpu/cpufreq/longrun.c | 6 +----- arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | 6 +----- arch/i386/kernel/cpu/cpufreq/powernow-k6.c | 7 ++----- arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 23 +++++++++------------- arch/i386/kernel/cpu/cpufreq/speedstep.c | 10 +++------- 10 files changed, 29 insertions(+), 78 deletions(-) diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig index aa0f51b69d10c..71f31ab0ed733 100644 --- a/arch/i386/kernel/cpu/cpufreq/Kconfig +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig @@ -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 diff --git a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c index b5fef75c62f81..9ea1686ac29c4 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi.c @@ -1,5 +1,5 @@ /* - * 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 * Copyright (C) 2001, 2002 Paul Diefenbaugh @@ -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++) diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c index cc898395c39f9..c88a077aea080 100644 --- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c +++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c @@ -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]);; } diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 6e8eab1d88ab0..006a2dd80bc87 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c @@ -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; diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index 9b87bf9bd5827..ae97400fb3851 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c @@ -1,5 +1,5 @@ /* - * $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. * (C) 2002 Padraig Brady. @@ -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; diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index c86b0c4667441..460dcda4594e3 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c @@ -1,5 +1,5 @@ /* - * $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 * @@ -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; } diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c index f31748fb339fa..592ff14576006 100644 --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c @@ -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]); } diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c index 0c75b4bc4bce6..0d0701078a564 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c @@ -1,5 +1,5 @@ /* - * $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]); } diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index c98a41cc64ba1..469ef8bf8d328 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c @@ -1,5 +1,5 @@ /* - * $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 * @@ -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 "); MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors."); MODULE_LICENSE ("GPL"); diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep.c b/arch/i386/kernel/cpu/cpufreq/speedstep.c index 0ff43640a55dc..db82f7c8edb09 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep.c @@ -1,5 +1,5 @@ /* - * $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 @@ -30,8 +30,6 @@ #include -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()) -- 2.53.0