From: Guenter Roeck Date: Thu, 8 Feb 2018 01:58:40 +0000 (-0800) Subject: Fix 1600X model, and don't report negative temperatures X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c5183f6d0c48babfe722c54066b5d87cef349248;p=groeck-k10temp Fix 1600X model, and don't report negative temperatures Signed-off-by: Guenter Roeck --- diff --git a/k10temp.c b/k10temp.c index c62ffe8..4c6594a 100644 --- a/k10temp.c +++ b/k10temp.c @@ -81,7 +81,7 @@ struct tctl_offset { }; static const struct tctl_offset tctl_offset_table[] = { - { 0x17, "AMD Ryzen 7 1600X", 20000 }, + { 0x17, "AMD Ryzen 5 1600X", 20000 }, { 0x17, "AMD Ryzen 7 1700X", 20000 }, { 0x17, "AMD Ryzen 7 1800X", 20000 }, { 0x17, "AMD Ryzen Threadripper 1950X", 27000 }, @@ -129,7 +129,10 @@ static ssize_t temp1_input_show(struct device *dev, data->read_tempreg(data->pdev, ®val); temp = (regval >> 21) * 125; - temp -= data->temp_offset; + if (temp > data->temp_offset) + temp -= data->temp_offset; + else + temp = 0; return sprintf(buf, "%u\n", temp); }