Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84541
b: refs/heads/master
c: ff8421f
h: refs/heads/master
i:
  84539: 0970bc0
v: v3
  • Loading branch information
Juerg Haefliger authored and Mark M. Hoffman committed Feb 8, 2008
1 parent 2576e91 commit 32e730f
Show file tree
Hide file tree
Showing 2 changed files with 12 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: cb96b8ca11644ee1223e0fb3f1f629ead15203cb
refs/heads/master: ff8421f733c91a70d8edadf9ce2842fca66172fa
15 changes: 11 additions & 4 deletions trunk/drivers/hwmon/dme1737.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,21 @@ static inline int TEMP_HYST_TO_REG(int val, int ix, int reg)
/* Fan input RPM */
static inline int FAN_FROM_REG(int reg, int tpc)
{
return (reg == 0 || reg == 0xffff) ? 0 :
(tpc == 0) ? 90000 * 60 / reg : tpc * reg;
if (tpc) {
return tpc * reg;
} else {
return (reg == 0 || reg == 0xffff) ? 0 : 90000 * 60 / reg;
}
}

static inline int FAN_TO_REG(int val, int tpc)
{
return SENSORS_LIMIT((tpc == 0) ? 90000 * 60 / val : val / tpc,
0, 0xffff);
if (tpc) {
return SENSORS_LIMIT(val / tpc, 0, 0xffff);
} else {
return (val <= 0) ? 0xffff :
SENSORS_LIMIT(90000 * 60 / val, 0, 0xfffe);
}
}

/* Fan TPC (tach pulse count)
Expand Down

0 comments on commit 32e730f

Please sign in to comment.