ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
commit722f29626df9675d92cd6871ce48c8d09aa10d0e
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 16 Jul 2007 21:23:28 +0000 (16 18:23 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 11 Feb 2008 17:21:57 +0000 (11 15:21 -0200)
treed3b977b70ec4e4922b94482a81582f1e04dbc52b
parenta930ff4d8d03befdeb0ded563fcc18fce686a5cb
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