ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
commitddad7b1589c653be0b324e524b78c6036babd30c
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 16 Jul 2007 18:23:28 +0000 (16 15:23 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 9 Sep 2007 02:15:13 +0000 (8 23:15 -0300)
tree3440f501f0d5ed858d8b33e9b81532a9c1b6beca
parenta9b3f8849d00e1327ed9133d5514d0eb9daa0976
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 <hmh@hmh.eng.br>
Cc: Michael Olbrich <michael.olbrich@gmx.net>
drivers/misc/thinkpad_acpi.c