]> git.sur5r.net Git - groeck-it87/commitdiff
Fix reworked temperature mapping
authorGuenter Roeck <linux@roeck-us.net>
Thu, 21 Sep 2017 05:33:31 +0000 (22:33 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 21 Sep 2017 05:33:31 +0000 (22:33 -0700)
With the reworked temperature mapping it was no longer possible to set
manual mode since the 'automatic' configuration bit was never cleared.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
it87.c

diff --git a/it87.c b/it87.c
index 027ede9d63e81e879f05a7e416eab4814883070d..197c4ff5e14d4defcef3eabb3482ed8d2c440be7 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -1699,6 +1699,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
                        if (has_newer_autopwm(data)) {
                                ctrl = temp_map_to_reg(data, nr,
                                                       data->pwm_temp_map[nr]);
+                               ctrl &= 0x7f;
                        } else {
                                ctrl = data->pwm_duty[nr];
                        }
@@ -1711,7 +1712,9 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
                if (has_newer_autopwm(data)) {
                        ctrl = temp_map_to_reg(data, nr,
                                               data->pwm_temp_map[nr]);
-                       if (val != 1)
+                       if (val == 1)
+                               ctrl &= 0x7f;
+                       else
                                ctrl |= 0x80;
                } else {
                        ctrl = (val == 1 ? data->pwm_duty[nr] : 0x80);