Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61801
b: refs/heads/master
c: 158ce07
h: refs/heads/master
i:
  61799: 5d82cee
v: v3
  • Loading branch information
Jean Delvare authored and Mark M. Hoffman committed Jul 19, 2007
1 parent 9ff32a2 commit cab9d3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: e432dc811bfb6b3d3ad618d99bd8d58132fec316
refs/heads/master: 158ce07564b68d4215b9560213a089d6f7c5a4ea
13 changes: 9 additions & 4 deletions trunk/drivers/hwmon/w83627ehf.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,15 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
/* Write both the fan clock divider (if it changed) and the new
fan min (unconditionally) */
if (new_div != data->fan_div[nr]) {
if (new_div > data->fan_div[nr])
data->fan[nr] >>= (data->fan_div[nr] - new_div);
else
data->fan[nr] <<= (new_div - data->fan_div[nr]);
/* Preserve the fan speed reading */
if (data->fan[nr] != 0xff) {
if (new_div > data->fan_div[nr])
data->fan[nr] >>= new_div - data->fan_div[nr];
else if (data->fan[nr] & 0x80)
data->fan[nr] = 0xff;
else
data->fan[nr] <<= data->fan_div[nr] - new_div;
}

dev_dbg(dev, "fan%u clock divider changed from %u to %u\n",
nr + 1, div_from_reg(data->fan_div[nr]),
Expand Down

0 comments on commit cab9d3e

Please sign in to comment.