aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/gl518sm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/gl518sm.c')
-rw-r--r--drivers/hwmon/gl518sm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index c5255118bc16..3b1ac48fce23 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -96,10 +96,10 @@ static inline u8 FAN_TO_REG(long rpm, int div)
96 long rpmdiv; 96 long rpmdiv;
97 if (rpm == 0) 97 if (rpm == 0)
98 return 0; 98 return 0;
99 rpmdiv = SENSORS_LIMIT(rpm, 1, 1920000) * div; 99 rpmdiv = SENSORS_LIMIT(rpm, 1, 960000) * div;
100 return SENSORS_LIMIT((960000 + rpmdiv / 2) / rpmdiv, 1, 255); 100 return SENSORS_LIMIT((480000 + rpmdiv / 2) / rpmdiv, 1, 255);
101} 101}
102#define FAN_FROM_REG(val,div) ((val)==0 ? 0 : (960000/((val)*(div)))) 102#define FAN_FROM_REG(val,div) ((val)==0 ? 0 : (480000/((val)*(div))))
103 103
104#define IN_TO_REG(val) (SENSORS_LIMIT((((val)+9)/19),0,255)) 104#define IN_TO_REG(val) (SENSORS_LIMIT((((val)+9)/19),0,255))
105#define IN_FROM_REG(val) ((val)*19) 105#define IN_FROM_REG(val) ((val)*19)