ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
commit6501ecaf2e9995300916037766e352f3380ad04e
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, 5 Aug 2007 14:44:58 +0000 (5 11:44 -0300)
tree92e73a4f9581199fecb24b82b88dd3a6faa16a89
parent17d4e86425783285a78e8144777f13a64f3ed298
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