Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: thinkpad_acpi: Add quirk for ThinkPads without a fan

Some ThinkPad models, like the X1 Tablet 1st and 2nd Gen, are passively
cooled without any fan. Currently, an entry in /proc/acpi/ibm/fan is
nevertheless created, and misleadingly shows
status: enabled
speed: 65535
level: auto

This patch adds a TPACPI_FAN_NOFAN quirk definition and corresponding
handling to not initialize a fan interface at all.

For the time being, the quirk is only applied for X1 Tablet 2nd Gen
(types 20JB, 20JC; EC N1O...); further models (such as Gen1, types 20GG
and 20GH) can be added easily once tested.

Tested on a 20JCS00C00, BIOS N1OET58W (1.43), EC N1OHT34W.

Signed-off-by: Alexander Kobel <a-kobel@a-kobel.de>
Link: https://lore.kernel.org/r/12d4b825-a2b9-8cb7-6ed3-db4d66f46a60@a-kobel.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Alexander Kobel and committed by
Hans de Goede
b288420e 512eb73c

+10 -3
+10 -3
drivers/platform/x86/thinkpad_acpi.c
··· 8679 8679 .attrs = fan_driver_attributes, 8680 8680 }; 8681 8681 8682 - #define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */ 8683 - #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */ 8684 - #define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */ 8682 + #define TPACPI_FAN_Q1 0x0001 /* Uninitialized HFSP */ 8683 + #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */ 8684 + #define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */ 8685 + #define TPACPI_FAN_NOFAN 0x0008 /* no fan available */ 8685 8686 8686 8687 static const struct tpacpi_quirk fan_quirk_table[] __initconst = { 8687 8688 TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1), ··· 8703 8702 TPACPI_Q_LNV3('N', '4', '0', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (4nd gen) */ 8704 8703 TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL), /* P15 (1st gen) / P15v (1st gen) */ 8705 8704 TPACPI_Q_LNV3('N', '3', '2', TPACPI_FAN_2CTL), /* X1 Carbon (9th gen) */ 8705 + TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */ 8706 8706 }; 8707 8707 8708 8708 static int __init fan_init(struct ibm_init_struct *iibm) ··· 8731 8729 8732 8730 quirks = tpacpi_check_quirks(fan_quirk_table, 8733 8731 ARRAY_SIZE(fan_quirk_table)); 8732 + 8733 + if (quirks & TPACPI_FAN_NOFAN) { 8734 + pr_info("No integrated ThinkPad fan available\n"); 8735 + return -ENODEV; 8736 + } 8734 8737 8735 8738 if (gfan_handle) { 8736 8739 /* 570, 600e/x, 770e, 770x */