ACPI: thinkpad-acpi: make sure DSDT TMPx readings don't return +128
commit7ca31140585dfd8ad60fdf51f38158d1a5e87ae0
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>
Mon, 23 Jul 2007 07:43:33 +0000 (23 04:43 -0300)
treefadc7a615be3db9c184a1059a7ff263d23b430df
parent34af8cea1fe3b6bfe1ae63cab11b95d84b10bfbf
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