thinkpad-acpi: support the second fan on the X61
commitc09b8c8417f4b0a8225680dc5b9c89fbbb721959
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:22:04 +0000 (13 09:22 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:22:04 +0000 (13 09:22 -0300)
tree8f3988edfa28891845f86fbd4c399b9b0833e18b
parent9ba2292a30e8aaa820c8c5e99fad7f4159b1ecce
thinkpad-acpi: support the second fan on the X61

Support reading the tachometer of the auxiliary fan of a X60/X61.

It was found out by sheer luck, that bit 0 of EC register 0x31
(formely HBRV) selects which fan is active for tachometer readings
through EC 0x84/0x085: 0 for fan1, 1 for fan2.

Many thanks to Christoph Klünter, to Whoopie, and to weasel, who
helped confirm that behaviour.

Fan control through EC HFSP applies to both fans equally, regardless
of the state of bit 0 of EC 0x31.  That matches the way the DSDT uses
HFSP.

In order to better support the secondary fan, export a second
tachometer over hwmon, and add defensive measures to make sure we are
reading the correct tachometer.

Support for the second fan is whitelist-based, as I have not found
anything obvious to look for in the DSDT to detect the presence of
the second fan.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Documentation/laptops/thinkpad-acpi.txt
drivers/platform/x86/thinkpad_acpi.c