Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129706
b: refs/heads/master
c: 76ff08d
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Herrmann authored and Jean Delvare committed Jan 15, 2009
1 parent b959202 commit 1e93444
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2e066bba2aad6583e3ff648bf28339d6c9f0898
refs/heads/master: 76ff08da34196cfa308fcd3552bb9ea20888e745
17 changes: 15 additions & 2 deletions trunk/drivers/hwmon/k8temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct k8temp_data {
u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */
u32 temp[2][2]; /* core, place */
u8 swap_core_select; /* meaning of SEL_CORE is inverted */
u32 temp_offset;
};

static struct k8temp_data *k8temp_update_device(struct device *dev)
Expand Down Expand Up @@ -116,13 +117,15 @@ static ssize_t show_temp(struct device *dev,
to_sensor_dev_attr_2(devattr);
int core = attr->nr;
int place = attr->index;
int temp;
struct k8temp_data *data = k8temp_update_device(dev);

if (data->swap_core_select)
core = core ? 0 : 1;

return sprintf(buf, "%d\n",
TEMP_FROM_REG(data->temp[core][place]));
temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset;

return sprintf(buf, "%d\n", temp);
}

/* core, place */
Expand Down Expand Up @@ -176,6 +179,16 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
"wrong - check erratum #141\n");
}

if ((model >= 0x69) &&
!(model == 0xc1 || model == 0x6c || model == 0x7c)) {
/*
* RevG desktop CPUs (i.e. no socket S1G1 parts)
* need additional offset, otherwise reported
* temperature is below ambient temperature
*/
data->temp_offset = 21000;
}

break;
}

Expand Down

0 comments on commit 1e93444

Please sign in to comment.