From fd93b8bc15ec768915f5567fc86432d50594e25a Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 24 Apr 2018 17:59:23 -0700 Subject: [PATCH] Add optional 49 degrees C temperature offset If bit 20 of the temperature register is set, there is an additional temperature offset of 49 degrees C. Signed-off-by: Guenter Roeck --- k10temp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/k10temp.c b/k10temp.c index 4cefd7e..e4a179d 100644 --- a/k10temp.c +++ b/k10temp.c @@ -130,6 +130,9 @@ static ssize_t temp1_input_show(struct device *dev, data->read_tempreg(data->pdev, ®val); temp = (regval >> 21) * 125; + /* bit 20 indicates an additional temp offset of 49 degrees C */ + if (regval & 0x80000) + temp -= 49000; if (temp > data->temp_offset) temp -= data->temp_offset; else -- 2.39.5