summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLuca Tettamanti <kronos.it@gmail.com>2009-07-28 16:31:39 +0200
committerJean Delvare <khali@linux-fr.org>2009-07-28 16:31:39 +0200
commit8d282497cbf8124d6814d51a74fb13d69531c669 (patch)
tree82680b36cbe2f599069d4effa4d941648d0c4c51 /drivers/hwmon
parent1b54ab450b180eaeeb0eee6f0f64349246a22c14 (diff)
downloadlinux-8d282497cbf8124d6814d51a74fb13d69531c669.tar.bz2
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')
-rw-r--r--drivers/hwmon/asus_atk0110.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index bff0103610c1..fe4fa29c9219 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);