aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/k8temp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/k8temp.c')
-rw-r--r--drivers/hwmon/k8temp.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index b9bb3e0ca530..39ead2a4d3c5 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -143,6 +143,37 @@ static const struct pci_device_id k8temp_ids[] = {
143 143
144MODULE_DEVICE_TABLE(pci, k8temp_ids); 144MODULE_DEVICE_TABLE(pci, k8temp_ids);
145 145
146static int __devinit is_rev_g_desktop(u8 model)
147{
148 u32 brandidx;
149
150 if (model < 0x69)
151 return 0;
152
153 if (model == 0xc1 || model == 0x6c || model == 0x7c)
154 return 0;
155
156 /*
157 * Differentiate between AM2 and ASB1.
158 * See "Constructing the processor Name String" in "Revision
159 * Guide for AMD NPT Family 0Fh Processors" (33610).
160 */
161 brandidx = cpuid_ebx(0x80000001);
162 brandidx = (brandidx >> 9) & 0x1f;
163
164 /* Single core */
165 if ((model == 0x6f || model == 0x7f) &&
166 (brandidx == 0x7 || brandidx == 0x9 || brandidx == 0xc))
167 return 0;
168
169 /* Dual core */
170 if (model == 0x6b &&
171 (brandidx == 0xb || brandidx == 0xc))
172 return 0;
173
174 return 1;
175}
176
146static int __devinit k8temp_probe(struct pci_dev *pdev, 177static int __devinit k8temp_probe(struct pci_dev *pdev,
147 const struct pci_device_id *id) 178 const struct pci_device_id *id)
148{ 179{
@@ -179,9 +210,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
179 "wrong - check erratum #141\n"); 210 "wrong - check erratum #141\n");
180 } 211 }
181 212
182 if ((model >= 0x69) && 213 if (is_rev_g_desktop(model)) {
183 !(model == 0xc1 || model == 0x6c || model == 0x7c ||
184 model == 0x6b || model == 0x6f || model == 0x7f)) {
185 /* 214 /*
186 * RevG desktop CPUs (i.e. no socket S1G1 or 215 * RevG desktop CPUs (i.e. no socket S1G1 or
187 * ASB1 parts) need additional offset, 216 * ASB1 parts) need additional offset,