Skip to contentSkip to conversation

asus_atk0110: fix limit readings

PATCH Applied Luca Tettamanti 2 participants 3 messages Jul 21, 2009

Subsystems (2)
lore
Share & tools
lore

Luca Tettamanti

author maintainer
#0 lore raw

PATCH 1/1 asus_atk0110: fix limit readings

On newer Asus boards the "upper" limit of a sensor is encoded as delta from the "lower" limit. Fix the driver to correctly handle this case.
Note that the bug is purely cosmetic.

---

 drivers/hwmon/asus_atk0110.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/asus_atk0110.c +5 -1
index bff0103..fe4fa29 100644
@@ -593,7 +593,11 @@ static int atk_add_sensor(struct atk_data *data, union acpi_object *obj)
 	sensor->data = data;
 	sensor->id = flags->integer.value;
 	sensor->limit1 = limit1->integer.value;
-	sensor->limit2 = limit2->integer.value;
+	if (data->old_interface)
+		sensor->limit2 = limit2->integer.value;
+	else
+		/* The upper limit is expressed as delta from lower limit */
+		sensor->limit2 = sensor->limit1 + limit2->integer.value;
 
 	snprintf(sensor->input_attr_name, ATTR_NAME_SIZE,
 			"%s%d_input", base_name, start + *num);

Luca

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Applied
#1 lore raw

Hi Luca,

Quoted 3 lines · Luca Tettamanti

On newer Asus boards the "upper" limit of a sensor is encoded as delta from the "lower" limit. Fix the driver to correctly handle this case.
Note that the bug is purely cosmetic.

I don't see how it would be only cosmetic, if the driver was reporting wrong upper limits before.

Quoted 16 lines

---

 drivers/hwmon/asus_atk0110.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/asus_atk0110.c +0 -0
index bff0103..fe4fa29 100644
@@ -593,7 +593,11 @@ static int atk_add_sensor(struct atk_data *data, union acpi_object *obj)
 	sensor->data = data;
 	sensor->id = flags->integer.value;

drivers/hwmon/asus_atk0110.c static int atk_add_sensor(struct atk_data *data, union acpi_object *obj) · line 603

Quoted 10 lines
drivers/hwmon/asus_atk0110.c +5 -1
 	sensor->limit1 = limit1->integer.value;
-	sensor->limit2 = limit2->integer.value;
+	if (data->old_interface)
+		sensor->limit2 = limit2->integer.value;
+	else
+		/* The upper limit is expressed as delta from lower limit */
+		sensor->limit2 = sensor->limit1 + limit2->integer.value;
 
 	snprintf(sensor->input_attr_name, ATTR_NAME_SIZE,
 			"%s%d_input", base_name, start + *num);

Applied, thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#2 lore raw
In reply to Luca Tettamanti
Quoted 9 lines · Jean Delvare

Hi Luca,

Quoted 3 lines · Luca Tettamanti

On newer Asus boards the "upper" limit of a sensor is encoded as delta from the "lower" limit. Fix the driver to correctly handle this case.
Note that the bug is purely cosmetic.

I don't see how it would be only cosmetic, if the driver was reporting wrong upper limits before.

I mean that it didn't affect the correct operation of the thresholds (at least in the firmware).

Luca

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors