]> Git Repo - linux.git/commitdiff
hwmon: (asus_atk0110) Fix upper limit readings
authorLuca Tettamanti <[email protected]>
Tue, 28 Jul 2009 14:31:39 +0000 (16:31 +0200)
committerJean Delvare <[email protected]>
Tue, 28 Jul 2009 14:31:39 +0000 (16:31 +0200)
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.

Signed-off-by: Luca Tettamanti <[email protected]>
Tested-by: Alex Macfarlane Smith <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
drivers/hwmon/asus_atk0110.c

index bff0103610c17ada5bf070cb49a5f95871967678..fe4fa29c9219b9884e2e55065728920240a55e14 100644 (file)
@@ -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);
This page took 0.056567 seconds and 4 git commands to generate.