aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/k8temp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index ca56f2e26fd1..a6381bc9189c 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -48,6 +48,7 @@ struct k8temp_data {
48 /* registers values */ 48 /* registers values */
49 u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */ 49 u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */
50 u32 temp[2][2]; /* core, place */ 50 u32 temp[2][2]; /* core, place */
51 u8 swap_core_select; /* meaning of SEL_CORE is inverted */
51}; 52};
52 53
53static struct k8temp_data *k8temp_update_device(struct device *dev) 54static struct k8temp_data *k8temp_update_device(struct device *dev)
@@ -117,6 +118,9 @@ static ssize_t show_temp(struct device *dev,
117 int place = attr->index; 118 int place = attr->index;
118 struct k8temp_data *data = k8temp_update_device(dev); 119 struct k8temp_data *data = k8temp_update_device(dev);
119 120
121 if (data->swap_core_select)
122 core = core ? 0 : 1;
123
120 return sprintf(buf, "%d\n", 124 return sprintf(buf, "%d\n",
121 TEMP_FROM_REG(data->temp[core][place])); 125 TEMP_FROM_REG(data->temp[core][place]));
122} 126}
@@ -162,7 +166,12 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
162 goto exit_free; 166 goto exit_free;
163 } 167 }
164 168
169 /*
170 * AMD NPT family 0fh, i.e. RevF and RevG:
171 * meaning of SEL_CORE bit is inverted
172 */
165 if (model >= 0x40) { 173 if (model >= 0x40) {
174 data->swap_core_select = 1;
166 dev_warn(&pdev->dev, "Temperature readouts might be " 175 dev_warn(&pdev->dev, "Temperature readouts might be "
167 "wrong - check erratum #141\n"); 176 "wrong - check erratum #141\n");
168 } 177 }