gl518sm: Fix fan speed reading (2.6 backport).

gl520sm: Fix fan speed reading (2.6 backport).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5119 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2008-02-08 10:34:10 +00:00
1 parent 9882a42ede
commit 15d2b1d2a6
3 files changed
+6 -4

No files matched your search

+2
View File
@@ -11,6 +11,8 @@ SVN-HEAD
Module eeprom: Hide Sony Vaio serial numbers to regular users (2.6 backport)
Drop useless debugging log messages
Recognize VGN as a valid Sony Vaio name prefix (2.6 backport)
Module gl518sm: Fix fan speed reading (2.6 backport)
Module gl520sm: Fix fan speed reading (2.6 backport)
Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding
Update manufacturer IDs.
Program decode-vaio.pl: Private data might not be readable by non-root users
+2 -2
View File
@@ -85,12 +85,12 @@ static inline u8 FAN_TO_REG(long rpm, int div)
if (rpm == 0)
return 255;
rpm = SENSORS_LIMIT(rpm, 1, 1000000);
return SENSORS_LIMIT((960000 + rpm * div / 2) / (rpm * div), 1,
return SENSORS_LIMIT((480000 + rpm * div / 2) / (rpm * div), 1,
254);
}
#define FAN_FROM_REG(val,div) \
( (val)==0 ? 0 : (val)==255 ? 0 : (960000/((val)*(div))) )
( (val)==0 ? 0 : (val)==255 ? 0 : (480000/((val)*(div))) )
#define IN_TO_REG(val) (SENSORS_LIMIT((((val)*10+8)/19),0,255))
#define IN_FROM_REG(val) (((val)*19)/10)
+2 -2
View File
@@ -87,12 +87,12 @@ static inline u8 FAN_TO_REG(long rpm, int div)
if (rpm == 0)
return 255;
rpm = SENSORS_LIMIT(rpm, 1, 1000000);
return SENSORS_LIMIT((960000 + rpm * div / 2) / (rpm * div), 1,
return SENSORS_LIMIT((480000 + rpm * div / 2) / (rpm * div), 1,
254);
}
#define FAN_FROM_REG(val,div) \
( (val)==0 ? 0 : (val)==255 ? 0 : (960000/((val)*(div))) )
( (val)==0 ? 0 : (val)==255 ? 0 : (480000/((val)*(div))) )
#define IN_TO_REG(val) (SENSORS_LIMIT((((val)*10+8)/19),0,255))
#define IN_FROM_REG(val) (((val)*19)/10)