Commit 8d282497 authored by Luca Tettamanti's avatar Luca Tettamanti Committed by Jean Delvare

hwmon: (asus_atk0110) Fix upper 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.
Signed-off-by: default avatarLuca Tettamanti <kronos.it@gmail.com>
Tested-by: default avatarAlex Macfarlane Smith <nospam@archifishal.co.uk>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 1b54ab45
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment