mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-23 11:54:33 +00:00
fix off-by-one bug in sensor type reads/writes in mtp008.
you would get the wrong sensor. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1079 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
448343fd11
commit
43500d6139
2 files changed
+18
-24
No files matched your search
@@ -41,7 +41,8 @@ ask CVS about it:
|
||||
Module lm78: Recognize chipid=0x20
|
||||
Module lm87: Fix in0, in1 (2.5V and Vccp1) calculations
|
||||
Module mtp008: Fix temp initializations;
|
||||
Save BIOS pin configuration of temps and fans
|
||||
Save BIOS pin configuration of temps and fans;
|
||||
Fix sensor type reads/writes
|
||||
Module sensors: Disabled, moved to i2c package as i2c-proc.c
|
||||
Module sis5595: Fix temp, add in4 for chip revision 0xc0;
|
||||
Allow force_addr=0xaddr
|
||||
|
||||
+16
-23
@@ -1096,7 +1096,7 @@ void mtp008_sens(struct i2c_client *client, int operation, int ctl_name,
|
||||
u8 tmp;
|
||||
struct mtp008_data *data;
|
||||
|
||||
nr = ctl_name - MTP008_SYSCTL_SENS1;
|
||||
nr = 1 + ctl_name - MTP008_SYSCTL_SENS1;
|
||||
data = client->data;
|
||||
|
||||
switch (operation) {
|
||||
@@ -1105,7 +1105,7 @@ void mtp008_sens(struct i2c_client *client, int operation, int ctl_name,
|
||||
|
||||
break;
|
||||
case SENSORS_PROC_REAL_READ:
|
||||
results[0] = data->sens[nr];
|
||||
results[0] = data->sens[nr - 1];
|
||||
|
||||
*nrels_mag = 1;
|
||||
|
||||
@@ -1122,16 +1122,14 @@ void mtp008_sens(struct i2c_client *client, int operation, int ctl_name,
|
||||
case THERMISTOR:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp & ~MTP008_CFG_VT1_PII
|
||||
);
|
||||
data->sens[nr] = 2;
|
||||
tmp & ~MTP008_CFG_VT1_PII);
|
||||
data->sens[0] = 2;
|
||||
break;
|
||||
case PIIDIODE:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp | MTP008_CFG_VT1_PII
|
||||
);
|
||||
data->sens[nr] = 3;
|
||||
tmp | MTP008_CFG_VT1_PII);
|
||||
data->sens[0] = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1144,23 +1142,20 @@ void mtp008_sens(struct i2c_client *client, int operation, int ctl_name,
|
||||
case VOLTAGE:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp | MTP008_CFG_VT2_AIN
|
||||
);
|
||||
data->sens[nr] = 1;
|
||||
tmp | MTP008_CFG_VT2_AIN);
|
||||
data->sens[1] = 1;
|
||||
break;
|
||||
case THERMISTOR:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp | MTP008_CFG_VT2_VT
|
||||
);
|
||||
data->sens[nr] = 2;
|
||||
tmp | MTP008_CFG_VT2_VT);
|
||||
data->sens[1] = 2;
|
||||
break;
|
||||
case PIIDIODE:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp | MTP008_CFG_VT2_PII
|
||||
);
|
||||
data->sens[nr] = 3;
|
||||
tmp | MTP008_CFG_VT2_PII);
|
||||
data->sens[1] = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1172,16 +1167,14 @@ void mtp008_sens(struct i2c_client *client, int operation, int ctl_name,
|
||||
case VOLTAGE:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp & ~MTP008_CFG_VT3_VT
|
||||
);
|
||||
data->sens[nr] = 1;
|
||||
tmp & ~MTP008_CFG_VT3_VT);
|
||||
data->sens[2] = 1;
|
||||
break;
|
||||
case THERMISTOR:
|
||||
mtp008_write_value(
|
||||
client, MTP008_REG_PIN_CTRL2,
|
||||
tmp | MTP008_CFG_VT3_VT
|
||||
);
|
||||
data->sens[nr] = 2;
|
||||
tmp | MTP008_CFG_VT3_VT);
|
||||
data->sens[2] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user