mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-31 13:10:30 +00:00
fix as99127f fan speeds that were 60% low.
This was broken by 2.6.0 because
2.6.0 didn't reset the fan clock setting at startup.
Therefore the AS_FAN_* macros were no longer needed to specially
correct the fan speed. So remove the special handling and the
AS_FAN_* macros and things should work now.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1135 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
5f75cd09b7
commit
1807068ae1
2 files changed
+14
-45
No files matched your search
@@ -19,6 +19,7 @@ ask CVS about it:
|
||||
|
||||
2.6.1 (2001????)
|
||||
Module i2c-ali15x3: Allow force_addr=0xaddr; enable if not enabled.
|
||||
Module w83781d: Fix fan speed for as99127f (broken by 2.6.0)
|
||||
|
||||
2.6.0 (20010612)
|
||||
NOTE: i2c-2.6.0 MUST BE be compiled AND installed first!!!
|
||||
|
||||
+13
-45
@@ -167,18 +167,8 @@ extern inline u8 FAN_TO_REG(long rpm, int div)
|
||||
return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1,
|
||||
254);
|
||||
}
|
||||
extern inline u8 AS_FAN_TO_REG(long rpm, int div)
|
||||
{
|
||||
if (rpm == 0)
|
||||
return 255;
|
||||
rpm = SENSORS_LIMIT(rpm, 1, 1000000);
|
||||
return SENSORS_LIMIT((810000 + rpm * div / 2) / (rpm * div), 1,
|
||||
254);
|
||||
}
|
||||
|
||||
#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div)))
|
||||
#define AS_FAN_FROM_REG(val,div) \
|
||||
((val)==0?-1:(val)==255?0:810000/((val)*(div)))
|
||||
|
||||
#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\
|
||||
((val)+5)/10),0,255))
|
||||
@@ -1320,21 +1310,12 @@ void w83781d_init_client(struct i2c_client *client)
|
||||
w83781d_write_value(client, W83781D_REG_VBAT,
|
||||
(w83781d_read_value(client, W83781D_REG_VBAT) | 0x01));
|
||||
}
|
||||
if (type == as99127f) {
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(1),
|
||||
AS_FAN_TO_REG(W83781D_INIT_FAN_MIN_1, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(2),
|
||||
AS_FAN_TO_REG(W83781D_INIT_FAN_MIN_2, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(3),
|
||||
AS_FAN_TO_REG(W83781D_INIT_FAN_MIN_3, 2));
|
||||
} else {
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(1),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_1, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(2),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_2, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(3),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_3, 2));
|
||||
}
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(1),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_1, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(2),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_2, 2));
|
||||
w83781d_write_value(client, W83781D_REG_FAN_MIN(3),
|
||||
FAN_TO_REG(W83781D_INIT_FAN_MIN_3, 2));
|
||||
|
||||
w83781d_write_value(client, W83781D_REG_TEMP_OVER,
|
||||
TEMP_TO_REG(W83781D_INIT_TEMP_OVER));
|
||||
@@ -1552,29 +1533,16 @@ void w83781d_fan(struct i2c_client *client, int operation, int ctl_name,
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
w83781d_update_client(client);
|
||||
if(data->type == as99127f) {
|
||||
results[0] = AS_FAN_FROM_REG(data->fan_min[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
results[1] = AS_FAN_FROM_REG(data->fan[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
} else {
|
||||
results[0] = FAN_FROM_REG(data->fan_min[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
results[1] = FAN_FROM_REG(data->fan[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
}
|
||||
results[0] = FAN_FROM_REG(data->fan_min[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
results[1] = FAN_FROM_REG(data->fan[nr - 1],
|
||||
DIV_FROM_REG(data->fan_div[nr - 1]));
|
||||
*nrels_mag = 2;
|
||||
} else if (operation == SENSORS_PROC_REAL_WRITE) {
|
||||
if (*nrels_mag >= 1) {
|
||||
if(data->type == as99127f) {
|
||||
data->fan_min[nr - 1] =
|
||||
AS_FAN_TO_REG(results[0],
|
||||
DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
} else {
|
||||
data->fan_min[nr - 1] =
|
||||
FAN_TO_REG(results[0],
|
||||
DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
}
|
||||
data->fan_min[nr - 1] =
|
||||
FAN_TO_REG(results[0],
|
||||
DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
w83781d_write_value(client,
|
||||
W83781D_REG_FAN_MIN(nr),
|
||||
data->fan_min[nr - 1]);
|
||||
|
||||
Reference in new issue
Block a user