]> git.karo-electronics.de Git - karo-tx-linux.git/commit
powerpc/therm_adt746x: Record pwm invert bit at module load time]
authorDarrick J. Wong <djwong@us.ibm.com>
Thu, 3 Dec 2009 16:19:59 +0000 (16:19 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:44:24 +0000 (13:44 -0800)
commit0b1b72ba20a7d73136f57bb57ff8e2f3f79e62ad
tree1161ac0887c50e11aaf871d4f3618e666aef7a38
parent178b0bc768f87d3b1d32af590204d8162b517bf4
powerpc/therm_adt746x: Record pwm invert bit at module load time]

commit 1496e89ae2a0962748e55165a590fa3209c6f158 upstream.

In commit 0512a9a8e277a9de2820211eef964473b714ae65, we unilaterally zero the
"pwm invert" bit in the fan behavior configuration register.  On my PowerBook
G4, this results in the fans going to full speed at low temperature and
shutting off at high temperature because the pwm invert bit is supposed to be
set.

Therefore, record the pwm invert bit at driver load time, and write the bit
into the fan behavior control register.  This restores correct behavior on my
PBG4 and should work around the bit being set to the wrong value after
suspend/resume (which is what the original patch was trying to fix).  It also
fixes a minor omission where the pwm invert bit correction is NOT performed
when switching into automatic mode.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/macintosh/therm_adt746x.c