From: Guenter Roeck Date: Wed, 25 Apr 2018 00:59:23 +0000 (-0700) Subject: Add optional 49 degrees C temperature offset X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fd93b8bc15ec768915f5567fc86432d50594e25a;p=groeck-k10temp 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 --- 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