24 #include <linux/module.h>
26 #include <linux/slab.h>
28 #include <linux/pci.h>
33 #include <asm/processor.h>
35 #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000)
37 #define SEL_PLACE 0x40
64 pci_read_config_byte(pdev,
REG_TEMP, &tmp);
66 pci_write_config_byte(pdev,
REG_TEMP, tmp);
67 pci_read_config_dword(pdev,
REG_TEMP, &data->
temp[0][0]);
71 pci_write_config_byte(pdev,
REG_TEMP, tmp);
72 pci_read_config_dword(pdev,
REG_TEMP,
79 pci_write_config_byte(pdev,
REG_TEMP, tmp);
80 pci_read_config_dword(pdev,
REG_TEMP,
85 pci_write_config_byte(pdev,
REG_TEMP, tmp);
86 pci_read_config_dword(pdev,
REG_TEMP,
118 int place = attr->
index;
127 return sprintf(buf,
"%d\n", temp);
152 if (model == 0xc1 || model == 0x6c || model == 0x7c)
160 brandidx = cpuid_ebx(0x80000001);
161 brandidx = (brandidx >> 9) & 0x1f;
164 if ((model == 0x6f || model == 0x7f) &&
165 (brandidx == 0x7 || brandidx == 0x9 || brandidx == 0xc))
170 (brandidx == 0
xb || brandidx == 0
xc))
193 if ((model == 4 && stepping == 0) ||
194 (model == 5 && stepping <= 1))
203 dev_warn(&pdev->
dev,
"Temperature readouts might be wrong - "
204 "check erratum #141\n");
212 if (is_rev_g_desktop(model))
215 pci_read_config_byte(pdev,
REG_TEMP, &scfg);
217 pci_write_config_byte(pdev,
REG_TEMP, scfg);
218 pci_read_config_byte(pdev,
REG_TEMP, &scfg);
221 dev_err(&pdev->
dev,
"Configuration bit(s) stuck at 1!\n");
226 pci_write_config_byte(pdev,
REG_TEMP, scfg);
233 pci_write_config_byte(pdev,
REG_TEMP, scfg);
234 pci_read_config_dword(pdev,
REG_TEMP, &temp);
236 if (!((temp >> 16) & 0xff))
242 pci_write_config_byte(pdev,
REG_TEMP, scfg);
243 pci_read_config_dword(pdev,
REG_TEMP, &temp);
244 if (!((temp >> 16) & 0xff))
248 data->
name =
"k8temp";
250 pci_set_drvdata(pdev, data);
254 &sensor_dev_attr_temp1_input.dev_attr);
261 &sensor_dev_attr_temp2_input.dev_attr);
269 &sensor_dev_attr_temp3_input.dev_attr);
274 &sensor_dev_attr_temp4_input.
296 &sensor_dev_attr_temp1_input.dev_attr);
298 &sensor_dev_attr_temp2_input.dev_attr);
300 &sensor_dev_attr_temp3_input.dev_attr);
302 &sensor_dev_attr_temp4_input.dev_attr);
313 &sensor_dev_attr_temp1_input.dev_attr);
315 &sensor_dev_attr_temp2_input.dev_attr);
317 &sensor_dev_attr_temp3_input.dev_attr);
319 &sensor_dev_attr_temp4_input.dev_attr);
325 .id_table = k8temp_ids,
326 .probe = k8temp_probe,