powerpc/therm_adt746x: Record pwm invert bit at module load time]
commit6b3f68aeeae30d18186a844c92bf3269e3226f51
authorDarrick J. Wong <djwong@us.ibm.com>
Thu, 3 Dec 2009 16:19:59 +0000 (3 16:19 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:04:32 +0000 (18 14:04 -0800)
treec0386d7a41aca05a9dd5f7f5be1963db9596b739
parentd5f60d19405b2b8c338be1c70f013d39a40d049d
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