Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a8fba3da3d11d808137be7ebeb3b6938a42f011f
Commit:     a8fba3da3d11d808137be7ebeb3b6938a42f011f
Parent:     edf0e0e56904f794c97ca6c4562d8256e3d8d8e3
Author:     Henrique de Moraes Holschuh <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 23:45:45 2007 -0300
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Jul 21 23:49:55 2007 -0400

    ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
    
    We get +128 instead of -128 from the DSDT TMPx methods, due to errors when
    converting a EC byte return that is a s8 to an ACPI handler return that is
    an int.
    
    Fix it once and for all, by clamping acceptable temperature readings from
    DSDT TMPx so that anything outside the [-127,+127] range is converted to
    TP_EC_THERMAL_TMP_NA (-128).
    
    Signed-off-by: Henrique de Moraes Holschuh <[EMAIL PROTECTED]>
    Cc: Michael Olbrich <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/misc/thinkpad_acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 623d36f..f74d7d6 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2853,6 +2853,8 @@ static int thermal_get_sensor(int idx, s32 *value)
                        snprintf(tmpi, sizeof(tmpi), "TMP%c", '0' + idx);
                        if (!acpi_evalf(ec_handle, &t, tmpi, "d"))
                                return -EIO;
+                       if (t > 127 || t < -127)
+                               t = TP_EC_THERMAL_TMP_NA;
                        *value = t * 1000;
                        return 0;
                }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to