mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-30 21:18:20 +00:00
Resolved old fan_div related bug in lm80 and w83781 modules.
When computing the fan rotation speed, the register value of the dividers was used, instead of the value it represents. I'ev fixed this ages ago for the LM80 driver, but it seems I had forgotten to fix it at other places. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@149 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
dabc5bfbb6
commit
95961de807
5 files changed
+29
-12
No files matched your search
+6
-3
@@ -548,12 +548,15 @@ void lm80_fan(struct i2c_client *client, int operation, int ctl_name,
|
||||
*nrels_mag = 0;
|
||||
else if (operation == SENSORS_PROC_REAL_READ) {
|
||||
lm80_update_client(client);
|
||||
results[0] = FAN_FROM_REG(data->fan_min[nr-1],data->fan_div[nr-1]);
|
||||
results[1] = FAN_FROM_REG(data->fan[nr-1],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) {
|
||||
data->fan_min[nr-1] = FAN_TO_REG(results[0],data->fan_div[nr-1]);
|
||||
data->fan_min[nr-1] = FAN_TO_REG(results[0],
|
||||
DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
lm80_write_value(client,nr==1?LM80_REG_FAN1_MIN:LM80_REG_FAN2_MIN,
|
||||
data->fan_min[nr-1]);
|
||||
}
|
||||
|
||||
@@ -915,12 +915,15 @@ 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);
|
||||
results[0] = FAN_FROM_REG(data->fan_min[nr-1],data->fan_div[nr-1]);
|
||||
results[1] = FAN_FROM_REG(data->fan[nr-1],data->fan_div[nr-1]);
|
||||
results[0] = FAN_FROM_REG(data->fan_min[nr-1],
|
||||
FAN_DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
results[1] = FAN_FROM_REG(data->fan[nr-1],
|
||||
FAN_DIV_FROM_REG(data->fan_div[nr-1]));
|
||||
*nrels_mag = 2;
|
||||
} else if (operation == SENSORS_PROC_REAL_WRITE) {
|
||||
if (*nrels_mag >= 1) {
|
||||
data->fan_min[nr-1] = FAN_TO_REG(results[0],data->fan_div[nr-1]);
|
||||
data->fan_min[nr-1] = FAN_TO_REG(results[0],
|
||||
FAN_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