On second thought, cc'ing Mark; perhaps the following could be extended for a 
way to check for 0 fans, too?
(from [ibm-acpi-devel] [External] Re: [PATCH] Update whitelisted ThinkPad 
models with dual fan support in thinkpad_acpi)

>> Mark, more in general can you perhaps talk to the firmware team and ask
>> if there is a better way to detect if there are 2 fans in a thinkpad then
>> maintaining a quirk table for this ?
>>
> 
> Yeah - I saw the patch and wondered the same. I will look into that
> (LO-1498 for my internal tracking)


Cheers,
Alex


On 1/12/22 12:18, Alexander Kobel wrote:
> 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-ko...@a-kobel.de>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index e03df2881dc6..7dbe4061bc8a 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8767,9 +8767,10 @@ static const struct attribute_group fan_attr_group = {
>       .attrs = fan_attributes,
>  };
>  
> -#define TPACPI_FAN_Q1        0x0001          /* Unitialized HFSP */
> -#define TPACPI_FAN_2FAN      0x0002          /* EC 0x31 bit 0 selects fan2 */
> -#define TPACPI_FAN_2CTL      0x0004          /* selects fan2 control */
> +#define TPACPI_FAN_Q1                0x0001          /* Uninitialized HFSP */
> +#define TPACPI_FAN_2FAN              0x0002          /* EC 0x31 bit 0 
> selects fan2 */
> +#define TPACPI_FAN_2CTL              0x0004          /* selects fan2 control 
> */
> +#define TPACPI_FAN_NOFAN     0x0008          /* no fan available */
>  
>  static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
>       TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
> @@ -8787,6 +8788,7 @@ static const struct tpacpi_quirk fan_quirk_table[] 
> __initconst = {
>       TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (2nd 
> gen) */
>       TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (3nd 
> gen) */
>       TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL),  /* P15 (1st gen) / P15v 
> (1st gen) */
> +     TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) 
> */
>  };
>  
>  static int __init fan_init(struct ibm_init_struct *iibm)
> @@ -8816,6 +8818,11 @@ static int __init fan_init(struct ibm_init_struct 
> *iibm)
>       quirks = tpacpi_check_quirks(fan_quirk_table,
>                                    ARRAY_SIZE(fan_quirk_table));
>  
> +     if (quirks & TPACPI_FAN_NOFAN) {
> +             pr_info("No integrated ThinkPad fan available\n");
> +             return 1;
> +     }
> +
>       if (gfan_handle) {
>               /* 570, 600e/x, 770e, 770x */
>               fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN;
> 
> 
> 
> _______________________________________________
> ibm-acpi-devel mailing list
> ibm-acpi-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

Reply via email to