aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2009-05-22 06:59:10 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-01 20:32:44 -0400
commit0512a9a8e277a9de2820211eef964473b714ae65 (patch)
tree04d6dbf1c43b981fd24649302d4ae08401316255
parenta85c8e17587e81e1c82f6f341a81e4c778fa65f6 (diff)
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: Michel Dänzer <michel@daenzer.net> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--drivers/macintosh/therm_adt746x.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index c0621d50c8a..0ddf9044948 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -37,6 +37,7 @@
37#define CONFIG_REG 0x40 37#define CONFIG_REG 0x40
38#define MANUAL_MASK 0xe0 38#define MANUAL_MASK 0xe0
39#define AUTO_MASK 0x20 39#define AUTO_MASK 0x20
40#define INVERT_MASK 0x10
40 41
41static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */ 42static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */
42static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */ 43static 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 230
230 if (speed >= 0) { 231 if (speed >= 0) {
231 manual = read_reg(th, MANUAL_MODE[fan]); 232 manual = read_reg(th, MANUAL_MODE[fan]);
232 write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK); 233 write_reg(th, MANUAL_MODE[fan],
234 (manual|MANUAL_MASK) & (~INVERT_MASK));
233 write_reg(th, FAN_SPD_SET[fan], speed); 235 write_reg(th, FAN_SPD_SET[fan], speed);
234 } else { 236 } else {
235 /* back to automatic */ 237 /* back to automatic */