Commit 1cce76c2 authored by Rusty Russell's avatar Rusty Russell Committed by Dave Jones

[CPUFREQ] use an enum for speedstep processor identification

The "unsigned int processor" everywhere confused Rusty, leading to
breakage when he passed in smp_processor_id().
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Acked-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent bbe237aa
...@@ -39,7 +39,7 @@ static struct pci_dev *speedstep_chipset_dev; ...@@ -39,7 +39,7 @@ static struct pci_dev *speedstep_chipset_dev;
/* speedstep_processor /* speedstep_processor
*/ */
static unsigned int speedstep_processor; static enum speedstep_processor speedstep_processor;
static u32 pmbase; static u32 pmbase;
......
...@@ -34,7 +34,7 @@ static int relaxed_check; ...@@ -34,7 +34,7 @@ static int relaxed_check;
* GET PROCESSOR CORE SPEED IN KHZ * * GET PROCESSOR CORE SPEED IN KHZ *
*********************************************************************/ *********************************************************************/
static unsigned int pentium3_get_frequency(unsigned int processor) static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
{ {
/* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */ /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
struct { struct {
...@@ -227,7 +227,7 @@ static unsigned int pentium4_get_frequency(void) ...@@ -227,7 +227,7 @@ static unsigned int pentium4_get_frequency(void)
/* Warning: may get called from smp_call_function_single. */ /* Warning: may get called from smp_call_function_single. */
unsigned int speedstep_get_frequency(unsigned int processor) unsigned int speedstep_get_frequency(enum speedstep_processor processor)
{ {
switch (processor) { switch (processor) {
case SPEEDSTEP_CPU_PCORE: case SPEEDSTEP_CPU_PCORE:
...@@ -380,7 +380,7 @@ EXPORT_SYMBOL_GPL(speedstep_detect_processor); ...@@ -380,7 +380,7 @@ EXPORT_SYMBOL_GPL(speedstep_detect_processor);
* DETECT SPEEDSTEP SPEEDS * * DETECT SPEEDSTEP SPEEDS *
*********************************************************************/ *********************************************************************/
unsigned int speedstep_get_freqs(unsigned int processor, unsigned int speedstep_get_freqs(enum speedstep_processor processor,
unsigned int *low_speed, unsigned int *low_speed,
unsigned int *high_speed, unsigned int *high_speed,
unsigned int *transition_latency, unsigned int *transition_latency,
......
...@@ -11,18 +11,18 @@ ...@@ -11,18 +11,18 @@
/* processors */ /* processors */
enum speedstep_processor {
#define SPEEDSTEP_CPU_PIII_C_EARLY 0x00000001 /* Coppermine core */ SPEEDSTEP_CPU_PIII_C_EARLY = 0x00000001, /* Coppermine core */
#define SPEEDSTEP_CPU_PIII_C 0x00000002 /* Coppermine core */ SPEEDSTEP_CPU_PIII_C = 0x00000002, /* Coppermine core */
#define SPEEDSTEP_CPU_PIII_T 0x00000003 /* Tualatin core */ SPEEDSTEP_CPU_PIII_T = 0x00000003, /* Tualatin core */
#define SPEEDSTEP_CPU_P4M 0x00000004 /* P4-M */ SPEEDSTEP_CPU_P4M = 0x00000004, /* P4-M */
/* the following processors are not speedstep-capable and are not auto-detected /* the following processors are not speedstep-capable and are not auto-detected
* in speedstep_detect_processor(). However, their speed can be detected using * in speedstep_detect_processor(). However, their speed can be detected using
* the speedstep_get_frequency() call. */ * the speedstep_get_frequency() call. */
#define SPEEDSTEP_CPU_PM 0xFFFFFF03 /* Pentium M */ SPEEDSTEP_CPU_PM = 0xFFFFFF03, /* Pentium M */
#define SPEEDSTEP_CPU_P4D 0xFFFFFF04 /* desktop P4 */ SPEEDSTEP_CPU_P4D = 0xFFFFFF04, /* desktop P4 */
#define SPEEDSTEP_CPU_PCORE 0xFFFFFF05 /* Core */ SPEEDSTEP_CPU_PCORE = 0xFFFFFF05, /* Core */
};
/* speedstep states -- only two of them */ /* speedstep states -- only two of them */
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
/* detect a speedstep-capable processor */ /* detect a speedstep-capable processor */
extern unsigned int speedstep_detect_processor (void); extern enum speedstep_processor speedstep_detect_processor(void);
/* detect the current speed (in khz) of the processor */ /* detect the current speed (in khz) of the processor */
extern unsigned int speedstep_get_frequency(unsigned int processor); extern unsigned int speedstep_get_frequency(enum speedstep_processor processor);
/* detect the low and high speeds of the processor. The callback /* detect the low and high speeds of the processor. The callback
...@@ -42,7 +42,7 @@ extern unsigned int speedstep_get_frequency(unsigned int processor); ...@@ -42,7 +42,7 @@ extern unsigned int speedstep_get_frequency(unsigned int processor);
* SPEEDSTEP_LOW; the second argument is zero so that no * SPEEDSTEP_LOW; the second argument is zero so that no
* cpufreq_notify_transition calls are initiated. * cpufreq_notify_transition calls are initiated.
*/ */
extern unsigned int speedstep_get_freqs(unsigned int processor, extern unsigned int speedstep_get_freqs(enum speedstep_processor processor,
unsigned int *low_speed, unsigned int *low_speed,
unsigned int *high_speed, unsigned int *high_speed,
unsigned int *transition_latency, unsigned int *transition_latency,
......
...@@ -35,7 +35,7 @@ static int smi_cmd; ...@@ -35,7 +35,7 @@ static int smi_cmd;
static unsigned int smi_sig; static unsigned int smi_sig;
/* info about the processor */ /* info about the processor */
static unsigned int speedstep_processor; static enum speedstep_processor speedstep_processor;
/* /*
* There are only two frequency states for each processor. Values * There are only two frequency states for each processor. Values
......
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