From 71826085db0fc343eac84d153018c6ee2b96629e Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 29 May 2018 12:26:50 -0700 Subject: [PATCH] Fix temperature type for peci/amdtsi if diode/thermistor is also set PECI / AMDTSI has higher priority than thermal diode/thermistor settings. Always report PECI/AMDTSI if it is enabled on a given port. Signed-off-by: Guenter Roeck --- it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it87.c b/it87.c index ca68788..9d4c4ce 100644 --- a/it87.c +++ b/it87.c @@ -1535,7 +1535,7 @@ static int get_temp_type(struct it87_data *data, int index) if ((has_temp_peci(data, index) && (reg >> 6 == index + 1)) || (has_temp_old_peci(data, index) && (extra & 0x80))) type = ttype; /* Intel PECI or AMDTSI */ - if (reg & BIT(index)) + else if (reg & BIT(index)) type = 3; /* thermal diode */ else if (reg & BIT(index + 3)) type = 4; /* thermistor */ -- 2.39.2