mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: (yogafan) Support >2 fans and add additional Lenovo laptops
@ 2026-11-27  5:28 Sergio Melas
  2026-11-27  5:28 ` [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H Sergio Melas
  2026-11-27  5:28 ` [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops Sergio Melas
  0 siblings, 2 replies; 5+ messages in thread
From: Sergio Melas @ 2026-11-27  5:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel

Hi Guenter, all,

Apologies for being away over the last few months due to a family
illness, and thank you for taking care of the Yoga Pro 7 14IAH10
(83KF) fix in the meantime. I am back actively maintaining yogafan and
have audited the pending user-reported DSDT dumps.

This 2-patch series is based on hwmon-next (12c53b6b6):

- Patch 1/2 expands struct yogafan_config.paths from 2 to MAX_FANS (8)
  and adds the 3rd tachometer field (FASF) for the Legion Pro 7
  16AFR10H (83RU).
- Patch 2/2 adds DMI quirks and documentation for 9 user-reported
  Lenovo laptops (reusing existing yogafan_config structs wherever
  identical).

To avoid merge conflicts and duplication, this series intentionally
does not touch Yoga Pro 7 14IAH10 (83KF, already queued on hwmon fixes)
or Yoga 9 2-in-1 14ILL10 (83LC, submitted separately on the list).

Build-tested with W=1, checked with checkpatch.pl --strict --codespell
(0 errors, 0 warnings), and documentation verified with
SPHINXDIRS=hwmon make htmldocs.

Best regards,
Sergio

Sergio Melas (2):
  hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion
    Pro 7 16AFR10H
  hwmon: (yogafan) Add support for additional Lenovo laptops

 Documentation/hwmon/yogafan.rst |  21 ++++++
 drivers/hwmon/yogafan.c         | 112 +++++++++++++++++++++++++++++++-
 2 files changed, 131 insertions(+), 2 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H
  2026-11-27  5:28 [PATCH 0/2] hwmon: (yogafan) Support >2 fans and add additional Lenovo laptops Sergio Melas
@ 2026-11-27  5:28 ` Sergio Melas
  2026-11-27 19:30   ` Guenter Roeck
  2026-11-27  5:28 ` [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops Sergio Melas
  1 sibling, 1 reply; 5+ messages in thread
From: Sergio Melas @ 2026-11-27  5:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel

Expand struct yogafan_config.paths from 2 entries to MAX_FANS (8) so
laptops with more than two fans can be configured, matching struct
yoga_fan_data.

Update the Lenovo Legion Pro 7 16AFR10H (83RU) configuration to include
its third 8-bit tachometer field (\_SB.PCI0.LPC0.EC0.FASF, EC offset 0x04)
and update Documentation/hwmon/yogafan.rst accordingly.

Signed-off-by: Sergio Melas <sergiomelas@gmail.com>
---
 Documentation/hwmon/yogafan.rst |  2 ++
 drivers/hwmon/yogafan.c         | 12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/hwmon/yogafan.rst b/Documentation/hwmon/yogafan.rst
index 239c7b576..c30cd9c81 100644
--- a/Documentation/hwmon/yogafan.rst
+++ b/Documentation/hwmon/yogafan.rst
@@ -107,6 +107,7 @@ immediately to ensure the user knows the fan has stopped.
  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
+ 83RU           | Legion Pro 7 16     | 0x04      | \_SB.PCI0.LPC0.EC0.FASF (Fan3) |  8-bit | 100
  *Legacy*       | Pre-2020 Models     | 0x06      | \_SB.PCI0.LPC.EC.FAN0          |  8-bit | 100
  -------------------------------------------------------------------------------------------------------
 
@@ -165,3 +166,4 @@ Contributors & DSDT Providers:
 - **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)
+- **GabboRocchia** (Legion Pro 7 16AFR10H - 83RU 3rd fan)
diff --git a/drivers/hwmon/yogafan.c b/drivers/hwmon/yogafan.c
index 6d1284c09..172fdc198 100644
--- a/drivers/hwmon/yogafan.c
+++ b/drivers/hwmon/yogafan.c
@@ -41,7 +41,7 @@
 struct yogafan_config {
 	int multiplier;
 	int fan_count;
-	const char *paths[2];
+	const char *paths[MAX_FANS];
 };
 
 struct yoga_fan_data {
@@ -106,6 +106,14 @@ static const struct yogafan_config yoga_pro_83dn_cfg = {
 		   "\\_SB.PC00.LPCB.EC0.FA2S" }
 };
 
+static const struct yogafan_config legion_8bit_triple_cfg = {
+	.multiplier = 100,
+	.fan_count = 3,
+	.paths = { "\\_SB.PCI0.LPC0.EC0.FANS",
+		   "\\_SB.PCI0.LPC0.EC0.FA2S",
+		   "\\_SB.PCI0.LPC0.EC0.FASF" }
+};
+
 static void apply_rllag_filter(struct yoga_fan_data *data, int idx, long raw_rpm)
 {
 	ktime_t now = ktime_get_boottime();
@@ -259,7 +267,7 @@ static const struct dmi_system_id yogafan_quirks[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 			DMI_MATCH(DMI_PRODUCT_FAMILY, "Legion Pro 7 16AFR10H"),
 		},
-		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
+		.driver_data = (void *)&legion_8bit_triple_cfg,
 	},
 	{
 		.ident = "Lenovo Yoga Pro 7 14IAH10",
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops
  2026-11-27  5:28 [PATCH 0/2] hwmon: (yogafan) Support >2 fans and add additional Lenovo laptops Sergio Melas
  2026-11-27  5:28 ` [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H Sergio Melas
@ 2026-11-27  5:28 ` Sergio Melas
  2026-11-27 19:31   ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Sergio Melas @ 2026-11-27  5:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel

Add DMI quirks and ACPI fan tachometer configurations for nine
user-reported Lenovo laptops:

- IdeaPad 3 15ADA6 (82KR): 1 fan, 8-bit x100 (LPC0.EC0.FANS)
- IdeaPad 5 15ARE05 (81YQ): 1 fan, 8-bit x100 (LPC0.EC0.FANS)
- Legion 7 16ACHg6 (82N6): 2 fans, 8-bit x100 (LPC0.EC0.FANS/FA2S)
- Legion Slim 5 14APH8 (82Y5): 2 fans, 8-bit x100 (LPC0.EC0.FANS/FA2S)
- Legion Pro 7 16IAX10H (83F5): 3 fans, 8-bit x100 (PC00 FANS/FA2S/FASF)
- Yoga 7 16IAH7 (82UF): 2 fans, 8-bit x100 (PC00.LPCB.EC0.FANS/FA2S)
- Yoga 730-15IWL (81JS): 1 fan, 8-bit x100 (PCI0.LPCB.EC0.ERPM)
- Yoga Slim 7 15ILL9 (83HM): 2 fans, 16-bit x1 (PC00.LPCB.EC0.FANS/FA2S)
- Yoga Pro 9 16IAH10 (83L0): 2 fans, 16-bit x1 (PC00.LPCB.H_EC.FANS/FA2S)

Reuse existing yogafan_config structures where identical and update
Documentation/hwmon/yogafan.rst with the new models and contributors.

Signed-off-by: Sergio Melas <sergiomelas@gmail.com>
---
 Documentation/hwmon/yogafan.rst |  19 ++++++
 drivers/hwmon/yogafan.c         | 100 ++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+)

diff --git a/Documentation/hwmon/yogafan.rst b/Documentation/hwmon/yogafan.rst
index c30cd9c81..62992293b 100644
--- a/Documentation/hwmon/yogafan.rst
+++ b/Documentation/hwmon/yogafan.rst
@@ -108,6 +108,16 @@ immediately to ensure the user knows the fan has stopped.
  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
  83RU           | Legion Pro 7 16     | 0x04      | \_SB.PCI0.LPC0.EC0.FASF (Fan3) |  8-bit | 100
+ 82KR           | IdeaPad 3 15ADA6    | 0x06      | \_SB.PCI0.LPC0.EC0.FANS        |  8-bit | 100
+ 81YQ           | IdeaPad 5 15ARE05   | 0x06      | \_SB.PCI0.LPC0.EC0.FANS        |  8-bit | 100
+ 82N6           | Legion 7 16ACHg6    | 0x06/0xFE | \_SB.PCI0.LPC0.EC0.FANS/FA2S   |  8-bit | 100
+ 82Y5           | Legion Slim 5 14APH8| 0x06/0xFE | \_SB.PCI0.LPC0.EC0.FANS/FA2S   |  8-bit | 100
+ 83F5           | Legion Pro 7 16IAX10| 0x03/0x06 | \_SB.PC00.LPCB.EC0.FANS/FA2S   |  8-bit | 100
+ 83F5           | Legion Pro 7 16IAX10| 0x04      | \_SB.PC00.LPCB.EC0.FASF (Fan3) |  8-bit | 100
+ 82UF           | Yoga 7 16IAH7       | 0x06/0xFE | \_SB.PC00.LPCB.EC0.FANS/FA2S   |  8-bit | 100
+ 81JS           | YOGA 730-15IWL      | 0x06      | \_SB.PCI0.LPCB.EC0.ERPM        |  8-bit | 100
+ 83HM           | Yoga Slim 7 15ILL9  | 0x06/0xFE | \_SB.PC00.LPCB.EC0.FANS/FA2S   | 16-bit | 1
+ 83L0           | Yoga Pro 9 16IAH10  | 0x5A4     | \_SB.PC00.LPCB.H_EC.FANS/FA2S  | 16-bit | 1
  *Legacy*       | Pre-2020 Models     | 0x06      | \_SB.PCI0.LPC.EC.FAN0          |  8-bit | 100
  -------------------------------------------------------------------------------------------------------
 
@@ -167,3 +177,12 @@ Contributors & DSDT Providers:
 - **Phani Pavan K** (Yoga Pro 7 14IAH10 - 83KF)
 - **Splarkszter** (Yoga 7 16ARP8 - 83BS)
 - **GabboRocchia** (Legion Pro 7 16AFR10H - 83RU 3rd fan)
+- **dubhater** (IdeaPad 3 15ADA6 - 82KR)
+- **Voltair88** (IdeaPad 5 15ARE05 - 81YQ)
+- **magnumsolo** (Legion 7 16ACHg6 - 82N6)
+- **Dolik64** (Legion Slim 5 14APH8 - 82Y5)
+- **rzsn** (Legion Pro 7 16IAX10H - 83F5)
+- **slap2572** (Yoga 7 16IAH7 - 82UF)
+- **Lassebq** (YOGA 730-15IWL - 81JS)
+- **msourada** (Yoga Slim 7 15ILL9 - 83HM)
+- **geniusss87** (Yoga Pro 9 16IAH10 - 83L0)
diff --git a/drivers/hwmon/yogafan.c b/drivers/hwmon/yogafan.c
index 172fdc198..632eb0a8b 100644
--- a/drivers/hwmon/yogafan.c
+++ b/drivers/hwmon/yogafan.c
@@ -114,6 +114,34 @@ static const struct yogafan_config legion_8bit_triple_cfg = {
 		   "\\_SB.PCI0.LPC0.EC0.FASF" }
 };
 
+static const struct yogafan_config yoga_8bit_erpm_cfg = {
+	.multiplier = 100,
+	.fan_count = 1,
+	.paths = { "\\_SB.PCI0.LPCB.EC0.ERPM", NULL }
+};
+
+static const struct yogafan_config legion_pc00_8bit_triple_cfg = {
+	.multiplier = 100,
+	.fan_count = 3,
+	.paths = { "\\_SB.PC00.LPCB.EC0.FANS",
+		   "\\_SB.PC00.LPCB.EC0.FA2S",
+		   "\\_SB.PC00.LPCB.EC0.FASF" }
+};
+
+static const struct yogafan_config yoga_pc00_16bit_dual_cfg = {
+	.multiplier = 1,
+	.fan_count = 2,
+	.paths = { "\\_SB.PC00.LPCB.EC0.FANS",
+		   "\\_SB.PC00.LPCB.EC0.FA2S" }
+};
+
+static const struct yogafan_config yoga_pc00_hec_16bit_dual_cfg = {
+	.multiplier = 1,
+	.fan_count = 2,
+	.paths = { "\\_SB.PC00.LPCB.H_EC.FANS",
+		   "\\_SB.PC00.LPCB.H_EC.FA2S" }
+};
+
 static void apply_rllag_filter(struct yoga_fan_data *data, int idx, long raw_rpm)
 {
 	ktime_t now = ktime_get_boottime();
@@ -229,6 +257,78 @@ static const struct dmi_system_id yogafan_quirks[] = {
 		},
 		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
 	},
+	{
+		.ident = "Lenovo IdeaPad 3 15ADA6",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "IdeaPad 3 15ADA6"),
+		},
+		.driver_data = (void *)&yoga_8bit_fans_cfg,
+	},
+	{
+		.ident = "Lenovo IdeaPad 5 15ARE05",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "IdeaPad 5 15ARE05"),
+		},
+		.driver_data = (void *)&yoga_8bit_fans_cfg,
+	},
+	{
+		.ident = "Lenovo Legion 7 16ACHg6",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Legion 7 16ACHg6"),
+		},
+		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
+	},
+	{
+		.ident = "Lenovo Legion Slim 5 14APH8",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Legion Slim 5 14APH8"),
+		},
+		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
+	},
+	{
+		.ident = "Lenovo Legion Pro 7 16IAX10H",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Legion Pro 7 16IAX10H"),
+		},
+		.driver_data = (void *)&legion_pc00_8bit_triple_cfg,
+	},
+	{
+		.ident = "Lenovo Yoga 7 16IAH7",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 7 16IAH7"),
+		},
+		.driver_data = (void *)&yoga_pro_83dn_cfg,
+	},
+	{
+		.ident = "Lenovo Yoga 730-15IWL",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "YOGA 730-15IWL"),
+		},
+		.driver_data = (void *)&yoga_8bit_erpm_cfg,
+	},
+	{
+		.ident = "Lenovo Yoga Slim 7 15ILL9",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga Slim 7 15ILL9"),
+		},
+		.driver_data = (void *)&yoga_pc00_16bit_dual_cfg,
+	},
+	{
+		.ident = "Lenovo Yoga Pro 9 16IAH10",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga Pro 9 16IAH10"),
+		},
+		.driver_data = (void *)&yoga_pc00_hec_16bit_dual_cfg,
+	},
 	{
 		.ident = "Yoga 14cACN 2021",
 		.matches = {
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H
  2026-11-27  5:28 ` [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H Sergio Melas
@ 2026-11-27 19:30   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-11-27 19:30 UTC (permalink / raw)
  To: Sergio Melas; +Cc: linux-hwmon, linux-kernel

On Fri, Nov 27, 2026 at 06:28:40AM +0100, Sergio Melas wrote:
> Expand struct yogafan_config.paths from 2 entries to MAX_FANS (8) so
> laptops with more than two fans can be configured, matching struct
> yoga_fan_data.
> 
> Update the Lenovo Legion Pro 7 16AFR10H (83RU) configuration to include
> its third 8-bit tachometer field (\_SB.PCI0.LPC0.EC0.FASF, EC offset 0x04)
> and update Documentation/hwmon/yogafan.rst accordingly.
> 
> Signed-off-by: Sergio Melas <sergiomelas@gmail.com>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops
  2026-11-27  5:28 ` [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops Sergio Melas
@ 2026-11-27 19:31   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-11-27 19:31 UTC (permalink / raw)
  To: Sergio Melas; +Cc: linux-hwmon, linux-kernel

On Fri, Nov 27, 2026 at 06:28:41AM +0100, Sergio Melas wrote:
> Add DMI quirks and ACPI fan tachometer configurations for nine
> user-reported Lenovo laptops:
> 
> - IdeaPad 3 15ADA6 (82KR): 1 fan, 8-bit x100 (LPC0.EC0.FANS)
> - IdeaPad 5 15ARE05 (81YQ): 1 fan, 8-bit x100 (LPC0.EC0.FANS)
> - Legion 7 16ACHg6 (82N6): 2 fans, 8-bit x100 (LPC0.EC0.FANS/FA2S)
> - Legion Slim 5 14APH8 (82Y5): 2 fans, 8-bit x100 (LPC0.EC0.FANS/FA2S)
> - Legion Pro 7 16IAX10H (83F5): 3 fans, 8-bit x100 (PC00 FANS/FA2S/FASF)
> - Yoga 7 16IAH7 (82UF): 2 fans, 8-bit x100 (PC00.LPCB.EC0.FANS/FA2S)
> - Yoga 730-15IWL (81JS): 1 fan, 8-bit x100 (PCI0.LPCB.EC0.ERPM)
> - Yoga Slim 7 15ILL9 (83HM): 2 fans, 16-bit x1 (PC00.LPCB.EC0.FANS/FA2S)
> - Yoga Pro 9 16IAH10 (83L0): 2 fans, 16-bit x1 (PC00.LPCB.H_EC.FANS/FA2S)
> 
> Reuse existing yogafan_config structures where identical and update
> Documentation/hwmon/yogafan.rst with the new models and contributors.
> 
> Signed-off-by: Sergio Melas <sergiomelas@gmail.com>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-27 19:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  5:28 [PATCH 0/2] hwmon: (yogafan) Support >2 fans and add additional Lenovo laptops Sergio Melas
2026-11-27  5:28 ` [PATCH 1/2] hwmon: (yogafan) Support more than two fans and add 3rd fan for Legion Pro 7 16AFR10H Sergio Melas
2026-11-27 19:30   ` Guenter Roeck
2026-11-27  5:28 ` [PATCH 2/2] hwmon: (yogafan) Add support for additional Lenovo laptops Sergio Melas
2026-11-27 19:31   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®