]> git.sur5r.net Git - groeck-it87/commitdiff
Fix temperature type for peci/amdtsi if diode/thermistor is also set
authorGuenter Roeck <linux@roeck-us.net>
Tue, 29 May 2018 19:26:50 +0000 (12:26 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 29 May 2018 19:26:50 +0000 (12:26 -0700)
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 <linux@roeck-us.net>
it87.c

diff --git a/it87.c b/it87.c
index ca687886a7f5258b41caa8631cb19c0976cca2fa..9d4c4cea5b30edc6c3b62f2b91f10f7b5df869b9 100644 (file)
--- 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 */