platform/x86: thinkpad_acpi: Add 2nd Fan Support for Thinkpad P50
authorAlexander Kappner <agk@godking.net>
Mon, 2 Apr 2018 18:27:01 +0000 (11:27 -0700)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 3 Apr 2018 08:06:04 +0000 (11:06 +0300)
The Thinkpad P50 has 2 fans. Add the 2FAN quirk so the tpacpi driver
properly reports both fan speeds.
Because the P50 doesn't report the version of its EC controller,
we need to identify it by BIOS version (N1).

Signed-off-by: Alexander Kappner <agk@godking.net>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
[andy: renamed macro, massaged changelog]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c

index d5eaf3b1edba91d53723fddd0c2b49125fd64b9d..761a0ba98fc915b3bc8afb603c6ca910d1cfbfb1 100644 (file)
@@ -8699,16 +8699,24 @@ static const struct attribute_group fan_attr_group = {
          .ec = TPID(__id1, __id2),             \
          .quirks = __quirks }
 
+#define TPACPI_FAN_QB(__id1, __id2, __quirks)  \
+       { .vendor = PCI_VENDOR_ID_LENOVO,       \
+         .bios = TPID(__id1, __id2),           \
+         .ec = TPACPI_MATCH_ANY,               \
+         .quirks = __quirks }
+
 static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
        TPACPI_FAN_QI('1', 'Y', TPACPI_FAN_Q1),
        TPACPI_FAN_QI('7', '8', TPACPI_FAN_Q1),
        TPACPI_FAN_QI('7', '6', TPACPI_FAN_Q1),
        TPACPI_FAN_QI('7', '0', TPACPI_FAN_Q1),
        TPACPI_FAN_QL('7', 'M', TPACPI_FAN_2FAN),
+       TPACPI_FAN_QB('N', '1', TPACPI_FAN_2FAN),
 };
 
 #undef TPACPI_FAN_QL
 #undef TPACPI_FAN_QI
+#undef TPACPI_FAN_QB
 
 static int __init fan_init(struct ibm_init_struct *iibm)
 {