diff options
author | Luca Tettamanti <kronos.it@gmail.com> | 2009-07-28 16:31:39 +0200 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-07-28 16:31:39 +0200 |
commit | 8d282497cbf8124d6814d51a74fb13d69531c669 (patch) | |
tree | 82680b36cbe2f599069d4effa4d941648d0c4c51 /drivers/hwmon/asus_atk0110.c | |
parent | 1b54ab450b180eaeeb0eee6f0f64349246a22c14 (diff) | |
download | op-kernel-dev-8d282497cbf8124d6814d51a74fb13d69531c669.zip op-kernel-dev-8d282497cbf8124d6814d51a74fb13d69531c669.tar.gz |
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>
Diffstat (limited to 'drivers/hwmon/asus_atk0110.c')
-rw-r--r-- | drivers/hwmon/asus_atk0110.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index bff0103..fe4fa29 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -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); |