platform/x86: thinkpad_acpi: Add dual fan probe
authorMark Pearson <markpearson@lenovo.com>
Tue, 22 Feb 2022 18:51:37 +0000 (13:51 -0500)
committerHans de Goede <hdegoede@redhat.com>
Wed, 2 Mar 2022 10:42:36 +0000 (11:42 +0100)
commitbf779aaf56ea23864e39e9862b3b3a8436236e07
tree2bdf5faa1597698d89c68f979eb32a3db400ffad
parent402576d9804e9dc9b31af4e3613aa8da9ebce84e
platform/x86: thinkpad_acpi: Add dual fan probe

Instead of having quirks for systems that have a second fan it would
be nice to detect this setup.
Unfortunately, confirmed by the Lenovo FW team, there is no way to
retrieve this information from the EC or BIOS. Recommendation was to
attempt to read the fan and if successful then assume a 2nd fan is
present.

The fans are also supposed to spin up on boot for some time, so in
theory we could check for a speed > 0. In testing this seems to hold
true but as I couldn't test on all platforms I've avoided implementing
this. It also breaks for the corner case where you load the module
once the fans are idle.

Tested on P1G4, P1G3, X1C9 and T14 (no fans) and it works correctly.
For the platforms with dual fans where it was confirmed to work I have
removed the quirks. Potentially this could be done for all platforms
but I've left untested platforms in for now. On these platforms the
fans will be enabled and then detected - so no impact.

Signed-off-by: Mark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/20220222185137.4325-1-markpearson@lenovo.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/thinkpad_acpi.c