* [lm-sensors] [PATCH] asus_atk0110: fix limit readings
@ 2009-07-21 9:27 Luca Tettamanti
2009-07-21 10:36 ` Jean Delvare
2009-07-21 10:57 ` Luca Tettamanti
0 siblings, 2 replies; 3+ messages in thread
From: Luca Tettamanti @ 2009-07-21 9:27 UTC (permalink / raw)
To: lm-sensors
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.
Note that the bug is purely cosmetic.
Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Tested-by: Alex Macfarlane Smith <nospam@archifishal.co.uk>
---
drivers/hwmon/asus_atk0110.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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);
Luca
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] asus_atk0110: fix limit readings
2009-07-21 9:27 [lm-sensors] [PATCH] asus_atk0110: fix limit readings Luca Tettamanti
@ 2009-07-21 10:36 ` Jean Delvare
2009-07-21 10:57 ` Luca Tettamanti
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2009-07-21 10:36 UTC (permalink / raw)
To: lm-sensors
Hi Luca,
On Tue, 21 Jul 2009 11:27:42 +0200, Luca Tettamanti wrote:
> 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.
> Note that the bug is purely cosmetic.
I don't see how it would be only cosmetic, if the driver was reporting
wrong upper limits before.
>
> Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
> Tested-by: Alex Macfarlane Smith <nospam@archifishal.co.uk>
> ---
>
> drivers/hwmon/asus_atk0110.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> 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);
>
Applied, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] asus_atk0110: fix limit readings
2009-07-21 9:27 [lm-sensors] [PATCH] asus_atk0110: fix limit readings Luca Tettamanti
2009-07-21 10:36 ` Jean Delvare
@ 2009-07-21 10:57 ` Luca Tettamanti
1 sibling, 0 replies; 3+ messages in thread
From: Luca Tettamanti @ 2009-07-21 10:57 UTC (permalink / raw)
To: lm-sensors
On Tue, Jul 21, 2009 at 12:36 PM, Jean Delvare<khali@linux-fr.org> wrote:
> Hi Luca,
>
> On Tue, 21 Jul 2009 11:27:42 +0200, Luca Tettamanti wrote:
>> 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.
>> Note that the bug is purely cosmetic.
>
> I don't see how it would be only cosmetic, if the driver was reporting
> wrong upper limits before.
I mean that it didn't affect the correct operation of the thresholds
(at least in the firmware).
Luca
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-21 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-21 9:27 [lm-sensors] [PATCH] asus_atk0110: fix limit readings Luca Tettamanti
2009-07-21 10:36 ` Jean Delvare
2009-07-21 10:57 ` Luca Tettamanti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.