diff options
Diffstat (limited to 'drivers/cpufreq/sc520_freq.c')
-rw-r--r-- | drivers/cpufreq/sc520_freq.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index 1e205e6b1727..e42e073cd9b8 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/timex.h> | 22 | #include <linux/timex.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <asm/cpu_device_id.h> | ||
25 | #include <asm/msr.h> | 26 | #include <asm/msr.h> |
26 | 27 | ||
27 | #define MMCR_BASE 0xfffef000 /* The default base address */ | 28 | #define MMCR_BASE 0xfffef000 /* The default base address */ |
@@ -150,18 +151,19 @@ static struct cpufreq_driver sc520_freq_driver = { | |||
150 | .attr = sc520_freq_attr, | 151 | .attr = sc520_freq_attr, |
151 | }; | 152 | }; |
152 | 153 | ||
154 | static const struct x86_cpu_id sc520_ids[] = { | ||
155 | { X86_VENDOR_AMD, 4, 9 }, | ||
156 | {} | ||
157 | }; | ||
158 | MODULE_DEVICE_TABLE(x86cpu, sc520_ids); | ||
153 | 159 | ||
154 | static int __init sc520_freq_init(void) | 160 | static int __init sc520_freq_init(void) |
155 | { | 161 | { |
156 | struct cpuinfo_x86 *c = &cpu_data(0); | ||
157 | int err; | 162 | int err; |
158 | 163 | ||
159 | /* Test if we have the right hardware */ | 164 | if (!x86_match_cpu(sc520_ids)) |
160 | if (c->x86_vendor != X86_VENDOR_AMD || | ||
161 | c->x86 != 4 || c->x86_model != 9) { | ||
162 | pr_debug("no Elan SC520 processor found!\n"); | ||
163 | return -ENODEV; | 165 | return -ENODEV; |
164 | } | 166 | |
165 | cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); | 167 | cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); |
166 | if (!cpuctl) { | 168 | if (!cpuctl) { |
167 | printk(KERN_ERR "sc520_freq: error: failed to remap memory\n"); | 169 | printk(KERN_ERR "sc520_freq: error: failed to remap memory\n"); |