mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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: Luca Tettamanti <kronos.it@gmail.com> Tested-by: Alex Macfarlane Smith <nospam@archifishal.co.uk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
parent
1b54ab450b
commit
8d282497cb
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue