hwmon: (yogafan) Add support for new Lenovo models
Subsystems (3)
Sergio Melas
maintainerPATCH 1/1 hwmon: (yogafan) Add support for new Lenovo models
Add DMI quirk entries and map correct ACPI paths and configurations for additional Lenovo laptop models including the LOQ 15IAX9, XiaoXin Pro 13ARE 2020, IdeaPad 3 15ALC6, Legion Pro 7 16AFR10H, Yoga Pro 7 14IAH10, and Yoga 7 16ARP8.
Reorder the DMI quirk table to evaluate specific model matches before generic family fallbacks, preventing DMI shadowing.
--- Documentation/hwmon/yogafan.rst | 27 ++++++++++++- drivers/hwmon/yogafan.c | 69 +++++++++++++++++++++++++++++---- 2 files changed, 87 insertions(+), 9 deletions(-)
Documentation/hwmon/yogafan.rst +26 -1
@@ -99,6 +99,11 @@ immediately to ensure the user knows the fan has stopped. 82XV / 83DV | LOQ 15/16 | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FANS /FA2S | 16-bit | 1 83AK | ThinkBook G6 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100 81X1 | Flex 5 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100 + 83KF | XiaoXinPro 13ARE | 0x06/0xFE | \_SB.PCI0.LPC0.EC0.FANS/FA2S | 8-bit | 100 + 82KU | IdeaPad 3 15ALC6 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100 + 83RU | Legion Pro 7 16 | 0x03/0x06 | \_SB.PCI0.LPC0.EC0.FANS/FA2S | 8-bit | 100 + 83KF | Yoga Pro 7 14IAH | 0x06 | \_SB.PC00.LPCB.EC0.FANS | 8-bit | 100 + 83BS | Yoga 7 16ARP8 | 0x03/0x06 | \_SB.PCI0.LPC0.EC0.FANS/FA2S | 8-bit | 100 *Legacy* | Pre-2020 Models | 0x06 | \_SB.PCI0.LPC.EC.FAN0 | 8-bit | 100 ----------------------------------------------------------------------------------------------------
@@ -117,7 +122,6 @@ METHODOLOGY & IDENTIFICATION: - 8-bit (Multiplier 100): Standard for Yoga/IdeaPad. Raw values (0-255). - 16-bit (Multiplier 1): Standard for Legion/LOQ. Two registers (0xFE/0xFF). - References ----------
@@ -136,3 +140,24 @@ References 4. **Lenovo IdeaPad Laptop Driver:** Reference for DMI-based hardware feature gating in Lenovo laptops. https://github.com/torvalds/linux/blob/master/drivers/platform/x86/lenovo/ideapad-laptop.c + +5. **Lenovo Product Specifications Reference (PSREF):** Official hardware layout index + and spec sheets for active and withdrawn Lenovo laptop models. + https://psref.lenovo.com/l/withdrawn/ + +6. **Yogafan Master Quirk Database:** Master spreadsheet mapping Lenovo Product + Specifications Reference (PSREF) to explicit EC offsets, register widths, paths, and multipliers. + https://github.com/sergiomelas/lenovo-linux-drivers/blob/main/Lenovo_Drivers/Prototype/PSREF/yogafan_v3_quirks_database.ods + +7. **Yogafan ACPI DSDT Repository:** Central repository containing user-contributed raw + and decompiled ACPI DSDT firmware dumps used for path verification and hardware expansions. + https://github.com/sergiomelas/lenovo-linux-drivers/tree/main/Lenovo_Drivers/Prototype/DSDT + +Contributors & DSDT Providers: +------------------------------ +- **Sarbajit Sarkar** (Lenovo LOQ 15IAX9) +- **HinataKato** (XiaoXin Pro 13ARE 2020 - 83KF) +- **PenPenIsGod** (IdeaPad 3 15ALC6 - 82KU & Legion Pro 7 16AFR10H - 83RU) +- **unlockxiaom** (Legion Pro 7 16AFR10H - 83RU, Yoga Pro 7 14IAH10 - 83KF, ThinkCentre M80q) +- **Phani Pavan K** (Yoga Pro 7 14IAH10 - 83KF) +- **Splarkszter** (Yoga 7 16ARP8 - 83BS)
drivers/hwmon/yogafan.c +61 -8
93 lines not on this page · raw message
Signature · 1 line
2.55.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Specific Lenovo model DMI quirks incorrectly use `DMI_PRODUCT_FAMILY` for exact model string…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Specific Lenovo model DMI quirks incorrectly use DMI_PRODUCT_FAMILY for exact model string matching, causing all specific quirks to fail and fall back to incorrect generic profiles. --
--- Patch [1]: [PATCH] hwmon: (yogafan) Add support for new Lenovo models --- commit ea309cfac96f236f87726dc09f574a3015681685
Author: Sergio Melas <[email protected]>
hwmon: (yogafan) Add support for new Lenovo models
This patch adds DMI quirk entries mapping correct ACPI paths and configurations for several additional Lenovo laptop models. It also reorders the quirk table to evaluate specific model matches before generic family fallbacks to prevent DMI shadowing.
Quoted 4 lines
drivers/hwmon/yogafan.c +0
-0
[ ... ]
Quoted 4 lines
drivers/hwmon/yogafan.c +0
-0@@ -176,6 +189,54 @@ static const struct hwmon_chip_info yoga_fan_chip_info = { };static const struct dmi_system_id yogafan_quirks[] = {
[ ... ]
drivers/hwmon/yogafan.c static const struct hwmon_chip_info yoga_fan_chip_info = { · line 212
Quoted 5 lines
drivers/hwmon/yogafan.c +5
-0+ { + .ident = "Lenovo IdeaPad 3 15ALC6", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_FAMILY, "IdeaPad 3 15ALC6"),
[Severity: High]
Does this correctly match the hardware?
Lenovo firmware typically populates DMI_PRODUCT_FAMILY with short generic strings (e.g., "IdeaPad"). Since dmi_first_match() uses strstr() to find the quirk string inside the hardware string, searching for a long specific string like "IdeaPad 3 15ALC6" inside "IdeaPad" will always fail.
Should this match against DMI_PRODUCT_VERSION or DMI_PRODUCT_NAME instead?
drivers/hwmon/yogafan.c static const struct hwmon_chip_info yoga_fan_chip_info = { · line 220
Quoted 8 lines
drivers/hwmon/yogafan.c +8
-0+ }, + .driver_data = (void *)&ideapad_8bit_fan0_cfg, + }, + { + .ident = "Lenovo Legion Pro 7 16AFR10H", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_FAMILY, "Legion Pro 7 16AFR10H"),
[Severity: High]
If this match fails for the same reason, the hardware would fall back to the generic "Legion" quirk at the bottom of the table.
Because the generic profile specifies a multiplier of 1 instead of 100, wouldn't this result in wildly incorrect sensor readings for this hardware?
drivers/hwmon/yogafan.c static const struct hwmon_chip_info yoga_fan_chip_info = { · line 228
Quoted 8 lines
drivers/hwmon/yogafan.c +8
-0+ }, + .driver_data = (void *)&xiaoxin_8bit_dual_cfg, + }, + { + .ident = "Lenovo Yoga Pro 7 14IAH10", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga Pro 7 14IAH10"),
[Severity: High]
Similarly, if this match fails and falls back to the generic "Yoga" quirk, the driver would attempt to use the PCI0.LPC0 ACPI path instead of PC00.LPCB. Could this cause the driver to fail to probe on this device?
Quoted 1 line
drivers/hwmon/yogafan.c +1
-0+ },
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Guenter Roeck
maintainerSergio,
Quoted 3 lines · On 8/6/26 06:24, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Specific Lenovo model DMI quirks incorrectly useDMI_PRODUCT_FAMILYfor exact model string matching, causing all specific quirks to fail and fall back to incorrect generic profiles. --
Please confirm that this is a non-issue.
Thanks,
Guenter
Sergio Melas
maintainerHi Guenter,
Confirming that at my knowledge this is a non-issue. However, using the 4-letter machine type code DMI_PRODUCT_NAME could theoretically
offer even tighter precision, but up to now, the current matching method has never failed in our
testing and field deployment users of my github:
https://github.com/sergiomelas/lenovo-linux-drivers/tree/main
Anyway, I am compiling a full database for complete data of Lenovo machines from PSREF:
https://psref.lenovo.com/
For reference, the complete mapping matrix and DSDT traces can be found in the Yogafan Master Quirk Database.
My database on based on this source and others is here:
https://github.com/sergiomelas/lenovo-linux-drivers/blob/main/Lenovo_Drivers/Prototype/PSREF/yogafan_v3_quirks_database.ods
and
https://github.com/sergiomelas/lenovo-linux-drivers/tree/main/Lenovo_Drivers/Prototype/DSDT
I propose to switch to this identification method when we have more machine references.
What do yo think?
Thanks, Sergio
Quoted 13 lines · Guenter Roeck
Sergio,
Quoted 3 lines · On 8/6/26 06:24, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Specific Lenovo model DMI quirks incorrectly useDMI_PRODUCT_FAMILYfor exact model string matching, causing all specific quirks to fail and fall back to incorrect generic profiles. --Please confirm that this is a non-issue.
Thanks,
Guenter
Guenter Roeck
maintainerQuoted 20 lines · Sergio Melas
Hi Guenter,
Confirming that at my knowledge this is a non-issue. However, using the 4-letter machine type code
DMI_PRODUCT_NAMEcould theoretically
offer even tighter precision, but up to now, the current matching method has never failed in our
testing and field deployment users of my github:
https://github.com/sergiomelas/lenovo-linux-drivers/tree/mainAnyway, I am compiling a full database for complete data of Lenovo machines from PSREF:
https://psref.lenovo.com/
For reference, the complete mapping matrix and DSDT traces can be found in the Yogafan Master Quirk Database.
My database on based on this source and others is here:
https://github.com/sergiomelas/lenovo-linux-drivers/blob/main/Lenovo_Drivers/Prototype/PSREF/yogafan_v3_quirks_database.ods
and
https://github.com/sergiomelas/lenovo-linux-drivers/tree/main/Lenovo_Drivers/Prototype/DSDT
Quoted 4 lines
I propose to switch to this identification method when we have more machine references.
What do yo think?
No need from my perspective, if the current code works. I'll go ahead and apply your patch.
Thanks,
Guenter
Quoted 19 lines
Thanks, Sergio
Quoted 13 lines · Guenter Roeck
Sergio,
Quoted 3 lines · On 8/6/26 06:24, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Specific Lenovo model DMI quirks incorrectly useDMI_PRODUCT_FAMILYfor exact model string matching, causing all specific quirks to fail and fall back to incorrect generic profiles. --Please confirm that this is a non-issue.
Thanks,
Guenter
Quoted 9 lines · Sergio Melas
Add DMI quirk entries and map correct ACPI paths and configurations for additional Lenovo laptop models including the LOQ 15IAX9, XiaoXin Pro 13ARE 2020, IdeaPad 3 15ALC6, Legion Pro 7 16AFR10H, Yoga Pro 7 14IAH10, and Yoga 7 16ARP8.
Reorder the DMI quirk table to evaluate specific model matches before generic family fallbacks, preventing DMI shadowing.
Signed-off-by Sergio Melas <[email protected]>
Applied.
Thanks,
Guenter