Commit 0512a9a8 authored by Michel Dänzer's avatar Michel Dänzer Committed by Benjamin Herrenschmidt

therm_adt746x: Always clear hardware bit which inverts fan speed range.

This bit would get enabled sometimes (probably after suspend/resume), so the
fan would run at full speed below the temperature thresholds, but slow down and
eventually stop if temperatures rose above the thresholds... not exactly what
you want.
Signed-off-by: default avatarMichel Dänzer <michel@daenzer.net>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent a85c8e17
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#define CONFIG_REG 0x40 #define CONFIG_REG 0x40
#define MANUAL_MASK 0xe0 #define MANUAL_MASK 0xe0
#define AUTO_MASK 0x20 #define AUTO_MASK 0x20
#define INVERT_MASK 0x10
static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */ static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */
static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */ static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */
...@@ -229,7 +230,8 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan) ...@@ -229,7 +230,8 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan)
if (speed >= 0) { if (speed >= 0) {
manual = read_reg(th, MANUAL_MODE[fan]); manual = read_reg(th, MANUAL_MODE[fan]);
write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK); write_reg(th, MANUAL_MODE[fan],
(manual|MANUAL_MASK) & (~INVERT_MASK));
write_reg(th, FAN_SPD_SET[fan], speed); write_reg(th, FAN_SPD_SET[fan], speed);
} else { } else {
/* back to automatic */ /* back to automatic */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment