hw/misc/tmp105: reset the T_low and T_High registers
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 17 Nov 2020 12:56:33 +0000 (12:56 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 17 Nov 2020 12:56:33 +0000 (12:56 +0000)
commite1919889ef78144811d8520fa25776fa73feee66
treef2c2d196459109921f5cc35e116d25358932392b
parent13ceae6663450b6e49483bf0dc7f8362a949802d
hw/misc/tmp105: reset the T_low and T_High registers

The TMP105 datasheet (https://www.ti.com/lit/gpn/tmp105) says that the
power-up reset values for the T_low and T_high registers are 80 degrees C
and 75 degrees C, which are 0x500 and 0x4B0 hex according to table 5.  These
values are then shifted right by four bits to give the register reset
values, since both registers store the 12 bits of temperature data in bits
[15..4] of a 16 bit register.

We were resetting these registers to zero, which is problematic for Linux
guests which enable the alert interrupt and then immediately take an
unexpected overtemperature alert because the current temperature is above
freezing...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: C├ędric Le Goater <clg@kaod.org>
Message-id: 20201110150023.25533-2-peter.maydell@linaro.org
hw/misc/tmp105.c