Skip to contentSkip to conversation

hwmon: (yogafan) Add support for new Lenovo models

PATCH Superseded Sergio Melas 3 participants 3 messages Sep 7

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sergio Melas

author maintainer
#0 lore raw

PATCH 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: Yoga 14cACN 2021, IdeaPad 3 15ALC6 Ub and Yoga 740-15IML, leveraging DMI product family matching.

---
 drivers/hwmon/yogafan.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
drivers/hwmon/yogafan.c +29 -0
index 413ddc721..aa3284560 100644
@@ -53,6 +53,11 @@ struct yoga_fan_data {
 };
 
 /* Specific configurations mapped via DMI */
+static const struct yogafan_config yoga_740_15iml_cfg = {
+	.multiplier = 100,
+	.fan_count = 1,
+	.paths = { "\\_SB.PCI0.LPCB.EC0.FANS", NULL }
+};
 
 static const struct yogafan_config yoga_8bit_fans_cfg = {
 	.multiplier = 100,
@@ -200,6 +205,30 @@ static const struct hwmon_chip_info yoga_fan_chip_info = {
 };
 
 static const struct dmi_system_id yogafan_quirks[] = {
+	{
+		.ident = "Lenovo Yoga 740-15IML",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 740-15IML"),
+		},
+		.driver_data = (void *)&yoga_740_15iml_cfg,
+	},
+	{
+		.ident = "Lenovo IdeaPad 3 15ALC6 Ub",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "IdeaPad 3 15ALC6 Ub"),
+		},
+		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
+	},
+	{
+		.ident = "Yoga 14cACN 2021",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 14cACN 2021"),
+		},
+		.driver_data = (void *)&yoga_8bit_fans_cfg,
+	},
 	{
 		.ident = "Lenovo LOQ 15IAX9",
 		.matches = {
Signature · 1 line
2.55.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The DMI quirk entry for 'Yoga 14cACN 2021' is completely redundant and duplicates the fallback…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The DMI quirk entry for 'Yoga 14cACN 2021' is completely redundant and duplicates the fallback generic 'Lenovo Yoga' configuration. --

commit 11ad066ce5492c24b9a778e999582125b519d21a
Author: Sergio Melas <[email protected]>

hwmon: (yogafan) Add support for new Lenovo models

Add DMI quirk entries and map correct ACPI paths and configurations for additional Lenovo laptop models: Yoga 14cACN 2021, IdeaPad 3 15ALC6 Ub and Yoga 740-15IML, leveraging DMI product family matching.

Quoted 4 lines
drivers/hwmon/yogafan.c +0 -0
index 48fa5148d9e2c..2f86a8f6e0aeb 100644

[ ... ]

Quoted 4 lines
drivers/hwmon/yogafan.c +0 -0
@@ -189,6 +194,30 @@ 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 231

Quoted 8 lines
drivers/hwmon/yogafan.c +8 -0
+	{
+		.ident = "Yoga 14cACN 2021",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 14cACN 2021"),
+		},
+		.driver_data = (void *)&yoga_8bit_fans_cfg,
+	},

[Severity: Low]
Is this specific DMI entry necessary?

Since DMI_MATCH performs a substring match, it appears any system with a product family containing "Yoga 14cACN 2021" would already match the generic "Yoga" fallback entry located later in this same array.

Because both entries map to the exact same yoga_8bit_fans_cfg driver data, does this addition provide any functional benefit, or does it just duplicate the existing fallback behavior?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#2 lore raw
In reply to Sergio Melas
Quoted 6 lines · Sergio Melas

Add DMI quirk entries and map correct ACPI paths and configurations for additional Lenovo laptop models: Yoga 14cACN 2021, IdeaPad 3 15ALC6 Ub and Yoga 740-15IML, leveraging DMI product family matching.

---

This should be tagged v2, and change log goes here.

Guenter

Quoted 50 lines
  drivers/hwmon/yogafan.c | 29 +++++++++++++++++++++++++++++
  1 file changed, 29 insertions(+)
drivers/hwmon/yogafan.c +29 -0
index 413ddc721..aa3284560 100644
@@ -53,6 +53,11 @@ struct yoga_fan_data {
  };
 
  /* Specific configurations mapped via DMI */
+static const struct yogafan_config yoga_740_15iml_cfg = {
+	.multiplier = 100,
+	.fan_count = 1,
+	.paths = { "\\_SB.PCI0.LPCB.EC0.FANS", NULL }
+};
 
  static const struct yogafan_config yoga_8bit_fans_cfg = {
  	.multiplier = 100,
@@ -200,6 +205,30 @@ static const struct hwmon_chip_info yoga_fan_chip_info = {
  };
 
  static const struct dmi_system_id yogafan_quirks[] = {
+	{
+		.ident = "Lenovo Yoga 740-15IML",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 740-15IML"),
+		},
+		.driver_data = (void *)&yoga_740_15iml_cfg,
+	},
+	{
+		.ident = "Lenovo IdeaPad 3 15ALC6 Ub",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "IdeaPad 3 15ALC6 Ub"),
+		},
+		.driver_data = (void *)&xiaoxin_8bit_dual_cfg,
+	},
+	{
+		.ident = "Yoga 14cACN 2021",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Yoga 14cACN 2021"),
+		},
+		.driver_data = (void *)&yoga_8bit_fans_cfg,
+	},
  	{
  		.ident = "Lenovo LOQ 15IAX9",
  		.matches = {