From c5183f6d0c48babfe722c54066b5d87cef349248 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 7 Feb 2018 17:58:40 -0800 Subject: [PATCH] Fix 1600X model, and don't report negative temperatures Signed-off-by: Guenter Roeck --- k10temp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); } -- 2.39.5