Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292122
b: refs/heads/master
c: 93092a6
h: refs/heads/master
v: v3
  • Loading branch information
Frans Meulenbroeks authored and Guenter Roeck committed Mar 19, 2012
1 parent bc78ec3 commit 46ec53c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: 96585f1ae4698800a18582935e2f01bb65a44fe6
refs/heads/master: 93092a644fb519ec520c3a1f3e05ef9d25b1dac4
15 changes: 8 additions & 7 deletions trunk/drivers/hwmon/k8temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct k8temp_data {
unsigned long last_updated; /* in jiffies */

/* registers values */
u8 sensorsp; /* sensor presence bits - SEL_CORE & SEL_PLACE */
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;
Expand All @@ -63,7 +63,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)
if (!data->valid
|| time_after(jiffies, data->last_updated + HZ)) {
pci_read_config_byte(pdev, REG_TEMP, &tmp);
tmp &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
tmp &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
pci_write_config_byte(pdev, REG_TEMP, tmp);
pci_read_config_dword(pdev, REG_TEMP, &data->temp[0][0]);

Expand All @@ -82,7 +82,7 @@ static struct k8temp_data *k8temp_update_device(struct device *dev)
&data->temp[1][0]);

if (data->sensorsp & SEL_PLACE) {
tmp |= SEL_PLACE; /* Select sensor 1, core1 */
tmp |= SEL_PLACE; /* Select sensor 1, core1 */
pci_write_config_byte(pdev, REG_TEMP, tmp);
pci_read_config_dword(pdev, REG_TEMP,
&data->temp[1][1]);
Expand Down Expand Up @@ -183,7 +183,8 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
u8 model, stepping;
struct k8temp_data *data;

if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) {
data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL);
if (!data) {
err = -ENOMEM;
goto exit;
}
Expand Down Expand Up @@ -217,7 +218,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
data->temp_offset = 21000;

pci_read_config_byte(pdev, REG_TEMP, &scfg);
scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
pci_write_config_byte(pdev, REG_TEMP, scfg);
pci_read_config_byte(pdev, REG_TEMP, &scfg);

Expand All @@ -238,15 +239,15 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
pci_write_config_byte(pdev, REG_TEMP, scfg);
pci_read_config_dword(pdev, REG_TEMP, &temp);
scfg |= SEL_CORE; /* prepare for next selection */
if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is not likely */
if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is unlikely */
data->sensorsp &= ~SEL_PLACE;
}

if (data->sensorsp & SEL_CORE) {
scfg &= ~SEL_PLACE; /* Select sensor 0, core1 */
pci_write_config_byte(pdev, REG_TEMP, scfg);
pci_read_config_dword(pdev, REG_TEMP, &temp);
if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is not likely */
if (!((temp >> 16) & 0xff)) /* if temp is 0 -49C is unlikely */
data->sensorsp &= ~SEL_CORE;
}

Expand Down

0 comments on commit 46ec53c

Please sign in to comment.