diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-12 17:27:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-12 17:27:24 -0500 |
commit | 09cea96caa59fabab3030c53bd698b9b568d959a (patch) | |
tree | a991cdc0c887fdcda37f4b751ee98d3db9559f4e /drivers/macintosh/therm_adt746x.c | |
parent | 6eb7365db6f3a4a9d8d9922bb0b800f9cbaad641 (diff) | |
parent | e090aa80321b64c3b793f3b047e31ecf1af9538d (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (151 commits)
powerpc: Fix usage of 64-bit instruction in 32-bit altivec code
MAINTAINERS: Add PowerPC patterns
powerpc/pseries: Track previous CPPR values to correctly EOI interrupts
powerpc/pseries: Correct pseries/dlpar.c build break without CONFIG_SMP
powerpc: Make "intspec" pointers in irq_host->xlate() const
powerpc/8xx: DTLB Miss cleanup
powerpc/8xx: Remove DIRTY pte handling in DTLB Error.
powerpc/8xx: Start using dcbX instructions in various copy routines
powerpc/8xx: Restore _PAGE_WRITETHRU
powerpc/8xx: Add missing Guarded setting in DTLB Error.
powerpc/8xx: Fixup DAR from buggy dcbX instructions.
powerpc/8xx: Tag DAR with 0x00f0 to catch buggy instructions.
powerpc/8xx: Update TLB asm so it behaves as linux mm expects.
powerpc/8xx: Invalidate non present TLBs
powerpc/pseries: Serialize cpu hotplug operations during deactivate Vs deallocate
pseries/pseries: Add code to online/offline CPUs of a DLPAR node
powerpc: stop_this_cpu: remove the cpu from the online map.
powerpc/pseries: Add kernel based CPU DLPAR handling
sysfs/cpu: Add probe/release files
powerpc/pseries: Kernel DLPAR Infrastructure
...
Diffstat (limited to 'drivers/macintosh/therm_adt746x.c')
-rw-r--r-- | drivers/macintosh/therm_adt746x.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 556f0feaa4df..5ff47ba7f2d0 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -79,6 +79,7 @@ struct thermostat { | |||
79 | u8 limits[3]; | 79 | u8 limits[3]; |
80 | int last_speed[2]; | 80 | int last_speed[2]; |
81 | int last_var[2]; | 81 | int last_var[2]; |
82 | int pwm_inv[2]; | ||
82 | }; | 83 | }; |
83 | 84 | ||
84 | static enum {ADT7460, ADT7467} therm_type; | 85 | static enum {ADT7460, ADT7467} therm_type; |
@@ -229,19 +230,23 @@ 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]); |
233 | manual &= ~INVERT_MASK; | ||
232 | write_reg(th, MANUAL_MODE[fan], | 234 | write_reg(th, MANUAL_MODE[fan], |
233 | (manual|MANUAL_MASK) & (~INVERT_MASK)); | 235 | manual | MANUAL_MASK | th->pwm_inv[fan]); |
234 | write_reg(th, FAN_SPD_SET[fan], speed); | 236 | write_reg(th, FAN_SPD_SET[fan], speed); |
235 | } else { | 237 | } else { |
236 | /* back to automatic */ | 238 | /* back to automatic */ |
237 | if(therm_type == ADT7460) { | 239 | if(therm_type == ADT7460) { |
238 | manual = read_reg(th, | 240 | manual = read_reg(th, |
239 | MANUAL_MODE[fan]) & (~MANUAL_MASK); | 241 | MANUAL_MODE[fan]) & (~MANUAL_MASK); |
240 | 242 | manual &= ~INVERT_MASK; | |
243 | manual |= th->pwm_inv[fan]; | ||
241 | write_reg(th, | 244 | write_reg(th, |
242 | MANUAL_MODE[fan], manual|REM_CONTROL[fan]); | 245 | MANUAL_MODE[fan], manual|REM_CONTROL[fan]); |
243 | } else { | 246 | } else { |
244 | manual = read_reg(th, MANUAL_MODE[fan]); | 247 | manual = read_reg(th, MANUAL_MODE[fan]); |
248 | manual &= ~INVERT_MASK; | ||
249 | manual |= th->pwm_inv[fan]; | ||
245 | write_reg(th, MANUAL_MODE[fan], manual&(~AUTO_MASK)); | 250 | write_reg(th, MANUAL_MODE[fan], manual&(~AUTO_MASK)); |
246 | } | 251 | } |
247 | } | 252 | } |
@@ -387,7 +392,7 @@ static int probe_thermostat(struct i2c_client *client, | |||
387 | i2c_set_clientdata(client, th); | 392 | i2c_set_clientdata(client, th); |
388 | th->clt = client; | 393 | th->clt = client; |
389 | 394 | ||
390 | rc = read_reg(th, 0); | 395 | rc = read_reg(th, CONFIG_REG); |
391 | if (rc < 0) { | 396 | if (rc < 0) { |
392 | dev_err(&client->dev, "Thermostat failed to read config!\n"); | 397 | dev_err(&client->dev, "Thermostat failed to read config!\n"); |
393 | kfree(th); | 398 | kfree(th); |
@@ -418,6 +423,10 @@ static int probe_thermostat(struct i2c_client *client, | |||
418 | 423 | ||
419 | thermostat = th; | 424 | thermostat = th; |
420 | 425 | ||
426 | /* record invert bit status because fw can corrupt it after suspend */ | ||
427 | th->pwm_inv[0] = read_reg(th, MANUAL_MODE[0]) & INVERT_MASK; | ||
428 | th->pwm_inv[1] = read_reg(th, MANUAL_MODE[1]) & INVERT_MASK; | ||
429 | |||
421 | /* be sure to really write fan speed the first time */ | 430 | /* be sure to really write fan speed the first time */ |
422 | th->last_speed[0] = -2; | 431 | th->last_speed[0] = -2; |
423 | th->last_speed[1] = -2; | 432 | th->last_speed[1] = -2; |